diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 15:30:42 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 15:30:42 +0000 |
commit | e8d70f5019396c8a4a2f1460e402e9781b248c9b (patch) | |
tree | efcc011406c9107c9d17ef3a084477cbfc151caa /sandbox | |
parent | 9d3a4a4baca7b11de64082bc44062a82eec0703d (diff) | |
download | chromium_src-e8d70f5019396c8a4a2f1460e402e9781b248c9b.zip chromium_src-e8d70f5019396c8a4a2f1460e402e9781b248c9b.tar.gz chromium_src-e8d70f5019396c8a4a2f1460e402e9781b248c9b.tar.bz2 |
Disable two yama tests on 3.2 kernels with 32bit userland and 64bit kernel.
Disabling yama restrictions is broken there.
BUG=391916
R=jorgelo@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281666
Review URL: https://codereview.chromium.org/371113003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281757 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/services/yama_unittests.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sandbox/linux/services/yama_unittests.cc b/sandbox/linux/services/yama_unittests.cc index 17ef4b40..4722af3 100644 --- a/sandbox/linux/services/yama_unittests.cc +++ b/sandbox/linux/services/yama_unittests.cc @@ -12,6 +12,8 @@ #include "base/bind.h" #include "base/compiler_specific.h" #include "base/posix/eintr_wrapper.h" +#include "base/strings/string_util.h" +#include "base/sys_info.h" #include "sandbox/linux/services/scoped_process.h" #include "sandbox/linux/services/yama.h" #include "sandbox/linux/tests/unit_tests.h" @@ -21,6 +23,21 @@ namespace sandbox { namespace { +bool HasLinux32Bug() { +#if defined(__i386__) + // On 3.2 kernels, yama doesn't work for 32-bit binaries on 64-bit kernels. + // This is fixed in 3.4. + bool is_kernel_64bit = + base::SysInfo::OperatingSystemArchitecture() == "x86_64"; + bool is_linux = base::SysInfo::OperatingSystemName() == "Linux"; + bool is_3_dot_2 = StartsWithASCII( + base::SysInfo::OperatingSystemVersion(), "3.2", /*case_sensitive=*/false); + if (is_kernel_64bit && is_linux && is_3_dot_2) + return true; +#endif // defined(__i386__) + return false; +} + bool CanPtrace(pid_t pid) { int ret; ret = ptrace(PTRACE_ATTACH, pid, NULL, NULL); |