====================================== | [ 4.402965] ------------[ cut here ]------------ | [ 4.403142] refcount_t: underflow; use-after-free. | [ 4.403231] WARNING: CPU: 2 PID: 351 at lib/refcount.c:28 refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) | [ 4.403334] Modules linked in: netconsole netdevsim [ 4.403517] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 4.403599] RIP: 0010:refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) [ 4.403675] Code: b0 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 54 b0 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: b0 e8 mov $0xe8,%al 2: 88 98 ba ff 90 0f mov %bl,0xf90ffba(%rax) 8: 0b 90 90 c3 80 3d or 0x3d80c390(%rax),%edx e: 69 b4 eb 00 00 75 89 imul $0xb46005c6,-0x768b0000(%rbx,%rbp,8),%esi 15: c6 05 60 b4 19: eb 00 jmp 0x1b 1b: 01 90 48 c7 c7 98 add %edx,-0x673838b8(%rax) 21: 6e outsb %ds:(%rsi),(%dx) 22: 54 push %rsp 23: b0 e8 mov $0xe8,%al 25: 65 98 gs cwtl 27:* ba ff 90 0f 0b mov $0xb0f90ff,%edx <-- 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 [ 4.403897] RSP: 0018:ffff9985c06cf730 EFLAGS: 00010282 [ 4.403975] RAX: 0000000000000000 RBX: ffff9985c06cf740 RCX: 00000000ffffdfff [ 4.404076] RDX: 0000000000000000 RSI: 00000000ffffffea RDI: 0000000000000001 [ 4.404176] RBP: ffff9985c06cf258 R08: ffffffffb0956a28 R09: 00000000ffffdfff [ 4.404277] R10: ffffffffb0876a40 R11: ffffffffb0926a40 R12: dead000000000122 [ 4.404371] R13: 00000000fffb7cd0 R14: 0000000000000001 R15: ffff8d7282036000 [ 4.404470] FS: 00007fbedcacb800(0000) GS:ffff8d730dcb7000(0000) knlGS:0000000000000000 [ 4.404566] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4.404648] CR2: 00000000004a1778 CR3: 000000000889c006 CR4: 0000000000772ef0 [ 4.404746] PKRU: 55555554 [ 4.404795] Call Trace: [ 4.404849] [ 4.404897] netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11670) [ 4.404965] rtnl_dellink (net/core/rtnetlink.c:3580) [ 4.405036] ? rtnl_bridge_getlink (net/core/rtnetlink.c:3536) [ 4.405109] rtnetlink_rcv_msg (net/core/rtnetlink.c:6959) [ 4.405177] ? get_page_from_freelist (mm/page_alloc.c:1226 mm/page_alloc.c:1848 mm/page_alloc.c:1858 mm/page_alloc.c:3884) [ 4.405259] ? rtnl_calcit.isra.0 (net/core/rtnetlink.c:6861) [ 4.405342] netlink_rcv_skb (net/netlink/af_netlink.c:2550) [ 4.405417] netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1344) [ 4.405499] ? __alloc_skb (net/core/skbuff.c:690) [ 4.405620] netlink_sendmsg (net/netlink/af_netlink.c:1894) [ 4.405678] ____sys_sendmsg (net/socket.c:727 net/socket.c:742 net/socket.c:2630) [ 4.405755] ? copy_msghdr_from_user (net/socket.c:2570) [ 4.405830] ___sys_sendmsg (net/socket.c:2686) [ 4.405922] ? do_wp_page (./include/linux/mmu_notifier.h:468 mm/memory.c:3786 mm/memory.c:4140) [ 4.405998] ? __handle_mm_fault (mm/memory.c:6193 mm/memory.c:6318) [ 4.406078] __sys_sendmsg (net/socket.c:2716) [ 4.406149] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 4.406219] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 4.406298] RIP: 0033:0x7fbedcc991d7 [ 4.406366] 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) [ 4.406603] RSP: 002b:00007ffc9c022c18 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 4.406704] RAX: ffffffffffffffda RBX: 00007ffc9c023350 RCX: 00007fbedcc991d7 [ 4.406796] RDX: 0000000000000000 RSI: 00007ffc9c022c80 RDI: 0000000000000005 [ 4.406901] RBP: 0000000000000000 R08: 000000000000002c R09: 0000000000000008 [ 4.406997] R10: 0000000000403668 R11: 0000000000000246 R12: 00007ffc9c023368 [ 4.407098] R13: 00000000690de5bc R14: 0000000000499600 R15: 0000000000000000 | [ 4.777912] ------------[ cut here ]------------ | [ 4.778063] kernel BUG at net/core/net-sysfs.c:2246! | [ 4.778134] Oops: invalid opcode: 0000 [#1] SMP | [ 4.778283] Tainted: [W]=WARN [ 4.778312] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 4.778356] RIP: 0010:netdev_release (net/core/net-sysfs.c:2246 net/core/net-sysfs.c:2242) [ 4.778404] 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 [ 4.778514] RSP: 0018:ffff9985c05c7bf0 EFLAGS: 00010297 [ 4.778550] RAX: ffffffffaff5a5d0 RBX: 00000000ffffffff RCX: 0000000000000002 [ 4.778601] RDX: 0000000000000006 RSI: ffffffffafd53ba4 RDI: ffff8d7282cf6530 [ 4.778651] RBP: ffff8d7282cf6530 R08: 000000000000010c R09: 00000000000000a8 [ 4.778702] R10: 00000000000000c0 R11: 00000000000000b0 R12: ffff8d7288a26500 [ 4.778756] R13: ffffffffb02b1d20 R14: ffff8d72810507f0 R15: ffff8d7282cf6000 [ 4.778809] FS: 00007f5672ee7000(0000) GS:ffff8d730dcb7000(0000) knlGS:0000000000000000 [ 4.778863] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4.778905] CR2: 00007f5672f47610 CR3: 000000000818e003 CR4: 0000000000772ef0 [ 4.778957] PKRU: 55555554 [ 4.778976] Call Trace: [ 4.779000] [ 4.779021] device_release (drivers/base/core.c:2569) [ 4.779059] kobject_put (lib/kobject.c:693 lib/kobject.c:720 ./include/linux/kref.h:65 lib/kobject.c:737) [ 4.779094] netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11670) [ 4.779139] nsim_destroy (drivers/net/netdevsim/netdevsim.h:396 drivers/net/netdevsim/netdev.c:1186) netdevsim [ 4.779192] __nsim_dev_port_del (drivers/net/netdevsim/dev.c:441 drivers/net/netdevsim/dev.c:1474) netdevsim [ 4.779249] nsim_dev_reload_destroy (drivers/net/netdevsim/dev.c:1483 drivers/net/netdevsim/dev.c:1707) netdevsim [ 4.779306] nsim_drv_remove (drivers/net/netdevsim/dev.c:1724) netdevsim [ 4.779412] device_release_driver_internal (drivers/base/dd.c:1276 drivers/base/dd.c:1297) [ 4.779461] bus_remove_device (./include/linux/kobject.h:193 (discriminator 3) drivers/base/base.h:73 (discriminator 3) drivers/base/bus.c:586 (discriminator 3)) [ 4.779500] device_del (drivers/base/core.c:3879) [ 4.779539] device_unregister (drivers/base/core.c:3796 drivers/base/core.c:3920) [ 4.779586] del_device_store (drivers/net/netdevsim/bus.c:248) netdevsim [ 4.779644] kernfs_fop_write_iter (fs/kernfs/file.c:88 fs/kernfs/file.c:356) [ 4.779702] vfs_write (fs/read_write.c:594 fs/read_write.c:686) [ 4.779749] ksys_write (fs/read_write.c:738) [ 4.779791] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 4.779840] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 4.779896] RIP: 0033:0x7f5672fe7257 [ 4.779938] 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 [ 4.780100] RSP: 002b:00007ffc8655d1b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 4.780176] RAX: ffffffffffffffda RBX: 00007f56730e3780 RCX: 00007f5672fe7257 [ 4.780256] RDX: 0000000000000004 RSI: 00005620207a6470 RDI: 0000000000000001 [ 4.780331] RBP: 0000000000000004 R08: 0000000000000000 R09: 00007f5673099d20 [ 4.780398] R10: 00007f5673099c20 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