====================================== | xx__-> [ 2.165549] ------------[ cut here ]------------ | [ 2.165645] refcount_t: underflow; use-after-free. | [ 2.165696] WARNING: CPU: 0 PID: 229 at lib/refcount.c:28 refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) | [ 2.165768] Modules linked in: [ 2.165864] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011 [ 2.165926] RIP: 0010:refcount_warn_saturate (lib/refcount.c:28 (discriminator 3)) [ 2.165966] Code: a9 e8 18 df ba ff 90 0f 0b 90 90 c3 80 3d 79 c9 eb 00 00 75 89 c6 05 70 c9 eb 00 01 90 48 c7 c7 f0 8d d1 a9 e8 f5 de ba ff 90 <0f> 0b 90 90 c3 80 3d 54 c9 eb 00 00 0f 85 62 ff ff ff c6 05 47 c9 All code ======== 0: a9 e8 18 df ba test $0xbadf18e8,%eax 5: ff 90 0f 0b 90 90 call *-0x6f6ff4f1(%rax) b: c3 ret c: 80 3d 79 c9 eb 00 00 cmpb $0x0,0xebc979(%rip) # 0xebc98c 13: 75 89 jne 0xffffffffffffff9e 15: c6 05 70 c9 eb 00 01 movb $0x1,0xebc970(%rip) # 0xebc98c 1c: 90 nop 1d: 48 c7 c7 f0 8d d1 a9 mov $0xffffffffa9d18df0,%rdi 24: e8 f5 de ba ff call 0xffffffffffbadf1e 29: 90 nop 2a:* 0f 0b ud2 <-- trapping instruction 2c: 90 nop 2d: 90 nop 2e: c3 ret 2f: 80 3d 54 c9 eb 00 00 cmpb $0x0,0xebc954(%rip) # 0xebc98a 36: 0f 85 62 ff ff ff jne 0xffffffffffffff9e 3c: c6 .byte 0xc6 3d: 05 .byte 0x5 3e: 47 c9 rex.RXB leave Code starting with the faulting instruction =========================================== 0: 0f 0b ud2 2: 90 nop 3: 90 nop 4: c3 ret 5: 80 3d 54 c9 eb 00 00 cmpb $0x0,0xebc954(%rip) # 0xebc960 c: 0f 85 62 ff ff ff jne 0xffffffffffffff74 12: c6 .byte 0xc6 13: 05 .byte 0x5 14: 47 c9 rex.RXB leave [ 2.166092] RSP: 0018:ffffb003c05a7e50 EFLAGS: 00010286 [ 2.166131] RAX: 0000000000000000 RBX: ffffb003c05a7e60 RCX: 00000000ffffdfff [ 2.166181] RDX: 0000000000000000 RSI: 00000000ffffffea RDI: 0000000000000001 [ 2.166230] RBP: ffffb003c05a7988 R08: ffffffffaa156a28 R09: 00000000ffffdfff [ 2.166279] R10: ffffffffaa076a40 R11: ffffffffaa126a40 R12: dead000000000122 [ 2.166329] R13: 00000000fffb7416 R14: 0000000000000001 R15: ffff92d8431cc000 [ 2.166380] FS: 00000000053fa3c0(0000) GS:ffff92d8d43e6000(0000) knlGS:0000000000000000 [ 2.166436] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2.166482] CR2: 00007f8975419000 CR3: 0000000004b61003 CR4: 0000000000772ef0 [ 2.166550] PKRU: 55555554 [ 2.166571] Call Trace: [ 2.166590] [ 2.166611] netdev_run_todo (./include/linux/list.h:381 net/core/dev.c:11670) [ 2.166646] ? __tun_detach (./include/linux/ptr_ring.h:680 drivers/net/tun.c:625) [ 2.166681] tun_chr_close (./include/net/sock.h:1990 drivers/net/tun.c:643 drivers/net/tun.c:3436) [ 2.166707] __fput (fs/file_table.c:469) [ 2.166748] __x64_sys_close (fs/open.c:1592 fs/open.c:1574 fs/open.c:1574) [ 2.166779] do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) [ 2.166811] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130) [ 2.166851] RIP: 0033:0x4901eb [ 2.166882] Code: 03 00 00 00 0f 05 48 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 c3 78 04 00 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 21 79 04 00 8b 44 All code ======== 0: 03 00 add (%rax),%eax 2: 00 00 add %al,(%rax) 4: 0f 05 syscall 6: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax c: 77 41 ja 0x4f e: c3 ret f: 48 83 ec 18 sub $0x18,%rsp 13: 89 7c 24 0c mov %edi,0xc(%rsp) 17: e8 c3 78 04 00 call 0x478df 1c: 8b 7c 24 0c mov 0xc(%rsp),%edi 20: 41 89 c0 mov %eax,%r8d 23: b8 03 00 00 00 mov $0x3,%eax 28: 0f 05 syscall 2a:* 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax <-- trapping instruction 30: 77 35 ja 0x67 32: 44 89 c7 mov %r8d,%edi 35: 89 44 24 0c mov %eax,0xc(%rsp) 39: e8 21 79 04 00 call 0x4795f 3e: 8b .byte 0x8b 3f: 44 rex.R Code starting with the faulting instruction =========================================== 0: 48 3d 00 f0 ff ff cmp $0xfffffffffffff000,%rax 6: 77 35 ja 0x3d 8: 44 89 c7 mov %r8d,%edi b: 89 44 24 0c mov %eax,0xc(%rsp) f: e8 21 79 04 00 call 0x47935 14: 8b .byte 0x8b 15: 44 rex.R [ 2.166999] RSP: 002b:00007ffdabb2f850 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 [ 2.167049] RAX: ffffffffffffffda RBX: 00007ffdabb2fda8 RCX: 00000000004901eb [ 2.167098] RDX: 0000000000000002 RSI: 0000000000000002 RDI: 0000000000000005 [ 2.167154] RBP: 00007ffdabb2f890 R08: 0000000000000000 R09: 0000000000000000 [ 2.167203] R10: 0000000000000004 R11: 0000000000000293 R12: 00007ffdabb2fd28 Finger prints: refcount_warn_saturate:netdev_run_todo:tun_chr_close:__fput:__x64_sys_close