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.
/* 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,