Stop batch evaluation on the first EMLINK error, ruleset validation is expensive and it could take a while before user recovers control after sending a batch with too many jump/goto chain. Fixes: 0628b123c96d ("netfilter: nfnetlink: add batch support and use it from nf_tables") Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nfnetlink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 811d02b4c4f7..315240b2368e 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c @@ -558,6 +558,10 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, */ if (err) status |= NFNL_BATCH_FAILURE; + + /* EMLINK is fatal, stop processing batch. */ + if (err == -EMLINK) + goto done; } msglen = NLMSG_ALIGN(nlh->nlmsg_len); -- 2.30.2