File chromium-135-add_map_droppable.patch of Package chromium
--- chromium-135.0.7023.0/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2025/04/04 08:28:56 1.1
+++ chromium-135.0.7023.0/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2025/04/04 08:29:47
@@ -34,6 +34,10 @@
#include "sandbox/linux/system_headers/linux_syscalls.h"
#include "sandbox/linux/system_headers/linux_time.h"
+#if !defined(MAP_DROPPABLE)
+#define MAP_DROPPABLE 0x08 // Zero memory under memory pressure.
+#endif
+
#if BUILDFLAG(IS_LINUX) && !defined(__arm__) && !defined(__aarch64__) && \
!defined(PTRACE_GET_THREAD_AREA)
// Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
@@ -236,7 +240,7 @@
// TODO(davidung), remove MAP_DENYWRITE with updated Tegra libraries.
const uint64_t kAllowedMask = MAP_SHARED | MAP_PRIVATE | MAP_ANONYMOUS |
MAP_STACK | MAP_NORESERVE | MAP_FIXED |
- MAP_DENYWRITE | MAP_LOCKED |
+ MAP_DENYWRITE | MAP_LOCKED | MAP_DROPPABLE |
kArchSpecificAllowedMask;
const Arg<int> flags(3);
return If((flags & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS());