From a5070935ff5abb92d51fbc1e75e24a4b1548848e Mon Sep 17 00:00:00 2001 From: "jooseong.lee" Date: Wed, 25 Mar 2015 10:58:10 +0900 Subject: [PATCH] Fix a bidirectional UDS connect check Change-Id: Ib074a4e8ea27fdfff3e30fb74ee90f32d68d37c9 Signed-off-by: jooseong.lee --- security/smack/smack_lsm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 28855d6..4b5515e 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c @@ -3087,14 +3087,12 @@ static int smack_unix_stream_connect(struct sock *sock, if (!smack_privileged(CAP_MAC_OVERRIDE)) { skp = ssp->smk_out; - okp = osp->smk_out; + okp = osp->smk_in; #ifdef CONFIG_AUDIT smk_ad_init_net(&ad, __func__, LSM_AUDIT_DATA_NET, &net); smk_ad_setfield_u_net_sk(&ad, other); #endif rc = smk_access(skp, okp->smk_known, MAY_WRITE, &ad); - if (rc == 0) - rc = smk_access(okp, okp->smk_known, MAY_WRITE, NULL); } /* -- 2.7.4