====================================== | [ 16.808872][ T340] ================================================================== | [ 16.809106][ T340] 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) | [ 16.809341][ T340] Read of size 4 at addr 0000000000000068 by task ip/340 | [ 16.809506][ T340] [ 16.809580][ T340] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.809582][ T340] Call Trace: [ 16.809584][ T340] [ 16.809586][ T340] dump_stack_lvl (lib/dump_stack.c:123) [ 16.809592][ T340] kasan_report (mm/kasan/report.c:636) [ 16.809597][ T340] ? 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) [ 16.809603][ T340] kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) [ 16.809607][ T340] 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) [ 16.809613][ T340] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 16.809616][ T340] ? __nla_validate_parse (lib/nlattr.c:638) [ 16.809623][ T340] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 16.809627][ T340] ? 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) [ 16.809631][ T340] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.809635][ T340] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.809647][ T340] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 16.809653][ T340] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.809657][ T340] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 16.809661][ T340] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.809665][ T340] ? 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) [ 16.809668][ T340] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.809672][ T340] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 16.809676][ T340] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 16.809680][ T340] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.809685][ T340] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 16.809692][ T340] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 16.809695][ T340] ? 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) [ 16.809699][ T340] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 16.809703][ T340] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 16.809706][ T340] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.809710][ T340] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 16.809714][ T340] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 16.809720][ T340] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 16.809727][ T340] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 16.809730][ T340] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 16.809737][ T340] ___sys_sendmsg (net/socket.c:2619) [ 16.809739][ T340] ? 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) [ 16.809742][ T340] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 16.809747][ T340] ? hlock_class (kernel/locking/lockdep.c:225) [ 16.809751][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:337 ./include/linux/rcupdate.h:849 ./include/linux/mm.h:740 arch/x86/mm/fault.c:1339) [ 16.809755][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:337 ./include/linux/rcupdate.h:849 ./include/linux/mm.h:740 arch/x86/mm/fault.c:1339) [ 16.809760][ T340] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.809763][ T340] ? __lock_release (kernel/locking/lockdep.c:5527) [ 16.809768][ T340] __sys_sendmsg (net/socket.c:2649) [ 16.809771][ T340] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 16.809776][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 16.809781][ T340] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 16.809785][ T340] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.809790][ T340] RIP: 0033:0x7f43b5c009a7 [ 16.809794][ T340] 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) [ 16.809796][ T340] RSP: 002b:00007ffd9d42d288 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 16.809800][ T340] RAX: ffffffffffffffda RBX: 00007ffd9d42dde0 RCX: 00007f43b5c009a7 [ 16.809803][ T340] RDX: 0000000000000000 RSI: 00007ffd9d42d2f0 RDI: 0000000000000005 [ 16.809804][ T340] RBP: 00007ffd9d42d7b0 R08: 0000000017325910 R09: 0000000000000000 [ 16.809806][ T340] R10: 00007f43b5ab9708 R11: 0000000000000246 R12: 0000000017325918 [ 16.809808][ T340] R13: 0000000067da3b11 R14: 0000000000498600 R15: 0000000017325910 | [ 16.818614][ T340] Disabling lock debugging due to kernel taint | [ 16.818820][ T340] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 16.819183][ T340] KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] | [ 16.819662][ T340] Tainted: [B]=BAD_PAGE [ 16.819773][ T340] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.819954][ T340] 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) [ 16.820142][ T340] 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 [ 16.820651][ T340] RSP: 0018:ffffc900006273c8 EFLAGS: 00010202 [ 16.820832][ T340] RAX: 000000000000000d RBX: ffff88800b0f0768 RCX: ffffffffb4653d8a [ 16.821050][ T340] RDX: fffffbfff7322491 RSI: 0000000000000008 RDI: ffffffffb9912480 [ 16.821264][ T340] RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff7322490 [ 16.821477][ T340] R10: ffffffffb9912487 R11: 205d303433542020 R12: dffffc0000000000 [ 16.821687][ T340] R13: ffff888009082640 R14: 0000000000000000 R15: 0000000000000068 [ 16.821903][ T340] FS: 00007f43b59f4800(0000) GS:ffff888036000000(0000) knlGS:0000000000000000 [ 16.822149][ T340] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 16.822330][ T340] CR2: 00007f43b5c50423 CR3: 000000000d530006 CR4: 0000000000772ef0 [ 16.822556][ T340] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 16.822774][ T340] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 16.822986][ T340] PKRU: 55555554 [ 16.823095][ T340] Call Trace: [ 16.823206][ T340] [ 16.823282][ T340] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 16.823399][ T340] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 16.823549][ T340] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 16.823695][ T340] ? add_taint (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 kernel/panic.c:605) [ 16.823811][ T340] ? 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) [ 16.823957][ T340] ? 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) [ 16.824101][ T340] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 16.824256][ T340] ? __nla_validate_parse (lib/nlattr.c:638) [ 16.824408][ T340] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 16.824556][ T340] ? 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) [ 16.824701][ T340] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.824814][ T340] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.824970][ T340] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 16.825116][ T340] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.825257][ T340] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 16.825407][ T340] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.825552][ T340] ? 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) [ 16.825696][ T340] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.825809][ T340] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 16.825954][ T340] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 16.826103][ T340] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.826248][ T340] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 16.826396][ T340] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 16.826538][ T340] ? 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) [ 16.826682][ T340] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 16.826831][ T340] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 16.826973][ T340] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.827117][ T340] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 16.827264][ T340] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 16.827413][ T340] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 16.827559][ T340] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 16.827703][ T340] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 16.827888][ T340] ___sys_sendmsg (net/socket.c:2619) [ 16.828032][ T340] ? 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) [ 16.828175][ T340] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 16.828321][ T340] ? hlock_class (kernel/locking/lockdep.c:225) [ 16.828467][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:337 ./include/linux/rcupdate.h:849 ./include/linux/mm.h:740 arch/x86/mm/fault.c:1339) [ 16.828612][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:337 ./include/linux/rcupdate.h:849 ./include/linux/mm.h:740 arch/x86/mm/fault.c:1339) [ 16.828755][ T340] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.828900][ T340] ? __lock_release (kernel/locking/lockdep.c:5527) [ 16.829047][ T340] __sys_sendmsg (net/socket.c:2649) [ 16.829191][ T340] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 16.829337][ T340] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 16.829482][ T340] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 16.829628][ T340] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.829807][ T340] RIP: 0033:0x7f43b5c009a7 [ 16.829962][ T340] 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) [ 16.830469][ T340] RSP: 002b:00007ffd9d42d288 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 16.830685][ T340] RAX: ffffffffffffffda RBX: 00007ffd9d42dde0 RCX: 00007f43b5c009a7 [ 16.830907][ T340] RDX: 0000000000000000 RSI: 00007ffd9d42d2f0 RDI: 0000000000000005 [ 16.831126][ T340] RBP: 00007ffd9d42d7b0 R08: 0000000017325910 R09: 0000000000000000 [ 16.831342][ T340] R10: 00007f43b5ab9708 R11: 0000000000000246 R12: 0000000017325918 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