seccomp sandbox: restrict mremap flags

In the seccomp sandbox, restrict use of mremap(2) to only permit
its use with the MREMAP_MAYMOVE flag and specifically not the
MREMAP_FIXED flag, as the latter may have some use as part of an
attack chain.

Reported by: Mohammad Hossein Abedini <mhmd.abedinii@gmail.com>

ok deraadt@
This commit is contained in:
Damien Miller committed 2026-09-03 14:14:37 +10:00
1 parent 8e964781e4
commit 769728b835
1 file changed
+1 -1
+1 -1
View File
@@ -367,7 +367,7 @@ static const struct sock_filter preauth_insns[] = {
SC_ALLOW_ARG_MASK(__NR_mprotect, 2, PROT_READ|PROT_WRITE|PROT_NONE),
#endif
#ifdef __NR_mremap
SC_ALLOW(__NR_mremap),
SC_ALLOW_ARG_MASK(__NR_mremap, 3, MREMAP_MAYMOVE),
#endif
#ifdef __NR_munmap
SC_ALLOW(__NR_munmap),