diff options
author | Paul Moore <paul.moore@hp.com> | 2006-11-17 17:38:54 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:24:14 -0500 |
commit | 3de4bab5b9f8848a0c16a4b1ffe0452f0d670237 (patch) | |
tree | f65c12b53bf2ad02645ea31522f67e7318019498 /security/selinux/include/selinux_netlabel.h | |
parent | 9f2ad66509b182b399a5b03de487f45bde623524 (diff) |
SELinux: peer secid consolidation for external network labeling
Now that labeled IPsec makes use of the peer_sid field in the
sk_security_struct we can remove a lot of the special cases between labeled
IPsec and NetLabel. In addition, create a new function,
security_skb_extlbl_sid(), which we can use in several places to get the
security context of the packet's external label which allows us to further
simplify the code in a few places.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/include/selinux_netlabel.h')
-rw-r--r-- | security/selinux/include/selinux_netlabel.h | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/security/selinux/include/selinux_netlabel.h b/security/selinux/include/selinux_netlabel.h index 57943f4a8f90..2a732c9033e3 100644 --- a/security/selinux/include/selinux_netlabel.h +++ b/security/selinux/include/selinux_netlabel.h | |||
@@ -38,14 +38,12 @@ | |||
38 | 38 | ||
39 | #ifdef CONFIG_NETLABEL | 39 | #ifdef CONFIG_NETLABEL |
40 | void selinux_netlbl_cache_invalidate(void); | 40 | void selinux_netlbl_cache_invalidate(void); |
41 | int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, u32 base_sid, u32 *sid); | ||
41 | int selinux_netlbl_socket_post_create(struct socket *sock); | 42 | int selinux_netlbl_socket_post_create(struct socket *sock); |
42 | void selinux_netlbl_sock_graft(struct sock *sk, struct socket *sock); | 43 | void selinux_netlbl_sock_graft(struct sock *sk, struct socket *sock); |
43 | u32 selinux_netlbl_inet_conn_request(struct sk_buff *skb, u32 sock_sid); | ||
44 | int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, | 44 | int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, |
45 | struct sk_buff *skb, | 45 | struct sk_buff *skb, |
46 | struct avc_audit_data *ad); | 46 | struct avc_audit_data *ad); |
47 | u32 selinux_netlbl_socket_getpeersec_stream(struct socket *sock); | ||
48 | u32 selinux_netlbl_socket_getpeersec_dgram(struct sk_buff *skb); | ||
49 | void selinux_netlbl_sk_security_reset(struct sk_security_struct *ssec, | 47 | void selinux_netlbl_sk_security_reset(struct sk_security_struct *ssec, |
50 | int family); | 48 | int family); |
51 | void selinux_netlbl_sk_security_init(struct sk_security_struct *ssec, | 49 | void selinux_netlbl_sk_security_init(struct sk_security_struct *ssec, |
@@ -62,6 +60,14 @@ static inline void selinux_netlbl_cache_invalidate(void) | |||
62 | return; | 60 | return; |
63 | } | 61 | } |
64 | 62 | ||
63 | static inline int selinux_netlbl_skbuff_getsid(struct sk_buff *skb, | ||
64 | u32 base_sid, | ||
65 | u32 *sid) | ||
66 | { | ||
67 | *sid = SECSID_NULL; | ||
68 | return 0; | ||
69 | } | ||
70 | |||
65 | static inline int selinux_netlbl_socket_post_create(struct socket *sock) | 71 | static inline int selinux_netlbl_socket_post_create(struct socket *sock) |
66 | { | 72 | { |
67 | return 0; | 73 | return 0; |
@@ -73,12 +79,6 @@ static inline void selinux_netlbl_sock_graft(struct sock *sk, | |||
73 | return; | 79 | return; |
74 | } | 80 | } |
75 | 81 | ||
76 | static inline u32 selinux_netlbl_inet_conn_request(struct sk_buff *skb, | ||
77 | u32 sock_sid) | ||
78 | { | ||
79 | return SECSID_NULL; | ||
80 | } | ||
81 | |||
82 | static inline int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, | 82 | static inline int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, |
83 | struct sk_buff *skb, | 83 | struct sk_buff *skb, |
84 | struct avc_audit_data *ad) | 84 | struct avc_audit_data *ad) |
@@ -86,16 +86,6 @@ static inline int selinux_netlbl_sock_rcv_skb(struct sk_security_struct *sksec, | |||
86 | return 0; | 86 | return 0; |
87 | } | 87 | } |
88 | 88 | ||
89 | static inline u32 selinux_netlbl_socket_getpeersec_stream(struct socket *sock) | ||
90 | { | ||
91 | return SECSID_NULL; | ||
92 | } | ||
93 | |||
94 | static inline u32 selinux_netlbl_socket_getpeersec_dgram(struct sk_buff *skb) | ||
95 | { | ||
96 | return SECSID_NULL; | ||
97 | } | ||
98 | |||
99 | static inline void selinux_netlbl_sk_security_reset( | 89 | static inline void selinux_netlbl_sk_security_reset( |
100 | struct sk_security_struct *ssec, | 90 | struct sk_security_struct *ssec, |
101 | int family) | 91 | int family) |