You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
audit: add netlink audit protocol bind to check capabilities on multicast join
Register a netlink per-protocol bind fuction for audit to check userspace process capabilities before allowing a multicast group connection. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
7774d5e03f
commit
3a101b8de0
@@ -1076,10 +1076,20 @@ static void audit_receive(struct sk_buff *skb)
|
||||
mutex_unlock(&audit_cmd_mutex);
|
||||
}
|
||||
|
||||
/* Run custom bind function on netlink socket group connect or bind requests. */
|
||||
static int audit_bind(int group)
|
||||
{
|
||||
if (!capable(CAP_AUDIT_READ))
|
||||
return -EPERM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __net_init audit_net_init(struct net *net)
|
||||
{
|
||||
struct netlink_kernel_cfg cfg = {
|
||||
.input = audit_receive,
|
||||
.bind = audit_bind,
|
||||
};
|
||||
|
||||
struct audit_net *aunet = net_generic(net, audit_net_id);
|
||||
|
||||
Reference in New Issue
Block a user