bisecting fixing commit since e4e453434a199cdfa1e1e5cc723d8736f522354a building syzkaller on 1ba81399e2d03b53a7e631c4ab05f25af1fb1911 testing commit e4e453434a199cdfa1e1e5cc723d8736f522354a compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: b406e49db67074853b023b3ea50338bfaa091ea93478ee3cdf1a2bb6f1eec48e all runs: crashed: KASAN: use-after-free Read in v4l2_fh_init testing current HEAD 2585cf9dfaaddf00b069673f27bb3f8530e2039c testing commit 2585cf9dfaaddf00b069673f27bb3f8530e2039c compiler: gcc (GCC) 10.2.1 20210217, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 31c42cde9095d67da84eec29cc37320bc8988d42c7c9057b90555f3572827eda run #0: crashed: KASAN: use-after-free Read in v4l2_fh_init run #1: crashed: KASAN: use-after-free Read in v4l2_fh_init run #2: crashed: KASAN: use-after-free Read in v4l2_fh_init run #3: crashed: KASAN: use-after-free Read in v4l2_fh_init run #4: crashed: KASAN: use-after-free Read in v4l2_fh_init run #5: crashed: KASAN: use-after-free Read in v4l2_fh_init run #6: crashed: KASAN: use-after-free Read in v4l2_fh_init run #7: crashed: KASAN: use-after-free Read in v4l2_fh_init run #8: crashed: KASAN: use-after-free Read in v4l2_fh_init run #9: crashed: KASAN: out-of-bounds Read in v4l2_fh_init revisions tested: 2, total time: 21m48.751364182s (build: 12m30.086778757s, test: 8m35.495953224s) the crash still happens on HEAD commit msg: Linux 5.16-rc5 crash: KASAN: out-of-bounds Read in v4l2_fh_init ================================================================== BUG: KASAN: out-of-bounds in v4l2_fh_init+0x274/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 Read of size 8 at addr ffff88806087c900 by task v4l_id/4897 CPU: 0 PID: 4897 Comm: v4l_id Not tainted 5.16.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 v4l2_fh_init+0x274/0x2c0 drivers/media/v4l2-core/v4l2-fh.c:25 v4l2_fh_open+0x78/0xb0 drivers/media/v4l2-core/v4l2-fh.c:63 em28xx_v4l2_open+0xd6/0x430 drivers/media/usb/em28xx/em28xx-video.c:2163 v4l2_open+0x1e3/0x370 drivers/media/v4l2-core/v4l2-dev.c:427 chrdev_open+0x20f/0x650 fs/char_dev.c:414 do_dentry_open+0x429/0x1040 fs/open.c:822 do_open fs/namei.c:3426 [inline] path_openat+0x9ea/0x2250 fs/namei.c:3559 do_filp_open+0x199/0x3d0 fs/namei.c:3586 do_sys_openat2+0x11e/0x400 fs/open.c:1212 do_sys_open fs/open.c:1228 [inline] __do_sys_openat fs/open.c:1244 [inline] __se_sys_openat fs/open.c:1239 [inline] __x64_sys_openat+0x11b/0x1d0 fs/open.c:1239 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fefcad81697 Code: 25 00 00 41 00 3d 00 00 41 00 74 37 64 8b 04 25 18 00 00 00 85 c0 75 5b 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 85 00 00 00 48 83 c4 68 5d 41 5c c3 0f 1f RSP: 002b:00007fff4e218390 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00005616696d7c40 RCX: 00007fefcad81697 RDX: 0000000000000000 RSI: 00007fff4e218f1e RDI: 00000000ffffff9c RBP: 00007fff4e218f1e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea0001821f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6087c head:ffffea0001821f00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010000(head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010000 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x140dc0(GFP_USER|__GFP_COMP|__GFP_ZERO), pid 3658, ts 159306605386, free_ts 159297204569 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa6f/0x2f10 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 kmalloc_order+0x34/0xf0 mm/slab_common.c:949 kmalloc_order_trace+0x14/0x120 mm/slab_common.c:965 kmalloc_large include/linux/slab.h:519 [inline] kmalloc include/linux/slab.h:583 [inline] kzalloc include/linux/slab.h:724 [inline] em28xx_usb_probe+0x177/0xf90 drivers/media/usb/em28xx/em28xx-cards.c:3860 usb_probe_interface+0x274/0x6a0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:517 [inline] really_probe+0x1c2/0xb60 drivers/base/dd.c:596 __driver_probe_device+0x2a6/0x460 drivers/base/dd.c:751 driver_probe_device+0x44/0x110 drivers/base/dd.c:781 __device_attach_driver+0x185/0x250 drivers/base/dd.c:898 bus_for_each_drv+0x11e/0x1a0 drivers/base/bus.c:427 __device_attach+0x1db/0x410 drivers/base/dd.c:969 bus_probe_device+0x19d/0x250 drivers/base/bus.c:487 device_add+0xa57/0x1b80 drivers/base/core.c:3394 usb_set_configuration+0xa66/0x18b0 drivers/usb/core/message.c:2170 usb_generic_driver_probe+0x74/0xa0 drivers/usb/core/generic.c:238 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 em28xx_v4l2_init drivers/media/usb/em28xx/em28xx-video.c:2911 [inline] em28xx_v4l2_init.cold+0x21f/0x2d3f drivers/media/usb/em28xx/em28xx-video.c:2520 em28xx_init_extension+0x106/0x1c0 drivers/media/usb/em28xx/em28xx-core.c:1126 process_one_work+0x87f/0x1450 kernel/workqueue.c:2298 process_scheduled_works kernel/workqueue.c:2361 [inline] worker_thread+0x704/0x1040 kernel/workqueue.c:2450 kthread+0x3ab/0x480 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88806087c800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806087c880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88806087c900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88806087c980: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806087ca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================