====================================== | [ 23.697852][ T384] ================================================================== | [ 23.698084][ T384] BUG: KASAN: null-ptr-deref in nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) | [ 23.698310][ T384] Read of size 4 at addr 0000000000000068 by task ip/384 | [ 23.698478][ T384] [ 23.698553][ T384] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 23.698555][ T384] Call Trace: [ 23.698557][ T384] [ 23.698559][ T384] dump_stack_lvl (lib/dump_stack.c:123) [ 23.698566][ T384] kasan_report (mm/kasan/report.c:636) [ 23.698573][ T384] ? nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) [ 23.698578][ T384] kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) [ 23.698582][ T384] nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) [ 23.698588][ T384] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 23.698591][ T384] ? __nla_validate_parse (lib/nlattr.c:638) [ 23.698600][ T384] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 23.698604][ T384] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:230) [ 23.698609][ T384] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 23.698614][ T384] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 23.698626][ T384] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 23.698634][ T384] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 23.698638][ T384] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 23.698642][ T384] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 23.698646][ T384] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:230) [ 23.698648][ T384] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 23.698653][ T384] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 23.698657][ T384] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 23.698662][ T384] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 23.698667][ T384] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 23.698674][ T384] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 23.698678][ T384] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 ./include/net/netns/generic.h:48 net/netlink/af_netlink.c:333) [ 23.698681][ T384] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 23.698685][ T384] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 23.698688][ T384] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 23.698693][ T384] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 23.698697][ T384] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 23.698703][ T384] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 23.698712][ T384] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 23.698715][ T384] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 23.698723][ T384] ___sys_sendmsg (net/socket.c:2619) [ 23.698726][ T384] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 23.698728][ T384] ? __pfx___lock_release (kernel/locking/lockdep.c:5503) [ 23.698732][ T384] ? __pfx_handle_pte_fault (mm/memory.c:5864) [ 23.698740][ T384] ? __handle_mm_fault (mm/memory.c:6050) [ 23.698743][ T384] ? __pfx___handle_mm_fault (mm/memory.c:5959) [ 23.698746][ T384] ? mt_find (lib/maple_tree.c:6909) [ 23.698752][ T384] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 23.698756][ T384] ? __lock_release (kernel/locking/lockdep.c:5527) [ 23.698758][ T384] ? do_user_addr_fault (./include/linux/mmap_lock.h:218 arch/x86/mm/fault.c:1416) [ 23.698765][ T384] __sys_sendmsg (net/socket.c:2649) [ 23.698768][ T384] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 23.698773][ T384] ? do_user_addr_fault (./include/linux/mmap_lock.h:218 arch/x86/mm/fault.c:1416) [ 23.698778][ T384] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 23.698783][ T384] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 23.698788][ T384] RIP: 0033:0x7ff50a49b9a7 [ 23.698792][ T384] Code: 0a 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 All code ======== 0: 0a 00 or (%rax),%al 2: f7 d8 neg %eax 4: 64 89 02 mov %eax,%fs:(%rdx) 7: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax e: eb b9 jmp 0xffffffffffffffc9 10: 0f 1f 00 nopl (%rax) 13: f3 0f 1e fa endbr64 17: 64 8b 04 25 18 00 00 mov %fs:0x18,%eax 1e: 00 1f: 85 c0 test %eax,%eax 21: 75 10 jne 0x33 23: b8 2e 00 00 00 mov $0x2e,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 51 ja 0x83 32: c3 ret 33: 48 83 ec 28 sub $0x28,%rsp 37: 89 54 24 1c mov %edx,0x1c(%rsp) 3b: 48 89 74 24 10 mov %rsi,0x10(%rsp) Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 51 ja 0x59 8: c3 ret 9: 48 83 ec 28 sub $0x28,%rsp d: 89 54 24 1c mov %edx,0x1c(%rsp) 11: 48 89 74 24 10 mov %rsi,0x10(%rsp) [ 23.698795][ T384] RSP: 002b:00007fff9032a188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 23.698798][ T384] RAX: ffffffffffffffda RBX: 00007fff9032ad10 RCX: 00007ff50a49b9a7 [ 23.698801][ T384] RDX: 0000000000000000 RSI: 00007fff9032a1f0 RDI: 0000000000000005 [ 23.698802][ T384] RBP: 00007fff9032a6b0 R08: 0000000000000002 R09: 0000000000000000 [ 23.698804][ T384] R10: 00007ff50a354708 R11: 0000000000000246 R12: 0000000000000001 [ 23.698806][ T384] R13: 0000000067da6654 R14: 0000000000498600 R15: 00007fff9032b992 | [ 23.707925][ T384] Disabling lock debugging due to kernel taint | [ 23.708160][ T384] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 23.708492][ T384] KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] | [ 23.708928][ T384] Tainted: [B]=BAD_PAGE [ 23.709026][ T384] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 23.709201][ T384] RIP: 0010:nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) [ 23.709373][ T384] Code: 5c 09 00 00 45 3b 7e 60 72 c0 76 06 49 83 c6 08 eb bc 4d 8d 7e 68 be 04 00 00 00 4c 89 ff e8 84 19 2f fe 4c 89 f8 48 c1 e8 03 <42> 0f b6 14 20 4c 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 All code ======== 0: 5c pop %rsp 1: 09 00 or %eax,(%rax) 3: 00 45 3b add %al,0x3b(%rbp) 6: 7e 60 jle 0x68 8: 72 c0 jb 0xffffffffffffffca a: 76 06 jbe 0x12 c: 49 83 c6 08 add $0x8,%r14 10: eb bc jmp 0xffffffffffffffce 12: 4d 8d 7e 68 lea 0x68(%r14),%r15 16: be 04 00 00 00 mov $0x4,%esi 1b: 4c 89 ff mov %r15,%rdi 1e: e8 84 19 2f fe call 0xfffffffffe2f19a7 23: 4c 89 f8 mov %r15,%rax 26: 48 c1 e8 03 shr $0x3,%rax 2a:* 42 0f b6 14 20 movzbl (%rax,%r12,1),%edx <-- trapping instruction 2f: 4c 89 f8 mov %r15,%rax 32: 83 e0 07 and $0x7,%eax 35: 83 c0 03 add $0x3,%eax 38: 38 d0 cmp %dl,%al 3a: 7c 08 jl 0x44 3c: 84 d2 test %dl,%dl 3e: 0f .byte 0xf 3f: 85 .byte 0x85 Code starting with the faulting instruction =========================================== 0: 42 0f b6 14 20 movzbl (%rax,%r12,1),%edx 5: 4c 89 f8 mov %r15,%rax 8: 83 e0 07 and $0x7,%eax b: 83 c0 03 add $0x3,%eax e: 38 d0 cmp %dl,%al 10: 7c 08 jl 0x1a 12: 84 d2 test %dl,%dl 14: 0f .byte 0xf 15: 85 .byte 0x85 [ 23.709828][ T384] RSP: 0018:ffffc90000ae73c8 EFLAGS: 00010202 [ 23.709993][ T384] RAX: 000000000000000d RBX: ffff88800b0cc068 RCX: ffffffffa3853d8a [ 23.710189][ T384] RDX: fffffbfff5162491 RSI: 0000000000000008 RDI: ffffffffa8b12480 [ 23.710379][ T384] RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff5162490 [ 23.710574][ T384] R10: ffffffffa8b12487 R11: 205d343833542020 R12: dffffc0000000000 [ 23.710766][ T384] R13: ffff888002695240 R14: 0000000000000000 R15: 0000000000000068 [ 23.710965][ T384] FS: 00007ff50a28f800(0000) GS:ffff888036000000(0000) knlGS:0000000000000000 [ 23.711192][ T384] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 23.711355][ T384] CR2: 00007ff50a4eaac0 CR3: 000000000b7d4005 CR4: 0000000000772ef0 [ 23.711553][ T384] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 23.711748][ T384] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 23.711943][ T384] PKRU: 55555554 [ 23.712040][ T384] Call Trace: [ 23.712138][ T384] [ 23.712207][ T384] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 23.712314][ T384] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 23.712450][ T384] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 23.712581][ T384] ? add_taint (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 kernel/panic.c:605) [ 23.712691][ T384] ? nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) [ 23.712824][ T384] ? nexthop_create_group (./arch/x86/include/asm/atomic.h:23 ./include/linux/atomic/atomic-arch-fallback.h:457 ./include/linux/atomic/atomic-instrumented.h:33 ./include/linux/refcount.h:136 ./include/linux/refcount.h:142 ./include/linux/refcount.h:218 ./include/linux/refcount.h:236 ./include/net/nexthop.h:264 net/ipv4/nexthop.c:2721) [ 23.712956][ T384] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 23.713085][ T384] ? __nla_validate_parse (lib/nlattr.c:638) [ 23.713221][ T384] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 23.713351][ T384] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:230) [ 23.713480][ T384] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 23.713582][ T384] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 23.713718][ T384] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 23.713852][ T384] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 23.713979][ T384] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 23.714114][ T384] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 23.714242][ T384] ? hlock_class (./arch/x86/include/asm/bitops.h:227 ./arch/x86/include/asm/bitops.h:239 ./include/asm-generic/bitops/instrumented-non-atomic.h:142 kernel/locking/lockdep.c:230) [ 23.714368][ T384] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 23.714473][ T384] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 23.714604][ T384] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 23.714734][ T384] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 23.714874][ T384] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 23.715006][ T384] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 23.715137][ T384] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 ./include/net/netns/generic.h:48 net/netlink/af_netlink.c:333) [ 23.715267][ T384] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 23.715397][ T384] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 23.715527][ T384] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 23.715657][ T384] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 23.715788][ T384] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 23.715919][ T384] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 23.716056][ T384] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 23.716198][ T384] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 23.716362][ T384] ___sys_sendmsg (net/socket.c:2619) [ 23.716503][ T384] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 23.716635][ T384] ? __pfx___lock_release (kernel/locking/lockdep.c:5503) [ 23.716764][ T384] ? __pfx_handle_pte_fault (mm/memory.c:5864) [ 23.716896][ T384] ? __handle_mm_fault (mm/memory.c:6050) [ 23.717025][ T384] ? __pfx___handle_mm_fault (mm/memory.c:5959) [ 23.717153][ T384] ? mt_find (lib/maple_tree.c:6909) [ 23.717256][ T384] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 23.717384][ T384] ? __lock_release (kernel/locking/lockdep.c:5527) [ 23.717515][ T384] ? do_user_addr_fault (./include/linux/mmap_lock.h:218 arch/x86/mm/fault.c:1416) [ 23.717647][ T384] __sys_sendmsg (net/socket.c:2649) [ 23.717777][ T384] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 23.717907][ T384] ? do_user_addr_fault (./include/linux/mmap_lock.h:218 arch/x86/mm/fault.c:1416) [ 23.718036][ T384] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 23.718169][ T384] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 23.718333][ T384] RIP: 0033:0x7ff50a49b9a7 [ 23.718471][ T384] Code: 0a 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b9 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 All code ======== 0: 0a 00 or (%rax),%al 2: f7 d8 neg %eax 4: 64 89 02 mov %eax,%fs:(%rdx) 7: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax e: eb b9 jmp 0xffffffffffffffc9 10: 0f 1f 00 nopl (%rax) 13: f3 0f 1e fa endbr64 17: 64 8b 04 25 18 00 00 mov %fs:0x18,%eax 1e: 00 1f: 85 c0 test %eax,%eax 21: 75 10 jne 0x33 23: b8 2e 00 00 00 mov $0x2e,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 51 ja 0x83 32: c3 ret 33: 48 83 ec 28 sub $0x28,%rsp 37: 89 54 24 1c mov %edx,0x1c(%rsp) 3b: 48 89 74 24 10 mov %rsi,0x10(%rsp) Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 51 ja 0x59 8: c3 ret 9: 48 83 ec 28 sub $0x28,%rsp d: 89 54 24 1c mov %edx,0x1c(%rsp) 11: 48 89 74 24 10 mov %rsi,0x10(%rsp) [ 23.718930][ T384] RSP: 002b:00007fff9032a188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 23.719129][ T384] RAX: ffffffffffffffda RBX: 00007fff9032ad10 RCX: 00007ff50a49b9a7 [ 23.719337][ T384] RDX: 0000000000000000 RSI: 00007fff9032a1f0 RDI: 0000000000000005 [ 23.719535][ T384] RBP: 00007fff9032a6b0 R08: 0000000000000002 R09: 0000000000000000 [ 23.719728][ T384] R10: 00007ff50a354708 R11: 0000000000000246 R12: 0000000000000001 Finger prints: nexthop_create_group:rtm_new_nexthop:rtnetlink_rcv_msg:netlink_rcv_skb:netlink_unicast kasan_report:kasan_check_range:nexthop_create_group:rtm_new_nexthop:rtnetlink_rcv_msg