aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--security/selinux/hooks.c5
-rw-r--r--security/selinux/include/xfrm.h7
2 files changed, 11 insertions, 1 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 1dc935f7b919..33028b3b19ce 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -3591,6 +3591,11 @@ int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
3591 err = selinux_xfrm_decode_session(skb, &peersid, 0); 3591 err = selinux_xfrm_decode_session(skb, &peersid, 0);
3592 BUG_ON(err); 3592 BUG_ON(err);
3593 3593
3594 if (peersid == SECSID_NULL) {
3595 req->secid = sksec->sid;
3596 return 0;
3597 }
3598
3594 err = security_sid_mls_copy(sksec->sid, peersid, &newsid); 3599 err = security_sid_mls_copy(sksec->sid, peersid, &newsid);
3595 if (err) 3600 if (err)
3596 return err; 3601 return err;
diff --git a/security/selinux/include/xfrm.h b/security/selinux/include/xfrm.h
index 1822c73e5085..81eb59890162 100644
--- a/security/selinux/include/xfrm.h
+++ b/security/selinux/include/xfrm.h
@@ -20,7 +20,6 @@ int selinux_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir);
20int selinux_xfrm_state_pol_flow_match(struct xfrm_state *x, 20int selinux_xfrm_state_pol_flow_match(struct xfrm_state *x,
21 struct xfrm_policy *xp, struct flowi *fl); 21 struct xfrm_policy *xp, struct flowi *fl);
22int selinux_xfrm_flow_state_match(struct flowi *fl, struct xfrm_state *xfrm); 22int selinux_xfrm_flow_state_match(struct flowi *fl, struct xfrm_state *xfrm);
23int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *fl, int ckall);
24 23
25 24
26/* 25/*
@@ -41,6 +40,7 @@ int selinux_xfrm_postroute_last(u32 isec_sid, struct sk_buff *skb,
41 struct avc_audit_data *ad); 40 struct avc_audit_data *ad);
42u32 selinux_socket_getpeer_stream(struct sock *sk); 41u32 selinux_socket_getpeer_stream(struct sock *sk);
43u32 selinux_socket_getpeer_dgram(struct sk_buff *skb); 42u32 selinux_socket_getpeer_dgram(struct sk_buff *skb);
43int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall);
44#else 44#else
45static inline int selinux_xfrm_sock_rcv_skb(u32 isec_sid, struct sk_buff *skb, 45static inline int selinux_xfrm_sock_rcv_skb(u32 isec_sid, struct sk_buff *skb,
46 struct avc_audit_data *ad) 46 struct avc_audit_data *ad)
@@ -63,6 +63,11 @@ static inline int selinux_socket_getpeer_dgram(struct sk_buff *skb)
63{ 63{
64 return SECSID_NULL; 64 return SECSID_NULL;
65} 65}
66static inline int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall)
67{
68 *sid = SECSID_NULL;
69 return 0;
70}
66#endif 71#endif
67 72
68#endif /* _SELINUX_XFRM_H_ */ 73#endif /* _SELINUX_XFRM_H_ */