seccomp: move brk+mmap+mmap2 into @default syscall filter set
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Nov 2020 10:14:41 +0000 (11:14 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 17:08:31 +0000 (18:08 +0100)
commit811f7fb15689002bc7e1b08f3462af253a4a1aa3
tree0b4aab8d97c08f1dba545d4fd98e857f3c1570d9
parente30dee26662a56db355e0f74389313f943a824ac
seccomp: move brk+mmap+mmap2 into @default syscall filter set

These three syscalls are internally used by libc's memory allocation
logic, i.e. ultimately back malloc(). Allocating a bit of memory is so
basic, it should just be in the default set.

This fixes a couple of issues with asan/msan and the seccomp tests: when
asan/msan is used some additional, large memory allocations take place
in the background, and unless mmap/mmap2/brk are allowlisted these will
fail, aborting the test prematurely.

(cherry picked from commit 5abede3247591248718026cb8be6cd231de7728b)
src/shared/seccomp-util.c