]> git.ipfire.org Git - thirdparty/openssh-portable.git/commit
harden Linux seccomp sandbox
authorDamien Miller <djm@mindrot.org>
Fri, 3 Feb 2023 05:33:09 +0000 (16:33 +1100)
committerDamien Miller <djm@mindrot.org>
Mon, 6 Feb 2023 02:26:42 +0000 (13:26 +1100)
commit195313dfe10a23c82e9d56d5fdd2f59beee1bdcf
tree23f78567741a9fffda976e08499319ea522bb62b
parent6dfb65de949cdd0a5d198edee9a118f265924f33
harden Linux seccomp sandbox

Linux mmap(2) and madvise(2) syscalls support quite a number of funky
flags that we don't expect that sshd/libc will ever need. We can
exclude this kernel attack surface by filtering the mmap(2) flags
and the madvise(2) advice arguments.

Similarly, the sandboxed process in sshd is a single-threaded program
that does not use shared memory for synchronisation or communication.
Therefore, there should be no reason for the advanced priority
inheritance futex(2) operations to be necessary. These can also be
excluded.

Motivated by Jann Horn pointing out that there have been kernel bugs
in nearby Linux kernel code, e.g. CVE-2020-29368, CVE-2020-29374 and
CVE-2022-42703.

Feedback Jann Horn, ok dtucker@
sandbox-seccomp-filter.c