forked from Minki/linux
netfilter: ctnetlink: report error if event message allocation fails
This patch fixes an inconsistency that results in no error reports to user-space listeners if we fail to allocate the event message. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
98d500d66c
commit
150ace0db3
@ -512,7 +512,7 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
|
|||||||
|
|
||||||
skb = ctnetlink_alloc_skb(tuple(ct, IP_CT_DIR_ORIGINAL), GFP_ATOMIC);
|
skb = ctnetlink_alloc_skb(tuple(ct, IP_CT_DIR_ORIGINAL), GFP_ATOMIC);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return NOTIFY_DONE;
|
goto errout;
|
||||||
|
|
||||||
b = skb->tail;
|
b = skb->tail;
|
||||||
|
|
||||||
@ -591,8 +591,9 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
|
|||||||
nla_put_failure:
|
nla_put_failure:
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
nlmsg_failure:
|
nlmsg_failure:
|
||||||
nfnetlink_set_err(0, group, -ENOBUFS);
|
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
errout:
|
||||||
|
nfnetlink_set_err(0, group, -ENOBUFS);
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
|
#endif /* CONFIG_NF_CONNTRACK_EVENTS */
|
||||||
@ -1564,7 +1565,7 @@ static int ctnetlink_expect_event(struct notifier_block *this,
|
|||||||
|
|
||||||
skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
|
skb = alloc_skb(NLMSG_GOODSIZE, GFP_ATOMIC);
|
||||||
if (!skb)
|
if (!skb)
|
||||||
return NOTIFY_DONE;
|
goto errout;
|
||||||
|
|
||||||
b = skb->tail;
|
b = skb->tail;
|
||||||
|
|
||||||
@ -1589,8 +1590,9 @@ static int ctnetlink_expect_event(struct notifier_block *this,
|
|||||||
nla_put_failure:
|
nla_put_failure:
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
nlmsg_failure:
|
nlmsg_failure:
|
||||||
nfnetlink_set_err(0, 0, -ENOBUFS);
|
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
|
errout:
|
||||||
|
nfnetlink_set_err(0, 0, -ENOBUFS);
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user