Skip to content

Commit 598cdbc

Browse files
dahchansonpcmoore
authored andcommitted
selinux: fix broken peer recv check
Fix a broken networking check. Return an error if peer recv fails. If secmark is active and the packet recv succeeds the peer recv error is ignored. Signed-off-by: Chad Hanson <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent 5c6c268 commit 598cdbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

security/selinux/hooks.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,8 +4338,10 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
43384338
}
43394339
err = avc_has_perm(sk_sid, peer_sid, SECCLASS_PEER,
43404340
PEER__RECV, &ad);
4341-
if (err)
4341+
if (err) {
43424342
selinux_netlbl_err(skb, err, 0);
4343+
return err;
4344+
}
43434345
}
43444346

43454347
if (secmark_active) {

0 commit comments

Comments
 (0)