aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 7cbef482e13a..b18eb8cfa639 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1286,7 +1286,8 @@ struct security_operations {
1286 int (*socket_setsockopt) (struct socket * sock, int level, int optname); 1286 int (*socket_setsockopt) (struct socket * sock, int level, int optname);
1287 int (*socket_shutdown) (struct socket * sock, int how); 1287 int (*socket_shutdown) (struct socket * sock, int how);
1288 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); 1288 int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb);
1289 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1289 int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1290 int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen);
1290 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1291 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1291 void (*sk_free_security) (struct sock *sk); 1292 void (*sk_free_security) (struct sock *sk);
1292 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); 1293 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
@@ -2741,10 +2742,16 @@ static inline int security_sock_rcv_skb (struct sock * sk,
2741 return security_ops->socket_sock_rcv_skb (sk, skb); 2742 return security_ops->socket_sock_rcv_skb (sk, skb);
2742} 2743}
2743 2744
2744static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, 2745static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2745 int __user *optlen, unsigned len) 2746 int __user *optlen, unsigned len)
2746{ 2747{
2747 return security_ops->socket_getpeersec(sock, optval, optlen, len); 2748 return security_ops->socket_getpeersec_stream(sock, optval, optlen, len);
2749}
2750
2751static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
2752 u32 *seclen)
2753{
2754 return security_ops->socket_getpeersec_dgram(skb, secdata, seclen);
2748} 2755}
2749 2756
2750static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) 2757static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
@@ -2863,8 +2870,14 @@ static inline int security_sock_rcv_skb (struct sock * sk,
2863 return 0; 2870 return 0;
2864} 2871}
2865 2872
2866static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, 2873static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval,
2867 int __user *optlen, unsigned len) 2874 int __user *optlen, unsigned len)
2875{
2876 return -ENOPROTOOPT;
2877}
2878
2879static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata,
2880 u32 *seclen)
2868{ 2881{
2869 return -ENOPROTOOPT; 2882 return -ENOPROTOOPT;
2870} 2883}