Files
systemd/src/bpf
Christian Brauner 9bb5d21c15 bpf-restrict-fsaccess: enforce W^X on file mappings
Right now RestrictFileSystemAccess= checks that a file comes from a
trusted dm-verity device, but it doesn't guard against mapping that file
and making use of COW modifications. So a MAP_PRIVATE mapping of a
trusted binary can be made writable, modified, and executed, while the
vma still points to the trusted file and the pages are
attacker-controlled anonymous copies.

Enforce W^X: deny any mapping that is writable and executable at once,
and refuse to make a private file mapping executable once it has been
modified through copy-on-write.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-08-31 23:33:40 +02:00
..