netlink: kill loginuid/sessionid/sid members from struct netlink_skb_parms
Netlink message processing in the kernel is synchronous these days, the session information can be collected when needed. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
06dc94b1ed
commit
c53fa1ed92
7 changed files with 49 additions and 41 deletions
|
|
@ -4669,6 +4669,7 @@ static int selinux_netlink_recv(struct sk_buff *skb, int capability)
|
|||
{
|
||||
int err;
|
||||
struct common_audit_data ad;
|
||||
u32 sid;
|
||||
|
||||
err = cap_netlink_recv(skb, capability);
|
||||
if (err)
|
||||
|
|
@ -4677,8 +4678,9 @@ static int selinux_netlink_recv(struct sk_buff *skb, int capability)
|
|||
COMMON_AUDIT_DATA_INIT(&ad, CAP);
|
||||
ad.u.cap = capability;
|
||||
|
||||
return avc_has_perm(NETLINK_CB(skb).sid, NETLINK_CB(skb).sid,
|
||||
SECCLASS_CAPABILITY, CAP_TO_MASK(capability), &ad);
|
||||
security_task_getsecid(current, &sid);
|
||||
return avc_has_perm(sid, sid, SECCLASS_CAPABILITY,
|
||||
CAP_TO_MASK(capability), &ad);
|
||||
}
|
||||
|
||||
static int ipc_alloc_security(struct task_struct *task,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue