diff options
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index a509329a669b..84cebcdb3f83 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -826,6 +826,8 @@ struct request_sock; | |||
826 | * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. | 826 | * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. |
827 | * @inet_csk_clone: | 827 | * @inet_csk_clone: |
828 | * Sets the new child socket's sid to the openreq sid. | 828 | * Sets the new child socket's sid to the openreq sid. |
829 | * @inet_conn_established: | ||
830 | * Sets the connection's peersid to the secmark on skb. | ||
829 | * @req_classify_flow: | 831 | * @req_classify_flow: |
830 | * Sets the flow's sid to the openreq sid. | 832 | * Sets the flow's sid to the openreq sid. |
831 | * | 833 | * |
@@ -1368,6 +1370,7 @@ struct security_operations { | |||
1368 | int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, | 1370 | int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, |
1369 | struct request_sock *req); | 1371 | struct request_sock *req); |
1370 | void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); | 1372 | void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); |
1373 | void (*inet_conn_established)(struct sock *sk, struct sk_buff *skb); | ||
1371 | void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); | 1374 | void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); |
1372 | #endif /* CONFIG_SECURITY_NETWORK */ | 1375 | #endif /* CONFIG_SECURITY_NETWORK */ |
1373 | 1376 | ||
@@ -2961,9 +2964,15 @@ static inline void security_inet_csk_clone(struct sock *newsk, | |||
2961 | { | 2964 | { |
2962 | security_ops->inet_csk_clone(newsk, req); | 2965 | security_ops->inet_csk_clone(newsk, req); |
2963 | } | 2966 | } |
2967 | |||
2968 | static inline void security_inet_conn_established(struct sock *sk, | ||
2969 | struct sk_buff *skb) | ||
2970 | { | ||
2971 | security_ops->inet_conn_established(sk, skb); | ||
2972 | } | ||
2964 | #else /* CONFIG_SECURITY_NETWORK */ | 2973 | #else /* CONFIG_SECURITY_NETWORK */ |
2965 | static inline int security_unix_stream_connect(struct socket * sock, | 2974 | static inline int security_unix_stream_connect(struct socket * sock, |
2966 | struct socket * other, | 2975 | struct socket * other, |
2967 | struct sock * newsk) | 2976 | struct sock * newsk) |
2968 | { | 2977 | { |
2969 | return 0; | 2978 | return 0; |
@@ -3110,6 +3119,11 @@ static inline void security_inet_csk_clone(struct sock *newsk, | |||
3110 | const struct request_sock *req) | 3119 | const struct request_sock *req) |
3111 | { | 3120 | { |
3112 | } | 3121 | } |
3122 | |||
3123 | static inline void security_inet_conn_established(struct sock *sk, | ||
3124 | struct sk_buff *skb) | ||
3125 | { | ||
3126 | } | ||
3113 | #endif /* CONFIG_SECURITY_NETWORK */ | 3127 | #endif /* CONFIG_SECURITY_NETWORK */ |
3114 | 3128 | ||
3115 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 3129 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |