diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/in.h | 1 | ||||
-rw-r--r-- | include/linux/security.h | 25 | ||||
-rw-r--r-- | include/linux/socket.h | 1 |
3 files changed, 21 insertions, 6 deletions
diff --git a/include/linux/in.h b/include/linux/in.h index ba355384016a..94f557fa4636 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -72,6 +72,7 @@ struct in_addr { | |||
72 | #define IP_FREEBIND 15 | 72 | #define IP_FREEBIND 15 |
73 | #define IP_IPSEC_POLICY 16 | 73 | #define IP_IPSEC_POLICY 16 |
74 | #define IP_XFRM_POLICY 17 | 74 | #define IP_XFRM_POLICY 17 |
75 | #define IP_PASSSEC 18 | ||
75 | 76 | ||
76 | /* BSD compatibility */ | 77 | /* BSD compatibility */ |
77 | #define IP_RECVRETOPTS IP_RETOPTS | 78 | #define IP_RECVRETOPTS IP_RETOPTS |
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 | ||
2744 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2745 | static 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 | |||
2751 | static 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 | ||
2750 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) | 2757 | static 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 | ||
2866 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2873 | static 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 | |||
2879 | static 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 | } |
diff --git a/include/linux/socket.h b/include/linux/socket.h index b02dda4ee83d..9ab2ddd80221 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -150,6 +150,7 @@ __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__ | |||
150 | 150 | ||
151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ | 151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ |
152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ | 152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ |
153 | #define SCM_SECURITY 0x03 /* rw: security label */ | ||
153 | 154 | ||
154 | struct ucred { | 155 | struct ucred { |
155 | __u32 pid; | 156 | __u32 pid; |