• Eric Dumazet's avatar
    ipv6: remove nexthop_fib6_nh_bh() · ef1148d4
    Eric Dumazet authored
    After blamed commit, nexthop_fib6_nh_bh() and nexthop_fib6_nh()
    are the same.
    
    Delete nexthop_fib6_nh_bh(), and convert /proc/net/ipv6_route
    to standard rcu to avoid this splat:
    
    [ 5723.180080] WARNING: suspicious RCU usage
    [ 5723.180083] -----------------------------
    [ 5723.180084] include/net/nexthop.h:516 suspicious rcu_dereference_check() usage!
    [ 5723.180086]
    other info that might help us debug this:
    
    [ 5723.180087]
    rcu_scheduler_active = 2, debug_locks = 1
    [ 5723.180089] 2 locks held by cat/55856:
    [ 5723.180091] #0: ffff9440a582afa8 (&p->lock){+.+.}-{3:3}, at: seq_read_iter (fs/seq_file.c:188)
    [ 5723.180100] #1: ffffffffaac07040 (rcu_read_lock_bh){....}-{1:2}, at: rcu_lock_acquire (include/linux/rcupdate.h:326)
    [ 5723.180109]
    stack backtrace:
    [ 5723.180111] CPU: 14 PID: 55856 Comm: cat Tainted: G S        I        6.3.0-dbx-DEV #528
    [ 5723.180115] Call Trace:
    [ 5723.180117]  <TASK>
    [ 5723.180119] dump_stack_lvl (lib/dump_stack.c:107)
    [ 5723.180124] dump_stack (lib/dump_stack.c:114)
    [ 5723.180126] lockdep_rcu_suspicious (include/linux/context_tracking.h:122)
    [ 5723.180132] ipv6_route_seq_show (include/net/nexthop.h:?)
    [ 5723.180135] ? ipv6_route_seq_next (net/ipv6/ip6_fib.c:2605)
    [ 5723.180140] seq_read_iter (fs/seq_file.c:272)
    [ 5723.180145] seq_read (fs/seq_file.c:163)
    [ 5723.180151] proc_reg_read (fs/proc/inode.c:316 fs/proc/inode.c:328)
    [ 5723.180155] vfs_read (fs/read_write.c:468)
    [ 5723.180160] ? up_read (kernel/locking/rwsem.c:1617)
    [ 5723.180164] ksys_read (fs/read_write.c:613)
    [ 5723.180168] __x64_sys_read (fs/read_write.c:621)
    [ 5723.180170] do_syscall_64 (arch/x86/entry/common.c:?)
    [ 5723.180174] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
    [ 5723.180177] RIP: 0033:0x7fa455677d2a
    
    Fixes: 09eed119 ("neighbour: switch to standard rcu, instead of rcu_bh")
    Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
    Link: https://lore.kernel.org/r/20230510154646.370659-1-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    ef1148d4
nexthop.h 11.8 KB