All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix broken peer recv check
@ 2012-07-20 21:42 Chad Hanson
  2012-07-26 15:32 ` Paul Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Chad Hanson @ 2012-07-20 21:42 UTC (permalink / raw)
  To: selinux

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 <chanson@trustedcs.com>
---
 hooks.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index d85b793..64826a0 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4215,8 +4215,10 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb)
 		}
 		err = avc_has_perm(sk_sid, peer_sid, SECCLASS_PEER,
 				   PEER__RECV, &ad);
-		if (err)
+		if (err) {
 			selinux_netlbl_err(skb, err, 0);
+			return err;
+		}
 	}
 
 	if (secmark_active) {


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix broken peer recv check
  2012-07-20 21:42 [PATCH] Fix broken peer recv check Chad Hanson
@ 2012-07-26 15:32 ` Paul Moore
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Moore @ 2012-07-26 15:32 UTC (permalink / raw)
  To: selinux, eparis; +Cc: Chad Hanson

On Friday, July 20, 2012 09:42:59 PM Chad Hanson wrote:
> 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 <chanson@trustedcs.com>

I would also consider this as reasonable for stable once it it merged.

Acked-by: Paul Moore <paul@paul-moore.com>

> ---
>  hooks.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index d85b793..64826a0 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -4215,8 +4215,10 @@ static int selinux_socket_sock_rcv_skb(struct sock
> *sk, struct sk_buff *skb) }
>  		err = avc_has_perm(sk_sid, peer_sid, SECCLASS_PEER,
>  				   PEER__RECV, &ad);
> -		if (err)
> +		if (err) {
>  			selinux_netlbl_err(skb, err, 0);
> +			return err;
> +		}
>  	}
> 
>  	if (secmark_active) {

-- 
paul moore
www.paul-moore.com


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-26 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 21:42 [PATCH] Fix broken peer recv check Chad Hanson
2012-07-26 15:32 ` Paul Moore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.