================================================================== BUG: KFENCE: use-after-free read in sixpack_close+0x1a3/0x270 drivers/net/hamradio/6pack.c:678 Use-after-free read at 0xffff88807ebb6c90 (in kfence-#218): sixpack_close+0x1a3/0x270 drivers/net/hamradio/6pack.c:678 tty_ldisc_close+0x110/0x190 drivers/tty/tty_ldisc.c:474 tty_ldisc_kill+0x94/0x150 drivers/tty/tty_ldisc.c:629 tty_ldisc_release+0x154/0x2a0 drivers/tty/tty_ldisc.c:803 tty_release_struct+0x20/0xe0 drivers/tty/tty_io.c:1706 tty_release+0xc70/0x1200 drivers/tty/tty_io.c:1878 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c kfence-#218: 0xffff88807ebb6000-0xffff88807ebb6fce, size=4047, cache=kmalloc-cg-4k allocated by task 6440 on cpu 1 at 303.795785s: kmalloc_node include/linux/slab.h:613 [inline] kvmalloc_node+0x61/0x120 mm/util.c:587 kvmalloc include/linux/slab.h:741 [inline] kvzalloc include/linux/slab.h:749 [inline] alloc_netdev_mqs+0x98/0xec0 net/core/dev.c:10828 sixpack_open+0xfa/0xa50 drivers/net/hamradio/6pack.c:558 tty_ldisc_open+0x9b/0x110 drivers/tty/tty_ldisc.c:449 tty_set_ldisc+0x2f1/0x680 drivers/tty/tty_ldisc.c:579 tiocsetd drivers/tty/tty_io.c:2455 [inline] tty_ioctl+0xae0/0x1670 drivers/tty/tty_io.c:2741 tty_compat_ioctl+0x295/0x410 drivers/tty/tty_io.c:2955 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c freed by task 6441 on cpu 2 at 303.876907s: kvfree+0x42/0x50 mm/util.c:620 device_release+0x9f/0x240 drivers/base/core.c:2230 kobject_cleanup lib/kobject.c:705 [inline] kobject_release lib/kobject.c:736 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1c8/0x540 lib/kobject.c:753 netdev_run_todo+0x75a/0xa80 net/core/dev.c:10638 sixpack_close+0x184/0x270 drivers/net/hamradio/6pack.c:675 tty_ldisc_close+0x110/0x190 drivers/tty/tty_ldisc.c:474 tty_ldisc_kill+0x94/0x150 drivers/tty/tty_ldisc.c:629 tty_ldisc_release+0x154/0x2a0 drivers/tty/tty_ldisc.c:803 tty_release_struct+0x20/0xe0 drivers/tty/tty_io.c:1706 tty_release+0xc70/0x1200 drivers/tty/tty_io.c:1878 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c CPU: 2 PID: 6441 Comm: syz-executor.2 Not tainted 5.16.0-rc1-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:sixpack_close+0x1a3/0x270 drivers/net/hamradio/6pack.c:678 Code: 00 00 48 8b 7b 08 e8 4c 71 29 02 48 8d 7b 10 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 8e 00 00 00 <48> 8b 7b 10 e8 24 fe ae fc 48 8d 7b 20 48 b8 00 00 00 00 00 fc ff RSP: 0018:ffffc90000e97d08 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff88807ebb6c80 RCX: 0000000000000000 RDX: 1ffff1100fd76d92 RSI: ffffffff873ad7d4 RDI: ffff88807ebb6c90 RBP: ffff88807ebb6c88 R08: 0000000000000000 R09: ffffffff8ff76aa7 R10: 0000000000000001 R11: 0000000000000000 R12: ffff888050160400 R13: ffff888043201438 R14: 0000000000000001 R15: ffff888043201648 FS: 0000000000000000(0000) GS:ffff88802cc00000(0063) knlGS:0000000056ce6380 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: ffff88807ebb6c90 CR3: 000000006dfa9000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tty_ldisc_close+0x110/0x190 drivers/tty/tty_ldisc.c:474 tty_ldisc_kill+0x94/0x150 drivers/tty/tty_ldisc.c:629 tty_ldisc_release+0x154/0x2a0 drivers/tty/tty_ldisc.c:803 tty_release_struct+0x20/0xe0 drivers/tty/tty_io.c:1706 tty_release+0xc70/0x1200 drivers/tty/tty_io.c:1878 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 __do_fast_syscall_32+0x72/0xf0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c RIP: 0023:0xf6eed549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffee9280 EFLAGS: 00000286 ORIG_RAX: 0000000000000006 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000000002 RDX: 0000000000000000 RSI: 00000000f7023000 RDI: 000000000004a479 RBP: 00000000f704a760 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ================================================================== ---------------- Code disassembly (best guess): 0: 00 00 add %al,(%rax) 2: 48 8b 7b 08 mov 0x8(%rbx),%rdi 6: e8 4c 71 29 02 callq 0x2297157 b: 48 8d 7b 10 lea 0x10(%rbx),%rdi f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 16: fc ff df 19: 48 89 fa mov %rdi,%rdx 1c: 48 c1 ea 03 shr $0x3,%rdx 20: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 24: 0f 85 8e 00 00 00 jne 0xb8 * 2a: 48 8b 7b 10 mov 0x10(%rbx),%rdi <-- trapping instruction 2e: e8 24 fe ae fc callq 0xfcaefe57 33: 48 8d 7b 20 lea 0x20(%rbx),%rdi 37: 48 rex.W 38: b8 00 00 00 00 mov $0x0,%eax 3d: 00 fc add %bh,%ah 3f: ff .byte 0xff