====================================== | [ 2.024498] ------------[ cut here ]------------ | [ 2.024607] refcount_t: underflow; use-after-free. | [ 2.024679] WARNING: CPU: 2 PID: 237 at lib/refcount.c:28 refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) | [ 2.024755] Modules linked in: netdevsim [ 2.024883] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 2.024945] RIP: 0010:refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) [ 2.025001] Code: 92 e8 88 98 ba ff 90 0f 0b 90 90 c3 80 3d 69 b4 eb 00 00 75 89 c6 05 60 b4 eb 00 01 90 48 c7 c7 98 6e 94 92 e8 65 98 ba ff 90 <0f> 0b 90 90 c3 80 3d 44 b4 eb 00 00 0f 85 62 ff ff ff c6 05 37 b4 All code ======== 0: 92 xchg %eax,%edx 1: e8 88 98 ba ff call 0xffffffffffba988e 6: 90 nop 7: 0f 0b ud2 9: 90 nop a: 90 nop b: c3 ret c: 80 3d 69 b4 eb 00 00 cmpb $0x0,0xebb469(%rip) # 0xebb47c 13: 75 89 jne 0xffffffffffffff9e 15: c6 05 60 b4 eb 00 01 movb $0x1,0xebb460(%rip) # 0xebb47c 1c: 90 nop 1d: 48 c7 c7 98 6e 94 92 mov $0xffffffff92946e98,%rdi 24: e8 65 98 ba ff call 0xffffffffffba988e 29: 90 nop 2a:* 0f 0b ud2 <-- trapping instruction 2c: 90 nop 2d: 90 nop 2e: c3 ret 2f: 80 3d 44 b4 eb 00 00 cmpb $0x0,0xebb444(%rip) # 0xebb47a 36: 0f 85 62 ff ff ff jne 0xffffffffffffff9e 3c: c6 .byte 0xc6 3d: 05 .byte 0x5 3e: 37 (bad) 3f: b4 .byte 0xb4 Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 90 nop 3: 90 nop 4: c3 ret 5: 80 3d 44 b4 eb 00 00 cmpb $0x0,0xebb444(%rip) # 0xebb450 c: 0f 85 62 ff ff ff jne 0xffffffffffffff74 12: c6 .byte 0xc6 13: 05 .byte 0x5 14: 37 (bad) 15: b4 .byte 0xb4 [ 2.025131] RSP: 0018:ffffb2134029b730 EFLAGS: 00010282 [ 2.025187] RAX: 0000000000000000 RBX: ffffb2134029b740 RCX: 00000000ffffdfff [ 2.025257] RDX: 0000000000000000 RSI: 00000000ffffffea RDI: 0000000000000001 [ 2.025326] RBP: ffffb2134029b258 R08: ffffffff92d56a28 R09: 00000000ffffdfff [ 2.025395] R10: ffffffff92c76a40 R11: ffffffff92d26a40 R12: dead000000000122 [ 2.025476] R13: 00000000fffb7387 R14: 0000000000000001 R15: ffff9e9802c9f000 [ 2.025547] FS: 00007fcfd2e10800(0000) GS:ffff9e98ab8b7000(0000) knlGS:0000000000000000 [ 2.025618] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.025680] CR2: 00007f1b452505f0 CR3: 0000000001fe0004 CR4: 0000000000772ef0 [ 2.025749] PKRU: 55555554 [ 2.025788] Call Trace: [ 2.025828] [ 2.025867] netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11670) [ 2.025921] rtnl_dellink (net/core/rtnetlink.c:3580) [ 2.025972] ? virtio_fs_enqueue_req (fs/fuse/virtio_fs.c:1473) [ 2.026034] ? netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11653) [ 2.026085] ? rtnl_bridge_getlink (net/core/rtnetlink.c:3536) [ 2.026140] rtnetlink_rcv_msg (net/core/rtnetlink.c:6959) [ 2.026191] ? get_page_from_freelist (mm/page_alloc.c:1226 mm/page_alloc.c:1848 mm/page_alloc.c:1858 mm/page_alloc.c:3884) [ 2.026250] ? rtnl_calcit.isra.0 (net/core/rtnetlink.c:6861) [ 2.026306] netlink_rcv_skb (net/netlink/af_netlink.c:2550) [ 2.026357] netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344) [ 2.026408] ? __alloc_skb (net/core/skbuff.c:690) [ 2.026467] netlink_sendmsg (net/netlink/af_netlink.c:1894) [ 2.026516] ____sys_sendmsg (net/socket.c:727 net/socket.c:742 net/socket.c:2630) [ 2.026565] ? copy_msghdr_from_user (net/socket.c:2570) [ 2.026622] ___sys_sendmsg (net/socket.c:2686) [ 2.026672] ? do_wp_page (./include/linux/mmu_notifier.h:468 mm/memory.c:3786 mm/memory.c:4140) [ 2.026722] ? __handle_mm_fault (mm/memory.c:6193 mm/memory.c:6318) [ 2.026778] ? fsnotify_grab_connector (fs/notify/mark.c:709) [ 2.026834] ? fsnotify_destroy_marks (fs/notify/mark.c:937) [ 2.026889] __sys_sendmsg (net/socket.c:2716) [ 2.026938] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 2.026986] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 2.027045] RIP: 0033:0x7fcfd2fde1d7 [ 2.027094] Code: 0e 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: 0e (bad) 1: 00 f7 add %dh,%bh 3: d8 64 89 02 fsubs 0x2(%rcx,%rcx,4) 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) [ 2.027222] RSP: 002b:00007ffedffb4508 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 2.027292] RAX: ffffffffffffffda RBX: 00007ffedffb4c30 RCX: 00007fcfd2fde1d7 [ 2.027361] RDX: 0000000000000000 RSI: 00007ffedffb4570 RDI: 0000000000000005 [ 2.027431] RBP: 0000000000000001 R08: 0000000000000003 R09: 0000000000000078 [ 2.027509] R10: 00007fcfd2edaf60 R11: 0000000000000246 R12: 0000000000000001 [ 2.027578] R13: 00000000690df005 R14: 0000000000499600 R15: 0000000000000000 | [ 2.375507] ------------[ cut here ]------------ | [ 2.375649] kernel BUG at net/core/net-sysfs.c:2246! | [ 2.375701] Oops: invalid opcode: 0000 [#1] SMP | [ 2.375878] Tainted: [W]=WARN [ 2.375915] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 2.375980] RIP: 0010:netdev_release (net/core/net-sysfs.c:2246 net/core/net-sysfs.c:2242) [ 2.376036] Code: fa 0f 1f 44 00 00 80 7f e0 04 75 1d 55 48 8d af d0 fa ff ff 48 8b bf 00 fc ff ff e8 cd ff a3 ff 48 89 ef 5d e9 84 06 a4 ff 90 <0f> 0b 90 f3 0f 1e fa 0f 1f 44 00 00 55 48 89 f5 48 8d 97 e8 fb ff All code ======== 0: fa cli 1: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 6: 80 7f e0 04 cmpb $0x4,-0x20(%rdi) a: 75 1d jne 0x29 c: 55 push %rbp d: 48 8d af d0 fa ff ff lea -0x530(%rdi),%rbp 14: 48 8b bf 00 fc ff ff mov -0x400(%rdi),%rdi 1b: e8 cd ff a3 ff call 0xffffffffffa3ffed 20: 48 89 ef mov %rbp,%rdi 23: 5d pop %rbp 24: e9 84 06 a4 ff jmp 0xffffffffffa406ad 29: 90 nop 2a:* 0f 0b ud2 <-- trapping instruction 2c: 90 nop 2d: f3 0f 1e fa endbr64 31: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 36: 55 push %rbp 37: 48 89 f5 mov %rsi,%rbp 3a: 48 rex.W 3b: 8d .byte 0x8d 3c: 97 xchg %eax,%edi 3d: e8 .byte 0xe8 3e: fb sti 3f: ff .byte 0xff Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 90 nop 3: f3 0f 1e fa endbr64 7: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) c: 55 push %rbp d: 48 89 f5 mov %rsi,%rbp 10: 48 rex.W 11: 8d .byte 0x8d 12: 97 xchg %eax,%edi 13: e8 .byte 0xe8 14: fb sti 15: ff .byte 0xff [ 2.376210] RSP: 0018:ffffb213404ffbf0 EFLAGS: 00010297 [ 2.376258] RAX: ffffffff9235a5d0 RBX: 00000000ffffffff RCX: 0000000000000002 [ 2.376334] RDX: 0000000000000006 RSI: ffffffff92153ba4 RDI: ffff9e980194c530 [ 2.376405] RBP: ffff9e980194c530 R08: 00000000000001d0 R09: 000000000000016d [ 2.376455] R10: 0000000000000180 R11: 0000000000000170 R12: ffff9e980272fa00 [ 2.376504] R13: ffffffff926b1d20 R14: ffff9e9802e51b10 R15: ffff9e980194c000 [ 2.376556] FS: 00007f17f5d0a000(0000) GS:ffff9e98ab837000(0000) knlGS:0000000000000000 [ 2.376611] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.376658] CR2: 00005638908efa91 CR3: 0000000003a8b002 CR4: 0000000000772ef0 [ 2.376708] PKRU: 55555554 [ 2.376729] Call Trace: [ 2.376748] [ 2.376767] device_release (drivers/base/core.c:2569) [ 2.376800] kobject_put (lib/kobject.c:693 lib/kobject.c:720 ./include/linux/kref.h:65 lib/kobject.c:737) [ 2.376832] netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11670) [ 2.376870] nsim_destroy (drivers/net/netdevsim/netdevsim.h:396 drivers/net/netdevsim/netdev.c:1186) netdevsim [ 2.376922] __nsim_dev_port_del (drivers/net/netdevsim/dev.c:441 drivers/net/netdevsim/dev.c:1474) netdevsim [ 2.376962] nsim_dev_reload_destroy (drivers/net/netdevsim/dev.c:1483 drivers/net/netdevsim/dev.c:1707) netdevsim [ 2.377002] nsim_drv_remove (drivers/net/netdevsim/dev.c:1724) netdevsim [ 2.377041] device_release_driver_internal (drivers/base/dd.c:1276 drivers/base/dd.c:1297) [ 2.377080] bus_remove_device (./include/linux/kobject.h:193 (discriminator 3) drivers/base/base.h:73 (discriminator 3) drivers/base/bus.c:586 (discriminator 3)) [ 2.377112] device_del (drivers/base/core.c:3879) [ 2.377142] device_unregister (drivers/base/core.c:3796 drivers/base/core.c:3920) [ 2.377172] del_device_store (drivers/net/netdevsim/bus.c:248) netdevsim [ 2.377210] kernfs_fop_write_iter (fs/kernfs/file.c:88 fs/kernfs/file.c:356) [ 2.377250] vfs_write (fs/read_write.c:594 fs/read_write.c:686) [ 2.377285] ksys_write (fs/read_write.c:738) [ 2.377315] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 2.377346] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 2.377383] RIP: 0033:0x7f17f5e0a257 [ 2.377408] Code: 0f 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24 All code ======== 0: 0f 00 (bad) 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 b7 jmp 0xffffffffffffffc7 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 01 00 00 00 mov $0x1,%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: 48 89 54 24 18 mov %rdx,0x18(%rsp) 3c: 48 rex.W 3d: 89 .byte 0x89 3e: 74 24 je 0x64 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: 48 89 54 24 18 mov %rdx,0x18(%rsp) 12: 48 rex.W 13: 89 .byte 0x89 14: 74 24 je 0x3a [ 2.377529] RSP: 002b:00007ffe8b946d48 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 2.377583] RAX: ffffffffffffffda RBX: 00007f17f5f06780 RCX: 00007f17f5e0a257 [ 2.377632] RDX: 0000000000000004 RSI: 00005638908efa90 RDI: 0000000000000001 [ 2.377683] RBP: 0000000000000004 R08: 0000000000000000 R09: 00007f17f5ebcd20 [ 2.377731] R10: 00007f17f5ebcc20 R11: 0000000000000246 R12: 0000000000000004 Finger prints: netdev_release:device_release:kobject_put:netdev_run_todo:nsim_destroy refcount_warn_saturate:netdev_run_todo:rtnl_dellink:rtnetlink_rcv_msg:netlink_rcv_skb