Bug 1376653 - Fix handling of architecture differences for getdents. r=gcp
authorJed Davis <jld@mozilla.com>
Tue, 11 Jul 2017 17:03:06 -0600
changeset 418239 f68747fe8a15bc355f6380b760d747d52a9f4d26
parent 418238 9b5bb669d1283995fd8d01fe779bd8646cb2cd92
child 418240 86878427cd44e6e0627cb30fe738e29092c915cf
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1376653
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1376653 - Fix handling of architecture differences for getdents. r=gcp MozReview-Commit-ID: ArGStWwkJAg
security/sandbox/linux/SandboxFilterUtil.h
--- a/security/sandbox/linux/SandboxFilterUtil.h
+++ b/security/sandbox/linux/SandboxFilterUtil.h
@@ -100,34 +100,38 @@ public:
 #ifdef __NR_stat64
 #define CASES_FOR_stat   case __NR_stat64
 #define CASES_FOR_lstat   case __NR_lstat64
 #define CASES_FOR_fstat   case __NR_fstat64
 #define CASES_FOR_fstatat   case __NR_fstatat64
 #define CASES_FOR_statfs   case __NR_statfs64: case __NR_statfs
 #define CASES_FOR_fstatfs   case __NR_fstatfs64: case __NR_fstatfs
 #define CASES_FOR_fcntl   case __NR_fcntl64
-// We're using the 32-bit version on 32-bit desktop for some reason.
-#define CASES_FOR_getdents   case __NR_getdents64: case __NR_getdents
 // FIXME: we might not need the compat cases for these on non-Android:
 #define CASES_FOR_lseek   case __NR_lseek: case __NR__llseek
 #define CASES_FOR_ftruncate   case __NR_ftruncate: case __NR_ftruncate64
 #else
 #define CASES_FOR_stat   case __NR_stat
 #define CASES_FOR_lstat   case __NR_lstat
 #define CASES_FOR_fstatat   case __NR_newfstatat
 #define CASES_FOR_fstat   case __NR_fstat
 #define CASES_FOR_fstatfs   case __NR_fstatfs
 #define CASES_FOR_statfs   case __NR_statfs
 #define CASES_FOR_fcntl   case __NR_fcntl
-#define CASES_FOR_getdents   case __NR_getdents
 #define CASES_FOR_lseek   case __NR_lseek
 #define CASES_FOR_ftruncate   case __NR_ftruncate
 #endif
 
+// getdents is not like the other FS-related syscalls with a "64" variant
+#ifdef __NR_getdents
+#define CASES_FOR_getdents   case __NR_getdents64: case __NR_getdents
+#else
+#define CASES_FOR_getdents   case __NR_getdents64
+#endif
+
 #ifdef __NR_sigprocmask
 #define CASES_FOR_sigprocmask   case __NR_sigprocmask: case __NR_rt_sigprocmask
 #define CASES_FOR_sigaction   case __NR_sigaction: case __NR_rt_sigaction
 #define CASES_FOR_sigreturn   case __NR_sigreturn: case __NR_rt_sigreturn
 #else
 #define CASES_FOR_sigprocmask   case __NR_rt_sigprocmask
 #define CASES_FOR_sigaction   case __NR_rt_sigaction
 #define CASES_FOR_sigreturn   case __NR_rt_sigreturn