diff options
author | machenbach@chromium.org <machenbach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 16:23:53 +0000 |
---|---|---|
committer | machenbach@chromium.org <machenbach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 16:23:53 +0000 |
commit | ec0e1e5a692388443804e6cce23a01d6b02e447e (patch) | |
tree | 72b38af74b62926855f42caceb6ae2ce80a319ca /sandbox | |
parent | f51fbca53b00f6207ceeed413df01b20c26710ad (diff) | |
download | chromium_src-ec0e1e5a692388443804e6cce23a01d6b02e447e.zip chromium_src-ec0e1e5a692388443804e6cce23a01d6b02e447e.tar.gz chromium_src-ec0e1e5a692388443804e6cce23a01d6b02e447e.tar.bz2 |
Revert of Revert of Disable yama on 3.2 kernels with 32bit userland and 64bit kernel. (https://codereview.chromium.org/374933002/)
Reason for revert:
[Sheriff] This was fixed already in 281762.
Original issue's description:
> Revert of Disable yama on 3.2 kernels with 32bit userland and 64bit kernel. (https://codereview.chromium.org/371113003/)
>
> Reason for revert:
> Broke clang builders:
> https://build.chromium.org/p/chromium.linux/builders/Linux%20Clang%20(dbg)/builds/61819/steps/compile/logs/stdio
>
> Original issue's description:
> > 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
> >
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281757
>
> TBR=jorgelo@chromium.org,keescook@chromium.org,thakis@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=391916
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281763
TBR=jorgelo@chromium.org,keescook@chromium.org,thakis@chromium.org,eseidel@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=391916
Review URL: https://codereview.chromium.org/374943002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281764 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 40accb7..a4100a6 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); |