netlink: don't modprobe proto audit & selinux

Upstream: no

audit and selinux never be a module, if kernel don't support it,
don't probe it. This prevent centos6 ssh/bash auditting trigger
modprobe wildly.

Signed-off-by: Samuel Liao <samuelliao@tencent.com>
(cherry picked from commit 4b5692d7510f8f47a97cc36e71d691e75b442594)
Signed-off-by: katrinzhou <katrinzhou@tencent.com>
This commit is contained in:
katrinzhou 2022-04-14 17:18:38 +08:00 committed by Kairui Song
parent 42f5e22854
commit 649609195b
1 changed files with 1 additions and 1 deletions

View File

@ -689,7 +689,7 @@ static int netlink_create(struct net *net, struct socket *sock, int protocol,
netlink_lock_table();
#ifdef CONFIG_MODULES
if (!nl_table[protocol].registered) {
if (!nl_table[protocol].registered && protocol != NETLINK_AUDIT && protocol != NETLINK_SELINUX) {
netlink_unlock_table();
request_module("net-pf-%d-proto-%d", PF_NETLINK, protocol);
netlink_lock_table();