Skip to content

Commit b02e173

Browse files
ummakynesjb-essential
authored andcommitted
netfilter: nfnetlink: use original skbuff when acking batches
Since bd678e0 ("netfilter: nfnetlink: fix splat due to incorrect socket memory accounting in skbuff clones"), we don't manually attach the sk to the skbuff clone anymore, so we have to use the original skbuff from netlink_ack() which needs to access the sk pointer. Change-Id: I4ae7e9c52d9a10f8c88dbd179506bae94d5080e4 Fixes: bd678e0 ("netfilter: nfnetlink: fix splat due to incorrect socket memory accounting in skbuff clones") Reported-by: Dmitry Vyukov <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 7b98f3d commit b02e173

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/netfilter/nfnetlink.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,14 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
309309
#endif
310310
{
311311
nfnl_unlock(subsys_id);
312-
netlink_ack(skb, nlh, -EOPNOTSUPP);
312+
netlink_ack(oskb, nlh, -EOPNOTSUPP);
313313
return kfree_skb(skb);
314314
}
315315
}
316316

317317
if (!ss->commit || !ss->abort) {
318318
nfnl_unlock(subsys_id);
319-
netlink_ack(skb, nlh, -EOPNOTSUPP);
319+
netlink_ack(oskb, nlh, -EOPNOTSUPP);
320320
return kfree_skb(skb);
321321
}
322322

@@ -406,7 +406,7 @@ static void nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh,
406406
* pointing to the batch header.
407407
*/
408408
nfnl_err_reset(&err_list);
409-
netlink_ack(skb, nlmsg_hdr(oskb), -ENOMEM);
409+
netlink_ack(oskb, nlmsg_hdr(oskb), -ENOMEM);
410410
status |= NFNL_BATCH_FAILURE;
411411
goto done;
412412
}

0 commit comments

Comments
 (0)