Commit b01d7ca3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] SELinux: Fix error handling bug.

From: James Morris <jmorris@redhat.com>

The patch below fixes an error handling flaw, where we need to return a
Netfilter verdict from the function rather than a standard error code.
parent e76445c8
......@@ -3179,8 +3179,9 @@ static unsigned int selinux_ip_postroute_last(unsigned int hooknum,
/* Fixme: this lookup is inefficient */
iph = skb->nh.iph;
err = security_node_sid(PF_INET, &iph->daddr, sizeof(iph->daddr), &node_sid);
if (err)
err = security_node_sid(PF_INET, &iph->daddr, sizeof(iph->daddr),
&node_sid) ? NF_DROP : NF_ACCEPT;
if (err != NF_ACCEPT)
goto out;
err = avc_has_perm(isec->sid, node_sid, SECCLASS_NODE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment