aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2012-01-03 12:25:16 -0500
committerEric Paris <eparis@redhat.com>2012-01-05 18:53:01 -0500
commitfd778461524849afd035679030ae8e8873c72b81 (patch)
tree32a5849c1879413fce0307af304e372eaa8225b4 /include/linux/security.h
parent69f594a38967f4540ce7a29b3fd214e68a8330bd (diff)
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 'include/linux/security.h')
-rw-r--r--include/linux/security.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index e345a9313a60..ba2d531c123f 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -95,7 +95,6 @@ struct xfrm_user_sec_ctx;
95struct seq_file; 95struct seq_file;
96 96
97extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 97extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
98extern int cap_netlink_recv(struct sk_buff *skb, int cap);
99 98
100void reset_security_ops(void); 99void reset_security_ops(void);
101 100
@@ -792,12 +791,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
792 * @skb contains the sk_buff structure for the netlink message. 791 * @skb contains the sk_buff structure for the netlink message.
793 * Return 0 if the information was successfully saved and message 792 * Return 0 if the information was successfully saved and message
794 * is allowed to be transmitted. 793 * is allowed to be transmitted.
795 * @netlink_recv:
796 * Check permission before processing the received netlink message in
797 * @skb.
798 * @skb contains the sk_buff structure for the netlink message.
799 * @cap indicates the capability required
800 * Return 0 if permission is granted.
801 * 794 *
802 * Security hooks for Unix domain networking. 795 * Security hooks for Unix domain networking.
803 * 796 *
@@ -1556,7 +1549,6 @@ struct security_operations {
1556 struct sembuf *sops, unsigned nsops, int alter); 1549 struct sembuf *sops, unsigned nsops, int alter);
1557 1550
1558 int (*netlink_send) (struct sock *sk, struct sk_buff *skb); 1551 int (*netlink_send) (struct sock *sk, struct sk_buff *skb);
1559 int (*netlink_recv) (struct sk_buff *skb, int cap);
1560 1552
1561 void (*d_instantiate) (struct dentry *dentry, struct inode *inode); 1553 void (*d_instantiate) (struct dentry *dentry, struct inode *inode);
1562 1554
@@ -1803,7 +1795,6 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode);
1803int security_getprocattr(struct task_struct *p, char *name, char **value); 1795int security_getprocattr(struct task_struct *p, char *name, char **value);
1804int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); 1796int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size);
1805int security_netlink_send(struct sock *sk, struct sk_buff *skb); 1797int security_netlink_send(struct sock *sk, struct sk_buff *skb);
1806int security_netlink_recv(struct sk_buff *skb, int cap);
1807int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); 1798int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
1808int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); 1799int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
1809void security_release_secctx(char *secdata, u32 seclen); 1800void security_release_secctx(char *secdata, u32 seclen);
@@ -2478,11 +2469,6 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb)
2478 return cap_netlink_send(sk, skb); 2469 return cap_netlink_send(sk, skb);
2479} 2470}
2480 2471
2481static inline int security_netlink_recv(struct sk_buff *skb, int cap)
2482{
2483 return cap_netlink_recv(skb, cap);
2484}
2485
2486static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) 2472static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2487{ 2473{
2488 return -EOPNOTSUPP; 2474 return -EOPNOTSUPP;