Commit c0b98ac
ipv6: sr: block BH in seg6_output_core() and seg6_input_core()
As explained in commit 1378817 ("tipc: block BH
before using dst_cache"), net/core/dst_cache.c
helpers need to be called with BH disabled.
Disabling preemption in seg6_output_core() is not good enough,
because seg6_output_core() is called from process context,
lwtunnel_output() only uses rcu_read_lock().
We might be interrupted by a softirq, re-enter seg6_output_core()
and corrupt dst_cache data structures.
Fix the race by using local_bh_disable() instead of
preempt_disable().
Apply a similar change in seg6_input_core().
Fixes: fa79581 ("ipv6: sr: fix several BUGs when preemption is enabled")
Fixes: 6c8702c ("ipv6: sr: add support for SRH encapsulation and injection with lwtunnels")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: David Lebrun <dlebrun@google.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
Link: https://lore.kernel.org/r/20240531132636.2637995-4-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent db0090c commit c0b98ac
1 file changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | | - | |
470 | 469 | | |
471 | 470 | | |
472 | 471 | | |
473 | 472 | | |
474 | 473 | | |
475 | | - | |
476 | 474 | | |
477 | 475 | | |
478 | | - | |
479 | 476 | | |
480 | 477 | | |
481 | 478 | | |
482 | 479 | | |
483 | 480 | | |
| 481 | + | |
484 | 482 | | |
485 | 483 | | |
486 | 484 | | |
| |||
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
539 | | - | |
| 537 | + | |
540 | 538 | | |
541 | | - | |
| 539 | + | |
542 | 540 | | |
543 | 541 | | |
544 | 542 | | |
| |||
558 | 556 | | |
559 | 557 | | |
560 | 558 | | |
561 | | - | |
| 559 | + | |
562 | 560 | | |
563 | | - | |
| 561 | + | |
564 | 562 | | |
565 | 563 | | |
566 | 564 | | |
| |||
0 commit comments