====================================== | [ 15.975423][ T341] ================================================================== | [ 15.975686][ T341] 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) | [ 15.975931][ T341] Read of size 4 at addr 0000000000000068 by task ip/341 | [ 15.976097][ T341] [ 15.976182][ T341] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 15.976184][ T341] Call Trace: [ 15.976186][ T341] [ 15.976187][ T341] dump_stack_lvl (lib/dump_stack.c:123) [ 15.976194][ T341] kasan_report (mm/kasan/report.c:636) [ 15.976199][ T341] ? 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) [ 15.976205][ T341] kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) [ 15.976209][ T341] 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) [ 15.976215][ T341] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 15.976218][ T341] ? __nla_validate_parse (lib/nlattr.c:638) [ 15.976225][ T341] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 15.976229][ T341] ? 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) [ 15.976233][ T341] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 15.976237][ T341] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 15.976249][ T341] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 15.976255][ T341] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 15.976258][ T341] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 15.976263][ T341] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 15.976267][ T341] ? 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) [ 15.976269][ T341] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 15.976274][ T341] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 15.976278][ T341] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 15.976282][ T341] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 15.976286][ T341] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 15.976294][ T341] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 15.976297][ T341] ? 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) [ 15.976301][ T341] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 15.976305][ T341] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 15.976308][ T341] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 15.976312][ T341] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 15.976316][ T341] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 15.976322][ T341] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 15.976328][ T341] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 15.976331][ T341] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 15.976338][ T341] ___sys_sendmsg (net/socket.c:2619) [ 15.976341][ T341] ? 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) [ 15.976344][ T341] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 15.976348][ T341] ? hlock_class (kernel/locking/lockdep.c:225) [ 15.976353][ T341] ? 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) [ 15.976357][ T341] ? 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) [ 15.976361][ T341] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 15.976365][ T341] ? __lock_release (kernel/locking/lockdep.c:5527) [ 15.976369][ T341] __sys_sendmsg (net/socket.c:2649) [ 15.976372][ T341] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 15.976377][ T341] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 15.976382][ T341] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 15.976386][ T341] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 15.976391][ T341] RIP: 0033:0x7fb20d91d9a7 [ 15.976394][ T341] 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) [ 15.976397][ T341] RSP: 002b:00007ffd6ea3f2b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 15.976401][ T341] RAX: ffffffffffffffda RBX: 00007ffd6ea3fe10 RCX: 00007fb20d91d9a7 [ 15.976403][ T341] RDX: 0000000000000000 RSI: 00007ffd6ea3f320 RDI: 0000000000000005 [ 15.976405][ T341] RBP: 00007ffd6ea3f7e0 R08: 000000003b554910 R09: 0000000000000000 [ 15.976407][ T341] R10: 00007fb20d7d6708 R11: 0000000000000246 R12: 000000003b554918 [ 15.976409][ T341] R13: 0000000067da665e R14: 0000000000498600 R15: 000000003b554910 | [ 15.987560][ T341] Disabling lock debugging due to kernel taint | [ 15.987852][ T341] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 15.988353][ T341] KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] | [ 15.989042][ T341] Tainted: [B]=BAD_PAGE [ 15.989218][ T341] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 15.989465][ T341] 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) [ 15.989737][ T341] 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 [ 15.990452][ T341] RSP: 0018:ffffc900006173c8 EFLAGS: 00010202 [ 15.990720][ T341] RAX: 000000000000000d RBX: ffff88800e1203e8 RCX: ffffffff9a253d8a [ 15.991026][ T341] RDX: fffffbfff3ea2491 RSI: 0000000000000008 RDI: ffffffff9f512480 [ 15.991326][ T341] RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff3ea2490 [ 15.991616][ T341] R10: ffffffff9f512487 R11: 205d313433542020 R12: dffffc0000000000 [ 15.991926][ T341] R13: ffff8880098d0340 R14: 0000000000000000 R15: 0000000000000068 [ 15.992230][ T341] FS: 00007fb20d711800(0000) GS:ffff888036180000(0000) knlGS:0000000000000000 [ 15.992586][ T341] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 15.992847][ T341] CR2: 00007fb20d96d423 CR3: 000000000e2fe001 CR4: 0000000000772ef0 [ 15.993149][ T341] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 15.993464][ T341] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 15.993772][ T341] PKRU: 55555554 [ 15.993942][ T341] Call Trace: [ 15.994103][ T341] [ 15.994214][ T341] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 15.994386][ T341] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 15.994625][ T341] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 15.994847][ T341] ? add_taint (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 kernel/panic.c:605) [ 15.995005][ T341] ? 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) [ 15.995203][ T341] ? 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) [ 15.995408][ T341] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 15.995610][ T341] ? __nla_validate_parse (lib/nlattr.c:638) [ 15.995817][ T341] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 15.996034][ T341] ? 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) [ 15.996234][ T341] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 15.996394][ T341] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 15.996612][ T341] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 15.996824][ T341] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 15.997032][ T341] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 15.997240][ T341] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 15.997452][ T341] ? 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) [ 15.997651][ T341] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 15.997834][ T341] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 15.998056][ T341] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 15.998268][ T341] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 15.998488][ T341] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 15.998700][ T341] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 15.998904][ T341] ? 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) [ 15.999112][ T341] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 15.999326][ T341] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 15.999530][ T341] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 15.999743][ T341] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 15.999947][ T341] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 16.000160][ T341] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 16.000368][ T341] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 16.000577][ T341] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 16.000844][ T341] ___sys_sendmsg (net/socket.c:2619) [ 16.001064][ T341] ? 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.001279][ T341] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 16.001482][ T341] ? hlock_class (kernel/locking/lockdep.c:225) [ 16.001687][ T341] ? 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.001894][ T341] ? 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.002113][ T341] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.002318][ T341] ? __lock_release (kernel/locking/lockdep.c:5527) [ 16.002525][ T341] __sys_sendmsg (net/socket.c:2649) [ 16.002732][ T341] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 16.002946][ T341] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 16.003156][ T341] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 16.003366][ T341] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.003630][ T341] RIP: 0033:0x7fb20d91d9a7 [ 16.003847][ T341] 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.004554][ T341] RSP: 002b:00007ffd6ea3f2b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 16.004868][ T341] RAX: ffffffffffffffda RBX: 00007ffd6ea3fe10 RCX: 00007fb20d91d9a7 [ 16.005177][ T341] RDX: 0000000000000000 RSI: 00007ffd6ea3f320 RDI: 0000000000000005 [ 16.005483][ T341] RBP: 00007ffd6ea3f7e0 R08: 000000003b554910 R09: 0000000000000000 [ 16.005792][ T341] R10: 00007fb20d7d6708 R11: 0000000000000246 R12: 000000003b554918 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