aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2016-01-24 17:08:39 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2016-01-31 18:15:27 -0500
commit7c7bdf35991bb8f7cfaeaf22ea3a2f2d1967c166 (patch)
treecc240b0d3ae203c7132a52f532fdd77dbd3e023a /net/netfilter
parentd93c6258ee4255749c10012c50a31c08f4e9fb16 (diff)
netfilter: nfnetlink: use original skbuff when acking batches
Since bd678e09dc17 ("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. Fixes: bd678e09dc17 ("netfilter: nfnetlink: fix splat due to incorrect socket memory accounting in skbuff clones") Reported-by: Dmitry Vyukov <dvyukov@google.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nfnetlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index a7ba23353dab..62e92af2384a 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -311,14 +311,14 @@ replay:
311#endif 311#endif
312 { 312 {
313 nfnl_unlock(subsys_id); 313 nfnl_unlock(subsys_id);
314 netlink_ack(skb, nlh, -EOPNOTSUPP); 314 netlink_ack(oskb, nlh, -EOPNOTSUPP);
315 return kfree_skb(skb); 315 return kfree_skb(skb);
316 } 316 }
317 } 317 }
318 318
319 if (!ss->commit || !ss->abort) { 319 if (!ss->commit || !ss->abort) {
320 nfnl_unlock(subsys_id); 320 nfnl_unlock(subsys_id);
321 netlink_ack(skb, nlh, -EOPNOTSUPP); 321 netlink_ack(oskb, nlh, -EOPNOTSUPP);
322 return kfree_skb(skb); 322 return kfree_skb(skb);
323 } 323 }
324 324
@@ -406,7 +406,7 @@ ack:
406 * pointing to the batch header. 406 * pointing to the batch header.
407 */ 407 */
408 nfnl_err_reset(&err_list); 408 nfnl_err_reset(&err_list);
409 netlink_ack(skb, nlmsg_hdr(oskb), -ENOMEM); 409 netlink_ack(oskb, nlmsg_hdr(oskb), -ENOMEM);
410 status |= NFNL_BATCH_FAILURE; 410 status |= NFNL_BATCH_FAILURE;
411 goto done; 411 goto done;
412 } 412 }