Commit 4dc1ebd
Hangbin Liu
ipv6: Fix soft lockups in fib6_select_path under high next hop churn
JIRA: https://issues.redhat.com/browse/RHEL-73281
Upstream Status: net.git commit d9ccb18
Conflicts: context conflicts due to missing a lot selftest updates.
commit d9ccb18
Author: Omid Ehtemam-Haghighi <omid.ehtemamhaghighi@menlosecurity.com>
Date: Tue Nov 5 17:02:36 2024 -0800
ipv6: Fix soft lockups in fib6_select_path under high next hop churn
Soft lockups have been observed on a cluster of Linux-based edge routers
located in a highly dynamic environment. Using the `bird` service, these
routers continuously update BGP-advertised routes due to frequently
changing nexthop destinations, while also managing significant IPv6
traffic. The lockups occur during the traversal of the multipath
circular linked-list in the `fib6_select_path` function, particularly
while iterating through the siblings in the list. The issue typically
arises when the nodes of the linked list are unexpectedly deleted
concurrently on a different core—indicated by their 'next' and
'previous' elements pointing back to the node itself and their reference
count dropping to zero. This results in an infinite loop, leading to a
soft lockup that triggers a system panic via the watchdog timer.
Apply RCU primitives in the problematic code sections to resolve the
issue. Where necessary, update the references to fib6_siblings to
annotate or use the RCU APIs.
Include a test script that reproduces the issue. The script
periodically updates the routing table while generating a heavy load
of outgoing IPv6 traffic through multiple iperf3 clients. It
consistently induces infinite soft lockups within a couple of minutes.
Kernel log:
0 [ffffbd13003e8d30] machine_kexec at ffffffff8ceaf3eb
1 [ffffbd13003e8d90] __crash_kexec at ffffffff8d0120e3
2 [ffffbd13003e8e58] panic at ffffffff8cef65d4
3 [ffffbd13003e8ed8] watchdog_timer_fn at ffffffff8d05cb03
4 [ffffbd13003e8f08] __hrtimer_run_queues at ffffffff8cfec62f
5 [ffffbd13003e8f70] hrtimer_interrupt at ffffffff8cfed756
6 [ffffbd13003e8fd0] __sysvec_apic_timer_interrupt at ffffffff8cea01af
7 [ffffbd13003e8ff0] sysvec_apic_timer_interrupt at ffffffff8df1b83d
-- <IRQ stack> --
8 [ffffbd13003d3708] asm_sysvec_apic_timer_interrupt at ffffffff8e000ecb
[exception RIP: fib6_select_path+299]
RIP: ffffffff8ddafe7b RSP: ffffbd13003d37b8 RFLAGS: 00000287
RAX: ffff975850b43600 RBX: ffff975850b40200 RCX: 0000000000000000
RDX: 000000003fffffff RSI: 0000000051d383e4 RDI: ffff975850b43618
RBP: ffffbd13003d3800 R8: 0000000000000000 R9: ffff975850b40200
R10: 0000000000000000 R11: 0000000000000000 R12: ffffbd13003d3830
R13: ffff975850b436a8 R14: ffff975850b43600 R15: 0000000000000007
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
9 [ffffbd13003d3808] ip6_pol_route at ffffffff8ddb030c
10 [ffffbd13003d3888] ip6_pol_route_input at ffffffff8ddb068c
11 [ffffbd13003d3898] fib6_rule_lookup at ffffffff8ddf02b5
12 [ffffbd13003d3928] ip6_route_input at ffffffff8ddb0f47
13 [ffffbd13003d3a18] ip6_rcv_finish_core.constprop.0 at ffffffff8dd950d0
14 [ffffbd13003d3a30] ip6_list_rcv_finish.constprop.0 at ffffffff8dd96274
15 [ffffbd13003d3a98] ip6_sublist_rcv at ffffffff8dd96474
16 [ffffbd13003d3af8] ipv6_list_rcv at ffffffff8dd96615
17 [ffffbd13003d3b60] __netif_receive_skb_list_core at ffffffff8dc16fec
18 [ffffbd13003d3be0] netif_receive_skb_list_internal at ffffffff8dc176b3
19 [ffffbd13003d3c50] napi_gro_receive at ffffffff8dc565b9
20 [ffffbd13003d3c80] ice_receive_skb at ffffffffc087e4f5 [ice]
21 [ffffbd13003d3c90] ice_clean_rx_irq at ffffffffc0881b80 [ice]
22 [ffffbd13003d3d20] ice_napi_poll at ffffffffc088232f [ice]
23 [ffffbd13003d3d80] __napi_poll at ffffffff8dc18000
24 [ffffbd13003d3db8] net_rx_action at ffffffff8dc18581
25 [ffffbd13003d3e40] __do_softirq at ffffffff8df352e9
26 [ffffbd13003d3eb0] run_ksoftirqd at ffffffff8ceffe47
27 [ffffbd13003d3ec0] smpboot_thread_fn at ffffffff8cf36a30
28 [ffffbd13003d3ee8] kthread at ffffffff8cf2b39f
29 [ffffbd13003d3f28] ret_from_fork at ffffffff8ce5fa64
30 [ffffbd13003d3f50] ret_from_fork_asm at ffffffff8ce03cbb
Fixes: 66f5d6c ("ipv6: replace rwlock with rcu and spinlock in fib6_table")
Reported-by: Adrian Oliver <kernel@aoliver.ca>
Signed-off-by: Omid Ehtemam-Haghighi <omid.ehtemamhaghighi@menlosecurity.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Ido Schimmel <idosch@idosch.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Simon Horman <horms@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20241106010236.1239299-1-omid.ehtemamhaghighi@menlosecurity.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Hangbin Liu <haliu@redhat.com>1 parent d4d8fdf commit 4dc1ebd
File tree
4 files changed
+297
-19
lines changed- net/ipv6
- tools/testing/selftests/net
4 files changed
+297
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | | - | |
1187 | | - | |
| 1186 | + | |
| 1187 | + | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
| |||
1245 | 1245 | | |
1246 | 1246 | | |
1247 | 1247 | | |
1248 | | - | |
| 1248 | + | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | 1251 | | |
| |||
1959 | 1959 | | |
1960 | 1960 | | |
1961 | 1961 | | |
1962 | | - | |
| 1962 | + | |
1963 | 1963 | | |
1964 | 1964 | | |
1965 | 1965 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | 422 | | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
| 449 | + | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
| |||
5216 | 5216 | | |
5217 | 5217 | | |
5218 | 5218 | | |
| 5219 | + | |
| 5220 | + | |
5219 | 5221 | | |
5220 | | - | |
5221 | | - | |
5222 | | - | |
| 5222 | + | |
| 5223 | + | |
| 5224 | + | |
5223 | 5225 | | |
5224 | 5226 | | |
5225 | 5227 | | |
5226 | 5228 | | |
| 5229 | + | |
| 5230 | + | |
5227 | 5231 | | |
5228 | 5232 | | |
5229 | 5233 | | |
| |||
5568 | 5572 | | |
5569 | 5573 | | |
5570 | 5574 | | |
5571 | | - | |
5572 | 5575 | | |
| 5576 | + | |
5573 | 5577 | | |
5574 | 5578 | | |
5575 | 5579 | | |
5576 | 5580 | | |
5577 | 5581 | | |
5578 | | - | |
5579 | | - | |
| 5582 | + | |
| 5583 | + | |
| 5584 | + | |
| 5585 | + | |
5580 | 5586 | | |
5581 | 5587 | | |
| 5588 | + | |
| 5589 | + | |
5582 | 5590 | | |
5583 | 5591 | | |
5584 | 5592 | | |
| |||
5742 | 5750 | | |
5743 | 5751 | | |
5744 | 5752 | | |
5745 | | - | |
| 5753 | + | |
5746 | 5754 | | |
5747 | 5755 | | |
5748 | 5756 | | |
| |||
5754 | 5762 | | |
5755 | 5763 | | |
5756 | 5764 | | |
5757 | | - | |
5758 | | - | |
| 5765 | + | |
| 5766 | + | |
| 5767 | + | |
| 5768 | + | |
5759 | 5769 | | |
5760 | 5770 | | |
5761 | | - | |
| 5771 | + | |
| 5772 | + | |
| 5773 | + | |
5762 | 5774 | | |
| 5775 | + | |
5763 | 5776 | | |
5764 | 5777 | | |
| 5778 | + | |
| 5779 | + | |
5765 | 5780 | | |
5766 | 5781 | | |
5767 | 5782 | | |
| |||
6198 | 6213 | | |
6199 | 6214 | | |
6200 | 6215 | | |
6201 | | - | |
| 6216 | + | |
6202 | 6217 | | |
6203 | 6218 | | |
6204 | 6219 | | |
| |||
6211 | 6226 | | |
6212 | 6227 | | |
6213 | 6228 | | |
6214 | | - | |
| 6229 | + | |
6215 | 6230 | | |
6216 | 6231 | | |
6217 | 6232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
0 commit comments