bpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports
authorJulia Kartseva <hex@fb.com>
Thu, 4 Feb 2021 06:15:27 +0000 (22:15 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 15 May 2021 17:31:29 +0000 (19:31 +0200)
commitbaff489b82bb33c1b13249993f940721fef7671e
tree11d220a5981c3f3a7a5b17ab2e6ccd12ef73ea93
parent58a56b6a14d5cc9b7ecdd397d7ab6b76170fad08
bpf-firewall: attach with BPF_F_ALLOW_MULTI if kernel supports

Reduced version of [0].
Use BPF_F_ALLOW_MULTI attach flag for bpf-firewall if kernel supports
it.

Aside from addressing security issue in [0] attaching with 'multi'
allows further attaching of cgroup egress, ingress hooks specified by
BPFProgram=.

[0] https://github.com/systemd/systemd/pull/17495/commits/4e42210d40f96e185a55d43041dd6b962ea830dd

(cherry picked from commit a442ccb4ebdbc3a9ff9d4504eb9724092149fd42)
(cherry picked from commit 0af3810d4b1c8bb4f0683758f47e042e8cb76972)
src/core/bpf-firewall.c