diff options
Diffstat (limited to 'security/smack/smack_lsm.c')
-rw-r--r-- | security/smack/smack_lsm.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c index 6a8226541327..dab8af17ef38 100644 --- a/security/smack/smack_lsm.c +++ b/security/smack/smack_lsm.c | |||
@@ -2773,6 +2773,7 @@ static int smack_unix_stream_connect(struct sock *sock, | |||
2773 | { | 2773 | { |
2774 | struct socket_smack *ssp = sock->sk_security; | 2774 | struct socket_smack *ssp = sock->sk_security; |
2775 | struct socket_smack *osp = other->sk_security; | 2775 | struct socket_smack *osp = other->sk_security; |
2776 | struct socket_smack *nsp = newsk->sk_security; | ||
2776 | struct smk_audit_info ad; | 2777 | struct smk_audit_info ad; |
2777 | int rc = 0; | 2778 | int rc = 0; |
2778 | 2779 | ||
@@ -2782,6 +2783,14 @@ static int smack_unix_stream_connect(struct sock *sock, | |||
2782 | if (!capable(CAP_MAC_OVERRIDE)) | 2783 | if (!capable(CAP_MAC_OVERRIDE)) |
2783 | rc = smk_access(ssp->smk_out, osp->smk_in, MAY_WRITE, &ad); | 2784 | rc = smk_access(ssp->smk_out, osp->smk_in, MAY_WRITE, &ad); |
2784 | 2785 | ||
2786 | /* | ||
2787 | * Cross reference the peer labels for SO_PEERSEC. | ||
2788 | */ | ||
2789 | if (rc == 0) { | ||
2790 | nsp->smk_packet = ssp->smk_out; | ||
2791 | ssp->smk_packet = osp->smk_out; | ||
2792 | } | ||
2793 | |||
2785 | return rc; | 2794 | return rc; |
2786 | } | 2795 | } |
2787 | 2796 | ||