X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=security%2Fselinux%2Fhooks.c;h=f590fb8e91430909246213934b17970f827870c7;hb=04f6d70f6e64900a5d70a5fc199dd9d5fa787738;hp=d9154cf90ae19cd4eb5f40d65882abb60781da3d;hpb=bbd128b5acae85b2ef346e95cc5a729ac5252f19;p=net-next-2.6.git diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d9154cf90ae..f590fb8e914 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -4585,7 +4585,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex, secmark_perm = PACKET__SEND; break; default: - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); } if (secmark_perm == PACKET__FORWARD_OUT) { if (selinux_skb_peerlbl_sid(skb, family, &peer_sid)) @@ -4607,7 +4607,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex, if (secmark_active) if (avc_has_perm(peer_sid, skb->secmark, SECCLASS_PACKET, secmark_perm, &ad)) - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); if (peerlbl_active) { u32 if_sid; @@ -4617,13 +4617,13 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex, return NF_DROP; if (avc_has_perm(peer_sid, if_sid, SECCLASS_NETIF, NETIF__EGRESS, &ad)) - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); if (sel_netnode_sid(addrp, family, &node_sid)) return NF_DROP; if (avc_has_perm(peer_sid, node_sid, SECCLASS_NODE, NODE__SENDTO, &ad)) - return NF_DROP; + return NF_DROP_ERR(-ECONNREFUSED); } return NF_ACCEPT;