From: Eric Paris Date: Tue, 23 Nov 2010 06:28:08 +0000 (+0000) Subject: SELinux: indicate fatal error in compat netfilter code X-Git-Tag: upstream/snapshot3+hdmi~12141^2~475 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2fe66ec242d3f76e3b0101f36419e7e5405bcff3;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git SELinux: indicate fatal error in compat netfilter code The SELinux ip postroute code indicates when policy rejected a packet and passes the error back up the stack. The compat code does not. This patch sends the same kind of error back up the stack in the compat code. Based-on-patch-by: Paul Moore Signed-off-by: Eric Paris Reviewed-by: Paul Moore Signed-off-by: David S. Miller --- diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index f590fb8..156ef93 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -4524,11 +4524,11 @@ static unsigned int selinux_ip_postroute_compat(struct sk_buff *skb, if (selinux_secmark_enabled()) if (avc_has_perm(sksec->sid, skb->secmark, SECCLASS_PACKET, PACKET__SEND, &ad)) - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); if (selinux_policycap_netpeer) if (selinux_xfrm_postroute_last(sksec->sid, skb, &ad, proto)) - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); return NF_ACCEPT; }