Loading init/security.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <errno.h> #include <fcntl.h> #include <linux/perf_event.h> #include <math.h> #include <selinux/selinux.h> #include <sys/ioctl.h> #include <sys/syscall.h> Loading Loading @@ -121,8 +122,12 @@ Result<void> SetMmapRndBitsAction(const BuiltinArguments&) { } #elif defined(__x86_64__) // x86_64 supports 28 - 32 rnd bits, but Android wants to ensure that the // theoretical maximum of 32 bits is always supported and used. if (SetMmapRndBitsMin(32, 32, false) && (!Has32BitAbi() || SetMmapRndBitsMin(16, 16, true))) { // theoretical maximum of 32 bits is always supported and used; except in // the case of the x86 page size emulator which supports a maximum // of 30 bits for 16k page size, or 28 bits for 64k page size. int max_bits = 32 - (static_cast<int>(log2(getpagesize())) - 12); if (SetMmapRndBitsMin(max_bits, max_bits, false) && (!Has32BitAbi() || SetMmapRndBitsMin(16, 16, true))) { return {}; } #elif defined(__arm__) || defined(__i386__) Loading Loading
init/security.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <errno.h> #include <fcntl.h> #include <linux/perf_event.h> #include <math.h> #include <selinux/selinux.h> #include <sys/ioctl.h> #include <sys/syscall.h> Loading Loading @@ -121,8 +122,12 @@ Result<void> SetMmapRndBitsAction(const BuiltinArguments&) { } #elif defined(__x86_64__) // x86_64 supports 28 - 32 rnd bits, but Android wants to ensure that the // theoretical maximum of 32 bits is always supported and used. if (SetMmapRndBitsMin(32, 32, false) && (!Has32BitAbi() || SetMmapRndBitsMin(16, 16, true))) { // theoretical maximum of 32 bits is always supported and used; except in // the case of the x86 page size emulator which supports a maximum // of 30 bits for 16k page size, or 28 bits for 64k page size. int max_bits = 32 - (static_cast<int>(log2(getpagesize())) - 12); if (SetMmapRndBitsMin(max_bits, max_bits, false) && (!Has32BitAbi() || SetMmapRndBitsMin(16, 16, true))) { return {}; } #elif defined(__arm__) || defined(__i386__) Loading