mirror of
https://github.com/torvalds/linux.git
synced 2026-09-02 14:09:03 +02:00
A user reported [0] hitting the WARN_ON in fib_info_nh:
[ 8633.839816] ------------[ cut here ]------------
[ 8633.839819] WARNING: CPU: 0 PID: 1719 at include/net/nexthop.h:251 fib_select_path+0x303/0x381
...
[ 8633.839846] RIP: 0010:fib_select_path+0x303/0x381
...
[ 8633.839848] RSP: 0018:ffffb04d407f7d00 EFLAGS: 00010286
[ 8633.839850] RAX: 0000000000000000 RBX: ffff9460b9897ee8 RCX: 00000000000000fe
[ 8633.839851] RDX: 0000000000000000 RSI: 00000000ffffffff RDI: 0000000000000000
[ 8633.839852] RBP: ffff946076049850 R08: 0000000059263a83 R09: ffff9460840e4000
[ 8633.839853] R10: 0000000000000014 R11: 0000000000000000 R12: ffffb04d407f7dc0
[ 8633.839854] R13: ffffffffa4ce3240 R14: 0000000000000000 R15: ffff9460b7681f60
[ 8633.839857] FS: 00007fcac2e02700(0000) GS:ffff9460bdc00000(0000) knlGS:0000000000000000
[ 8633.839858] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 8633.839859] CR2: 00007f27beb77e28 CR3: 0000000077734000 CR4: 00000000000006f0
[ 8633.839867] Call Trace:
[ 8633.839871] ip_route_output_key_hash_rcu+0x421/0x890
[ 8633.839873] ip_route_output_key_hash+0x5e/0x80
[ 8633.839876] ip_route_output_flow+0x1a/0x50
[ 8633.839878] __ip4_datagram_connect+0x154/0x310
[ 8633.839880] ip4_datagram_connect+0x28/0x40
[ 8633.839882] __sys_connect+0xd6/0x100
...
The WARN_ON is triggered in fib_select_default which is invoked when
there are multiple default routes. Update the function to use
fib_info_nhc and convert the nexthop checks to use fib_nh_common.
Add test case that covers the affected code path.
[0] https://github.com/FRRouting/frr/issues/6089
Fixes:
|
||
|---|---|---|
| .. | ||
| forwarding | ||
| mptcp | ||
| .gitignore | ||
| altnames.sh | ||
| config | ||
| fcnal-test.sh | ||
| fib_nexthop_multiprefix.sh | ||
| fib_nexthops.sh | ||
| fib_rule_tests.sh | ||
| fib_tests.sh | ||
| fib-onlink-tests.sh | ||
| fin_ack_lat.c | ||
| fin_ack_lat.sh | ||
| hwtstamp_config.c | ||
| icmp_redirect.sh | ||
| in_netns.sh | ||
| ip_defrag.c | ||
| ip_defrag.sh | ||
| ip6_gre_headroom.sh | ||
| ipv6_flowlabel_mgr.c | ||
| ipv6_flowlabel.c | ||
| ipv6_flowlabel.sh | ||
| l2tp.sh | ||
| Makefile | ||
| msg_zerocopy.c | ||
| msg_zerocopy.sh | ||
| netdevice.sh | ||
| nettest.c | ||
| pmtu.sh | ||
| psock_fanout.c | ||
| psock_lib.h | ||
| psock_snd.c | ||
| psock_snd.sh | ||
| psock_tpacket.c | ||
| reuseaddr_conflict.c | ||
| reuseaddr_ports_exhausted.c | ||
| reuseaddr_ports_exhausted.sh | ||
| reuseport_addr_any.c | ||
| reuseport_addr_any.sh | ||
| reuseport_bpf_cpu.c | ||
| reuseport_bpf_numa.c | ||
| reuseport_bpf.c | ||
| reuseport_dualstack.c | ||
| route_localnet.sh | ||
| rtnetlink.sh | ||
| run_afpackettests | ||
| run_netsocktests | ||
| rxtimestamp.c | ||
| so_txtime.c | ||
| so_txtime.sh | ||
| socket.c | ||
| tcp_fastopen_backup_key.c | ||
| tcp_fastopen_backup_key.sh | ||
| tcp_inq.c | ||
| tcp_mmap.c | ||
| test_blackhole_dev.sh | ||
| test_bpf.sh | ||
| test_vxlan_fdb_changelink.sh | ||
| test_vxlan_under_vrf.sh | ||
| timestamping.c | ||
| tls.c | ||
| traceroute.sh | ||
| txring_overwrite.c | ||
| txtimestamp.c | ||
| txtimestamp.sh | ||
| udpgro_bench.sh | ||
| udpgro.sh | ||
| udpgso_bench_rx.c | ||
| udpgso_bench_tx.c | ||
| udpgso_bench.sh | ||
| udpgso.c | ||
| udpgso.sh | ||
| xfrm_policy.sh | ||