[MLSXFRM]: Fix build with SECURITY_NETWORK_XFRM disabled.

The following patch will fix the build problem (encountered by Andrew
Morton) when SECURITY_NETWORK_XFRM is not enabled.

As compared to git-net-selinux_xfrm_decode_session-build-fix.patch in
-mm, this patch sets the return parameter sid to SECSID_NULL in
selinux_xfrm_decode_session() and handles this value in the caller
selinux_inet_conn_request() appropriately.

Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Venkat Yekkirala
2006-07-27 22:01:34 -07:00
committed by David S. Miller
parent 4237c75c0a
commit a51c64f1e5
2 changed files with 11 additions and 1 deletions

View File

@@ -3591,6 +3591,11 @@ int selinux_inet_conn_request(struct sock *sk, struct sk_buff *skb,
err = selinux_xfrm_decode_session(skb, &peersid, 0);
BUG_ON(err);
if (peersid == SECSID_NULL) {
req->secid = sksec->sid;
return 0;
}
err = security_sid_mls_copy(sksec->sid, peersid, &newsid);
if (err)
return err;