================================================================== BUG: KFENCE: use-after-free read in dvb_device_open+0xee/0x3b0 drivers/media/dvb-core/dvbdev.c:99 Use-after-free read at 0xffff88807accaf18 (in kfence-#100): dvb_device_open+0xee/0x3b0 drivers/media/dvb-core/dvbdev.c:99 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:949 vfs_open+0x82/0x3f0 fs/open.c:1081 do_open fs/namei.c:4677 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4836 do_file_open+0x20e/0x430 fs/namei.c:4865 do_sys_openat2+0x10d/0x1e0 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_compat_sys_openat fs/open.c:1434 [inline] __se_compat_sys_openat fs/open.c:1432 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1432 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x141/0x6b0 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 kfence-#100: 0xffff88807accaf00-0xffff88807accafd7, size=216, cache=kmalloc-256 allocated by task 1 on cpu 3 at 18.546540s (319.304903s ago): kmalloc_noprof include/linux/slab.h:950 [inline] kzalloc_noprof include/linux/slab.h:1188 [inline] dvb_register_device+0x1d6/0x1e20 drivers/media/dvb-core/dvbdev.c:472 dvb_register_frontend+0x5a8/0x8a0 drivers/media/dvb-core/dvb_frontend.c:3051 vidtv_bridge_dvb_init drivers/media/test-drivers/vidtv/vidtv_bridge.c:436 [inline] vidtv_bridge_probe+0x44b/0xa30 drivers/media/test-drivers/vidtv/vidtv_bridge.c:508 platform_probe+0x106/0x1d0 drivers/base/platform.c:1418 call_driver_probe drivers/base/dd.c:643 [inline] really_probe+0x241/0xa60 drivers/base/dd.c:721 __driver_probe_device+0x1de/0x400 drivers/base/dd.c:863 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:893 __driver_attach+0x21f/0x5d0 drivers/base/dd.c:1287 bus_for_each_dev+0x13e/0x1d0 drivers/base/bus.c:383 bus_add_driver+0x305/0x5b0 drivers/base/bus.c:756 driver_register+0x1e2/0x360 drivers/base/driver.c:249 vidtv_bridge_init+0x38/0x70 drivers/media/test-drivers/vidtv/vidtv_bridge.c:598 do_one_initcall+0x11d/0x760 init/main.c:1382 do_initcall_level init/main.c:1444 [inline] do_initcalls init/main.c:1460 [inline] do_basic_setup init/main.c:1479 [inline] kernel_init_freeable+0x6e5/0x7a0 init/main.c:1692 kernel_init+0x1f/0x1e0 init/main.c:1582 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 freed by task 29072 on cpu 2 at 337.125693s (0.801478s ago): dvb_free_device drivers/media/dvb-core/dvbdev.c:616 [inline] kref_put include/linux/kref.h:65 [inline] dvb_device_put.part.0+0x57/0x90 drivers/media/dvb-core/dvbdev.c:629 dvb_device_put drivers/media/dvb-core/dvbdev.c:628 [inline] dvb_device_open+0x2ba/0x3b0 drivers/media/dvb-core/dvbdev.c:113 chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:949 vfs_open+0x82/0x3f0 fs/open.c:1081 do_open fs/namei.c:4677 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4836 do_file_open+0x20e/0x430 fs/namei.c:4865 do_sys_openat2+0x10d/0x1e0 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_compat_sys_openat fs/open.c:1434 [inline] __se_compat_sys_openat fs/open.c:1432 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1432 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x141/0x6b0 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 CPU: 3 UID: 0 PID: 29138 Comm: syz.1.10751 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:dvb_device_open+0xee/0x3b0 drivers/media/dvb-core/dvbdev.c:99 Code: 0f 84 3f 02 00 00 e8 a1 43 1d fa 48 8d 7d 18 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 4c 02 00 00 <4c> 8b 6d 18 4d 85 ed 0f 84 0e 02 00 00 e8 70 43 1d fa 4c 89 ea 48 RSP: 0000:ffffc900075278d0 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc9000c402000 RDX: 1ffff1100f5995e3 RSI: ffffffff87eaffdf RDI: ffff88807accaf18 RBP: ffff88807accaf00 R08: 0000000000000001 R09: fffffbfff1fda83d R10: ffffffff8fed41ef R11: 0000000000000000 R12: ffff888029e89880 R13: ffffffff87eaff10 R14: ffff8880297a9b60 R15: ffff888029e898c8 FS: 0000000000000000(0000) GS:ffff888097440000(0063) knlGS:00000000f5426b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: ffff88807accaf18 CR3: 000000004a753000 CR4: 0000000000352ef0 Call Trace: chrdev_open+0x234/0x6a0 fs/char_dev.c:411 do_dentry_open+0x6d8/0x1660 fs/open.c:949 vfs_open+0x82/0x3f0 fs/open.c:1081 do_open fs/namei.c:4677 [inline] path_openat+0x208c/0x31a0 fs/namei.c:4836 do_file_open+0x20e/0x430 fs/namei.c:4865 do_sys_openat2+0x10d/0x1e0 fs/open.c:1366 do_sys_open fs/open.c:1372 [inline] __do_compat_sys_openat fs/open.c:1434 [inline] __se_compat_sys_openat fs/open.c:1432 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1432 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x141/0x6b0 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 RIP: 0023:0xf7165cab Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53 RSP: 002b:00000000f542603c EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000f5426100 RDX: 000000000000413f RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ================================================================== ---------------- Code disassembly (best guess): 0: 0f 84 3f 02 00 00 je 0x245 6: e8 a1 43 1d fa call 0xfa1d43ac b: 48 8d 7d 18 lea 0x18(%rbp),%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 4c 02 00 00 jne 0x276 * 2a: 4c 8b 6d 18 mov 0x18(%rbp),%r13 <-- trapping instruction 2e: 4d 85 ed test %r13,%r13 31: 0f 84 0e 02 00 00 je 0x245 37: e8 70 43 1d fa call 0xfa1d43ac 3c: 4c 89 ea mov %r13,%rdx 3f: 48 rex.W