aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2012-01-03 12:25:16 -0500
committerZiyan <jaraidaniel@gmail.com>2016-03-11 01:10:38 +0100
commit3a279b3c70ce1eab679130d6fc8b8dd8f4345109 (patch)
treef5c7bd7606cb087f613053cc074a3dc8dffc6555 /security/selinux
parent7c175efb67473b6328afeb7c6a3181d38fd12f84 (diff)
downloadkernel_samsung_tuna-3a279b3c70ce1eab679130d6fc8b8dd8f4345109.zip
kernel_samsung_tuna-3a279b3c70ce1eab679130d6fc8b8dd8f4345109.tar.gz
kernel_samsung_tuna-3a279b3c70ce1eab679130d6fc8b8dd8f4345109.tar.bz2
security: remove the security_netlink_recv hook as it is equivalent to capable()
Once upon a time netlink was not sync and we had to get the effective capabilities from the skb that was being received. Today we instead get the capabilities from the current task. This has rendered the entire purpose of the hook moot as it is now functionally equivalent to the capable() call. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/hooks.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 7db421c..382af56 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4839,24 +4839,6 @@ static int selinux_netlink_send(struct sock *sk, struct sk_buff *skb)
return selinux_nlmsg_perm(sk, skb);
}
-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)
- return err;
-
- COMMON_AUDIT_DATA_INIT(&ad, CAP);
- ad.u.cap = capability;
-
- 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,
struct kern_ipc_perm *perm,
u16 sclass)
@@ -5590,7 +5572,6 @@ static struct security_operations selinux_ops = {
.vm_enough_memory = selinux_vm_enough_memory,
.netlink_send = selinux_netlink_send,
- .netlink_recv = selinux_netlink_recv,
.bprm_set_creds = selinux_bprm_set_creds,
.bprm_committing_creds = selinux_bprm_committing_creds,