Index: sandbox/linux/services/yama_unittests.cc |
diff --git a/sandbox/linux/services/yama_unittests.cc b/sandbox/linux/services/yama_unittests.cc |
index a4100a6c37d346d0ca5af6e230444f3bc44cb596..7d4acc71e27efb9cd169605d4f9a956b176b35ce 100644 |
--- a/sandbox/linux/services/yama_unittests.cc |
+++ b/sandbox/linux/services/yama_unittests.cc |
@@ -24,18 +24,10 @@ 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; |
+ return prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0) < 0 && |
+ errno == EINVAL; |
} |
bool CanPtrace(pid_t pid) { |