Skip to content

Commit a1a64a1

Browse files
committed
netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
If caller reports ENOMEM, then stop iterating over the batch and send a single netlink message to userspace to report OOM. Fixes: cbb8125 ("netfilter: nfnetlink: deliver netlink errors on batch completion") Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 212ed75 commit a1a64a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nfnetlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
533533
* processed, this avoids that the same error is
534534
* reported several times when replaying the batch.
535535
*/
536-
if (nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
536+
if (err == -ENOMEM ||
537+
nfnl_err_add(&err_list, nlh, err, &extack) < 0) {
537538
/* We failed to enqueue an error, reset the
538539
* list of errors and send OOM to userspace
539540
* pointing to the batch header.

0 commit comments

Comments
 (0)