Commit ca43ccf
dccp/tcp: Avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions.
Eric Dumazet pointed out [0] that when we call skb_set_owner_r()
for ipv6_pinfo.pktoptions, sk_rmem_schedule() has not been called,
resulting in a negative sk_forward_alloc.
We add a new helper which clones a skb and sets its owner only
when sk_rmem_schedule() succeeds.
Note that we move skb_set_owner_r() forward in (dccp|tcp)_v6_do_rcv()
because tcp_send_synack() can make sk_forward_alloc negative before
ipv6_opt_accepted() in the crossed SYN-ACK or self-connect() cases.
[0]: https://lore.kernel.org/netdev/CANn89iK9oc20Jdi_41jb9URdF210r7d1Y-+uypbMSbOfY6jqrg@mail.gmail.com/
Fixes: 323fbd0 ("net: dccp: Add handling of IPV6_PKTOPTIONS to dccp_v6_do_rcv()")
Fixes: 3df80d9 ("[DCCP]: Introduce DCCPv6")
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 7fa0b52 commit ca43ccf
3 files changed
+18
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2437 | 2450 | | |
2438 | 2451 | | |
2439 | 2452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | | - | |
| 554 | + | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
558 | | - | |
559 | 557 | | |
560 | 558 | | |
561 | 559 | | |
| |||
615 | 613 | | |
616 | 614 | | |
617 | 615 | | |
618 | | - | |
| 616 | + | |
619 | 617 | | |
620 | 618 | | |
621 | 619 | | |
| |||
679 | 677 | | |
680 | 678 | | |
681 | 679 | | |
682 | | - | |
683 | 680 | | |
684 | 681 | | |
685 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
1392 | | - | |
| 1391 | + | |
1393 | 1392 | | |
1394 | 1393 | | |
1395 | | - | |
| 1394 | + | |
1396 | 1395 | | |
1397 | | - | |
1398 | | - | |
1399 | 1396 | | |
1400 | 1397 | | |
1401 | 1398 | | |
| |||
1467 | 1464 | | |
1468 | 1465 | | |
1469 | 1466 | | |
1470 | | - | |
| 1467 | + | |
1471 | 1468 | | |
1472 | 1469 | | |
1473 | 1470 | | |
| |||
1553 | 1550 | | |
1554 | 1551 | | |
1555 | 1552 | | |
1556 | | - | |
1557 | 1553 | | |
1558 | 1554 | | |
1559 | 1555 | | |
| |||
0 commit comments