====================================== | [ 16.379387][ T344] ================================================================== | [ 16.379652][ T344] 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.379875][ T344] Read of size 4 at addr 0000000000000068 by task ip/344 | [ 16.380054][ T344] [ 16.380143][ T344] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.380145][ T344] Call Trace: [ 16.380147][ T344] [ 16.380149][ T344] dump_stack_lvl (lib/dump_stack.c:123) [ 16.380155][ T344] kasan_report (mm/kasan/report.c:636) [ 16.380161][ T344] ? 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.380166][ T344] kasan_check_range (mm/kasan/generic.c:183 mm/kasan/generic.c:189) [ 16.380170][ T344] 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.380176][ T344] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 16.380179][ T344] ? __nla_validate_parse (lib/nlattr.c:638) [ 16.380186][ T344] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 16.380190][ T344] ? 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.380194][ T344] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.380198][ T344] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.380211][ T344] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 16.380217][ T344] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.380220][ T344] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 16.380225][ T344] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.380228][ T344] ? 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.380231][ T344] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.380235][ T344] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 16.380240][ T344] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 16.380244][ T344] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.380248][ T344] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 16.380255][ T344] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 16.380259][ T344] ? 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.380262][ T344] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 16.380266][ T344] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 16.380269][ T344] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.380273][ T344] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 16.380277][ T344] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 16.380283][ T344] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 16.380289][ T344] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 16.380292][ T344] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 16.380299][ T344] ___sys_sendmsg (net/socket.c:2619) [ 16.380301][ T344] ? 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.380305][ T344] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 16.380309][ T344] ? hlock_class (kernel/locking/lockdep.c:225) [ 16.380314][ T344] ? 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.380318][ T344] ? 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.380322][ T344] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.380325][ T344] ? __lock_release (kernel/locking/lockdep.c:5527) [ 16.380329][ T344] __sys_sendmsg (net/socket.c:2649) [ 16.380332][ T344] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 16.380338][ T344] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 16.380342][ T344] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 16.380347][ T344] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.380352][ T344] RIP: 0033:0x7f413a54c9a7 [ 16.380355][ T344] 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.380358][ T344] RSP: 002b:00007ffe93a53d38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 16.380362][ T344] RAX: ffffffffffffffda RBX: 00007ffe93a54890 RCX: 00007f413a54c9a7 [ 16.380365][ T344] RDX: 0000000000000000 RSI: 00007ffe93a53da0 RDI: 0000000000000005 [ 16.380368][ T344] RBP: 00007ffe93a54260 R08: 000000002e764910 R09: 0000000000000000 [ 16.380371][ T344] R10: 00007f413a405708 R11: 0000000000000246 R12: 000000002e764918 [ 16.380374][ T344] R13: 0000000067da3f98 R14: 0000000000498600 R15: 000000002e764910 | [ 16.389418][ T344] Disabling lock debugging due to kernel taint | [ 16.389615][ T344] Oops: general protection fault, probably for non-canonical address 0xdffffc000000000d: 0000 [#1] PREEMPT SMP KASAN NOPTI | [ 16.389949][ T344] KASAN: null-ptr-deref in range [0x0000000000000068-0x000000000000006f] | [ 16.390404][ T344] Tainted: [B]=BAD_PAGE [ 16.390505][ T344] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 16.390678][ T344] 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.390864][ T344] 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.391354][ T344] RSP: 0018:ffffc900006273c8 EFLAGS: 00010202 [ 16.391526][ T344] RAX: 000000000000000d RBX: ffff88800bb1c068 RCX: ffffffff98053d8a [ 16.391730][ T344] RDX: fffffbfff3a62491 RSI: 0000000000000008 RDI: ffffffff9d312480 [ 16.391935][ T344] RBP: 0000000000000000 R08: 0000000000000001 R09: fffffbfff3a62490 [ 16.392145][ T344] R10: ffffffff9d312487 R11: 205d343433542020 R12: dffffc0000000000 [ 16.392367][ T344] R13: ffff888008ca3540 R14: 0000000000000000 R15: 0000000000000068 [ 16.392567][ T344] FS: 00007f413a340800(0000) GS:ffff888036180000(0000) knlGS:0000000000000000 [ 16.392796][ T344] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 16.392965][ T344] CR2: 00007f413a59c423 CR3: 000000000da7c006 CR4: 0000000000772ef0 [ 16.393165][ T344] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 16.393362][ T344] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 16.393556][ T344] PKRU: 55555554 [ 16.393655][ T344] Call Trace: [ 16.393767][ T344] [ 16.393836][ T344] ? die_addr (arch/x86/kernel/dumpstack.c:421 arch/x86/kernel/dumpstack.c:460) [ 16.393950][ T344] ? exc_general_protection (arch/x86/kernel/traps.c:751 arch/x86/kernel/traps.c:693) [ 16.394099][ T344] ? asm_exc_general_protection (./arch/x86/include/asm/idtentry.h:617) [ 16.394233][ T344] ? add_taint (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 kernel/panic.c:605) [ 16.394348][ T344] ? 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.394480][ T344] ? 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.394619][ T344] ? __pfx_nexthop_create_group (net/ipv4/nexthop.c:2686) [ 16.394758][ T344] ? __nla_validate_parse (lib/nlattr.c:638) [ 16.394898][ T344] rtm_new_nexthop (net/ipv4/nexthop.c:2937 net/ipv4/nexthop.c:3254) [ 16.395039][ T344] ? 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.395181][ T344] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.395287][ T344] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.395431][ T344] ? rtnetlink_rcv_msg (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/core/rtnetlink.c:6952) [ 16.395572][ T344] ? __pfx_rtm_new_nexthop (net/ipv4/nexthop.c:3225) [ 16.395709][ T344] rtnetlink_rcv_msg (net/core/rtnetlink.c:6954) [ 16.395841][ T344] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.395986][ T344] ? 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.396124][ T344] ? mark_lock (kernel/locking/lockdep.c:4729 (discriminator 3)) [ 16.396225][ T344] ? __lock_acquire (kernel/locking/lockdep.c:5228) [ 16.396366][ T344] netlink_rcv_skb (net/netlink/af_netlink.c:2534) [ 16.396507][ T344] ? __pfx_rtnetlink_rcv_msg (net/core/rtnetlink.c:6857) [ 16.396638][ T344] ? __pfx_netlink_rcv_skb (net/netlink/af_netlink.c:2511) [ 16.396780][ T344] ? netlink_deliver_tap (./include/linux/rcupdate.h:347 ./include/linux/rcupdate.h:880 net/netlink/af_netlink.c:340) [ 16.396923][ T344] ? 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.397059][ T344] netlink_unicast (net/netlink/af_netlink.c:1313 net/netlink/af_netlink.c:1339) [ 16.397193][ T344] ? __pfx_netlink_unicast (net/netlink/af_netlink.c:1324) [ 16.397332][ T344] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.397473][ T344] netlink_sendmsg (net/netlink/af_netlink.c:1883) [ 16.397603][ T344] ? __pfx_netlink_sendmsg (net/netlink/af_netlink.c:1802) [ 16.397755][ T344] ____sys_sendmsg (net/socket.c:709 net/socket.c:724 net/socket.c:2563) [ 16.397890][ T344] ? __pfx_____sys_sendmsg (net/socket.c:2509) [ 16.398019][ T344] ? __pfx_copy_msghdr_from_user (net/socket.c:2489) [ 16.398193][ T344] ___sys_sendmsg (net/socket.c:2619) [ 16.398322][ T344] ? 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.398452][ T344] ? __pfx____sys_sendmsg (net/socket.c:2606) [ 16.398583][ T344] ? hlock_class (kernel/locking/lockdep.c:225) [ 16.398715][ T344] ? 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.398848][ T344] ? 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.398980][ T344] ? find_held_lock (kernel/locking/lockdep.c:5341) [ 16.399120][ T344] ? __lock_release (kernel/locking/lockdep.c:5527) [ 16.399253][ T344] __sys_sendmsg (net/socket.c:2649) [ 16.399404][ T344] ? __pfx___sys_sendmsg (net/socket.c:2634) [ 16.399537][ T344] ? do_user_addr_fault (./include/linux/rcupdate.h:882 ./include/linux/mm.h:742 arch/x86/mm/fault.c:1339) [ 16.399668][ T344] do_syscall_64 (arch/x86/entry/common.c:52 arch/x86/entry/common.c:83) [ 16.399803][ T344] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 16.399977][ T344] RIP: 0033:0x7f413a54c9a7 [ 16.400124][ T344] 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.400609][ T344] RSP: 002b:00007ffe93a53d38 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 16.400818][ T344] RAX: ffffffffffffffda RBX: 00007ffe93a54890 RCX: 00007f413a54c9a7 [ 16.401014][ T344] RDX: 0000000000000000 RSI: 00007ffe93a53da0 RDI: 0000000000000005 [ 16.401210][ T344] RBP: 00007ffe93a54260 R08: 000000002e764910 R09: 0000000000000000 [ 16.401405][ T344] R10: 00007f413a405708 R11: 0000000000000246 R12: 000000002e764918 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