Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
seccomp: deduplicate default profile
Several syscalls were enabled globally (SCMP_ACT_ALLOW without any conditions for all containers), but also had conditional rules later in the profile (likely inherited from Docker). The following syscalls do not need special casing because they were globally enabled: * clone, unshare, mount, umount, umount2 all had special CAP_SYS_ADMIN restrictions but those don't make sense since they were also enabled for all containers. * reboot was permitted for CAP_SYS_BOOT and all containers. * name_to_handle_at was permitted for CAP_SYS_ADMIN, CAP_SYS_NICE(?), and all containers. And certain syscalls had globally-enabled rules when they shouldn't have: * socket has special rules for CAP_AUDIT_WRITE but it also had a global "allow unconditionally" rule. It turns out that libseccomp will override unconditional rules with conditional ones but this is somewhat of an implementation detail and it's much safer to remove the rule and use the existing cases. Now the only syscalls remaining with complicated rules (meaning they appear more than once in the profile) are: * sync_file_range2 which is architecture specific (though in principle we could move it to enabled-without-rules because runc ignores unknown syscalls). Signed-off-by: Aleksa Sarai <[email protected]>
- Loading branch information