]> git.ipfire.org Git - thirdparty/systemd.git/commit
seccomp: drop SECCOMP_MEMORY_DENY_WRITE_EXECUTE_BROKEN, add test for shmat
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 4 May 2017 14:09:53 +0000 (14:09 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 7 May 2017 22:59:37 +0000 (18:59 -0400)
commit2a65bd94e44f121a27afd39fdde6b462394c3e59
tree887d4d4620a8ae018c046da191a7b92fcd1e3c53
parentdce0e62046015a5128d7ae559a9b8595c9a62af4
seccomp: drop SECCOMP_MEMORY_DENY_WRITE_EXECUTE_BROKEN, add test for shmat

SECCOMP_MEMORY_DENY_WRITE_EXECUTE_BROKEN was conflating two separate things:
1. whether shmat/shmdt/shmget can be filtered (if ipc multiplexer is used, they can not)
2. whether we know this for the current architecture

For i386, shmat is implemented as ipc, so seccomp filter is "broken" for shmat,
but not for mmap, and SECCOMP_MEMORY_DENY_WRITE_EXECUTE_BROKEN cannot be used
to cover both cases. The define was only used for tests — not in the implementation
in seccomp-util.c. So let's get rid of SECCOMP_MEMORY_DENY_WRITE_EXECUTE_BROKEN
and encode the right condition directly in tests.
src/shared/seccomp-util.h
src/test/test-seccomp.c