Open rusty-snake opened 2 years ago
Would make a nice enhancement. FWIW I always try to run apps without netlink via local overrides. Only in very rare cases it is actually needed. So, in other words, besides netlink filtering we could drop netlink from protocol for known 'good' applications too IMO. More of a note for future reference when doing PR's.
Is your feature request related to a problem? Please describe.
AF_NETLINK
exposes a (huge) attack surface for the kernel. See https://github.com/netblue30/firejail/issues/4013#issuecomment-786780504 and #4020 for previous discussions.cc @kris7t @glitsj16
Describe the solution you'd like
The socket syscall looks like
int socket(int domain, int type, int protocol);
. We already filter the first argument (domain
) withprotocol unix,inet,inet6,netlink
. To minimize the attack surface ofAF_NETLINK
we should filter the third/last argument (protocol
) if the first isAF_NETLINK
(netlink_socket = socket(AF_NETLINK, socket_type, netlink_family);
).Describe alternatives you've considered
N/A
Additional context
N/A