====================================== | [ 100.444958][ T1271] ================================================================== | [ 100.445225][ T1271] 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) | [ 100.445458][ T1271] Read of size 4 at addr 0000000000000068 by task ip/1271 | [ 100.445646][ T1271] [ 100.445729][ T1271] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 100.445732][ T1271] Call Trace: [ 100.445733][ T1271] [ 100.445735][ T1271] dump_stack_lvl (lib/dump_stack.c:123) [ 100.445742][ T1271] kasan_report (mm/kasan/report.c:636) [ 100.445747][ T1271] ? 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) [ 100.445752][ T1271] kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) [ 100.445757][ T1271] 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) [ 100.445762][ T1271] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 100.445766][ T1271] ? __nla_validate_parse (lib/nlattr.c:638) [ 100.445773][ T1271] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 100.445777][ T1271] ? 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) [ 100.445781][ T1271] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 100.445785][ T1271] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 100.445798][ T1271] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 100.445804][ T1271] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 100.445808][ T1271] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 100.445813][ T1271] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 100.445817][ T1271] ? 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) [ 100.445819][ T1271] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 100.445824][ T1271] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 100.445828][ T1271] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 100.445832][ T1271] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 100.445836][ T1271] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 100.445844][ T1271] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 100.445847][ T1271] ? 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) [ 100.445850][ T1271] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 100.445854][ T1271] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 100.445857][ T1271] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 100.445862][ T1271] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 100.445866][ T1271] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 100.445872][ T1271] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 100.445878][ T1271] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 100.445881][ T1271] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 100.445888][ T1271] ___sys_sendmsg (net/socket.c:2619) [ 100.445890][ T1271] ? 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) [ 100.445894][ T1271] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 100.445898][ T1271] ? hlock_class (kernel/locking/lockdep.c:225) [ 100.445902][ T1271] ? 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) [ 100.445907][ T1271] ? 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) [ 100.445911][ T1271] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 100.445914][ T1271] ? __lock_release (kernel/locking/lockdep.c:5527) [ 100.445919][ T1271] __sys_sendmsg (net/socket.c:2649) [ 100.445922][ T1271] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 100.445927][ T1271] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 100.445931][ T1271] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 100.445936][ T1271] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 100.445941][ T1271] RIP: 0033:0x7f80429179a7 [ 100.445945][ T1271] 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) [ 100.445948][ T1271] RSP: 002b:00007ffc29365e78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 100.445951][ T1271] RAX: ffffffffffffffda RBX: 00007ffc293669d0 RCX: 00007f80429179a7 [ 100.445953][ T1271] RDX: 0000000000000000 RSI: 00007ffc29365ee0 RDI: 0000000000000005 [ 100.445955][ T1271] RBP: 00007ffc293663a0 R08: 0000000030108910 R09: 0000000000000000 [ 100.445957][ T1271] R10: 00007f80427d0708 R11: 0000000000000246 R12: 0000000030108918 [ 100.445958][ T1271] R13: 0000000067da6649 R14: 0000000000498600 R15: 0000000030108910 | [ 100.455042][ T1271] Disabling lock debugging due to kernel taint | [ 100.455241][ T1271] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 100.455592][ T1271] KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] | [ 100.456049][ T1271] Tainted: [B]=BAD_PAGE [ 100.456157][ T1271] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 100.456336][ T1271] 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) [ 100.456526][ T1271] 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 [ 100.457025][ T1271] RSP: 0018:ffffc90001da73c8 EFLAGS: 00010202 [ 100.457207][ T1271] RAX: 000000000000000d RBX: ffff888007c1ede8 RCX: ffffffff9b453d8a [ 100.457424][ T1271] RDX: fffffbfff40e2491 RSI: 0000000000000008 RDI: ffffffffa0712480 [ 100.457636][ T1271] RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff40e2490 [ 100.457847][ T1271] R10: ffffffffa0712487 R11: 205d313732315420 R12: dffffc0000000000 [ 100.458062][ T1271] R13: ffff888004e624c0 R14: 0000000000000000 R15: 0000000000000068 [ 100.458277][ T1271] FS: 00007f804270b800(0000) GS:ffff88802f200000(0000) knlGS:0000000000000000 [ 100.458521][ T1271] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 100.458698][ T1271] CR2: 00007f8042967423 CR3: 000000000bb82006 CR4: 0000000000772ef0 [ 100.458912][ T1271] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 100.459126][ T1271] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 100.459332][ T1271] PKRU: 55555554 [ 100.459442][ T1271] Call Trace: [ 100.459549][ T1271] [ 100.459622][ T1271] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 100.459735][ T1271] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 100.459884][ T1271] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 100.460037][ T1271] ? add_taint (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 kernel/panic.c:605) [ 100.460152][ T1271] ? 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) [ 100.460296][ T1271] ? 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) [ 100.460443][ T1271] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 100.460584][ T1271] ? __nla_validate_parse (lib/nlattr.c:638) [ 100.460727][ T1271] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 100.460871][ T1271] ? 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) [ 100.461018][ T1271] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 100.461132][ T1271] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 100.461284][ T1271] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 100.461426][ T1271] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 100.461567][ T1271] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 100.461707][ T1271] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 100.461852][ T1271] ? 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) [ 100.461998][ T1271] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 100.462110][ T1271] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 100.462251][ T1271] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 100.462395][ T1271] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 100.462538][ T1271] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 100.462684][ T1271] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 100.462824][ T1271] ? 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) [ 100.462969][ T1271] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 100.463120][ T1271] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 100.463263][ T1271] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 100.463401][ T1271] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 100.463546][ T1271] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 100.463685][ T1271] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 100.463832][ T1271] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 100.463975][ T1271] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 100.464159][ T1271] ___sys_sendmsg (net/socket.c:2619) [ 100.464297][ T1271] ? 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) [ 100.464442][ T1271] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 100.464587][ T1271] ? hlock_class (kernel/locking/lockdep.c:225) [ 100.464733][ T1271] ? 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) [ 100.464876][ T1271] ? 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) [ 100.465019][ T1271] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 100.465181][ T1271] ? __lock_release (kernel/locking/lockdep.c:5527) [ 100.465325][ T1271] __sys_sendmsg (net/socket.c:2649) [ 100.465468][ T1271] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 100.465613][ T1271] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 100.465762][ T1271] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 100.465907][ T1271] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 100.466084][ T1271] RIP: 0033:0x7f80429179a7 [ 100.466217][ T1271] 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) [ 100.466681][ T1271] RSP: 002b:00007ffc29365e78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 100.466896][ T1271] RAX: ffffffffffffffda RBX: 00007ffc293669d0 RCX: 00007f80429179a7 [ 100.467114][ T1271] RDX: 0000000000000000 RSI: 00007ffc29365ee0 RDI: 0000000000000005 [ 100.467329][ T1271] RBP: 00007ffc293663a0 R08: 0000000030108910 R09: 0000000000000000 [ 100.467541][ T1271] R10: 00007f80427d0708 R11: 0000000000000246 R12: 0000000030108918 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