summaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2011-03-03 10:55:40 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-03 10:55:40 -0800
commitc53fa1ed92cd671a1dfb1e7569e9ab672612ddc6 (patch)
tree9bb539a7731af94cac0112b8f13771e4a33e0450 /security/selinux/hooks.c
parent06dc94b1ed05f91e246315afeb1c652d6d0dc9ab (diff)
downloadop-kernel-dev-c53fa1ed92cd671a1dfb1e7569e9ab672612ddc6.zip
op-kernel-dev-c53fa1ed92cd671a1dfb1e7569e9ab672612ddc6.tar.gz
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>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c8d6992..cef42f5 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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,
OpenPOWER on IntegriCloud