bisecting fixing commit since 4d552acf337038028f7e2f63a927afb7adf65fc1 building syzkaller on e955ac5009431b0201f2e3cf548472bb8acea696 testing commit 4d552acf337038028f7e2f63a927afb7adf65fc1 with gcc (GCC) 8.1.0 kernel signature: cc1c8db7b8cb9c7eb9e521f6b015260db5147bb3bc3b34da5d70e18cc5fd9dae all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab testing current HEAD 54b4fa6d39551639cb10664f6ac78b01993a1d7e testing commit 54b4fa6d39551639cb10664f6ac78b01993a1d7e with gcc (GCC) 8.1.0 kernel signature: 85910984ded1cfaa244c6f5557801d3d70a3d14d2889edb134c5c0006e92bcff all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab revisions tested: 2, total time: 23m32.773069365s (build: 16m15.243060536s, test: 6m15.65659738s) the crash still happens on HEAD commit msg: Linux 4.19.113 crash: KASAN: use-after-free Read in v4l2_ctrl_grab 8021q: adding VLAN 0 to HW filter on device batadv0 IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready ================================================================== 8021q: adding VLAN 0 to HW filter on device batadv0 BUG: KASAN: use-after-free in v4l2_ctrl_grab+0x114/0x120 drivers/media/v4l2-core/v4l2-ctrls.c:2527 Read of size 8 at addr ffff88809c7abe60 by task syz-executor.3/7138 CPU: 0 PID: 7138 Comm: syz-executor.3 Not tainted 4.19.113-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 v4l2_ctrl_grab+0x114/0x120 drivers/media/v4l2-core/v4l2-ctrls.c:2527 vicodec_stop_streaming+0xfc/0x130 drivers/media/platform/vicodec/vicodec-core.c:1166 __vb2_queue_cancel+0x99/0x6f0 drivers/media/common/videobuf2/videobuf2-core.c:1682 vb2_core_queue_release+0x1e/0x70 drivers/media/common/videobuf2/videobuf2-core.c:2071 vb2_queue_release+0x9/0x10 drivers/media/common/videobuf2/videobuf2-v4l2.c:671 v4l2_m2m_ctx_release+0x22/0x30 drivers/media/v4l2-core/v4l2-mem2mem.c:928 vicodec_release+0xb5/0x120 drivers/media/platform/vicodec/vicodec-core.c:1304 v4l2_release+0xee/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x24c/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x10e/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x1a9/0x200 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x419/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4120b1 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 e4 1a 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffcffb056a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00000000004120b1 RDX: 0000001b32220000 RSI: 0000000000740490 RDI: 0000000000000003 RBP: 000000000073c900 R08: 000000000000b61a R09: 000000000000b61a R10: 00007ffcffb05770 R11: 0000000000000293 R12: ffffffffffffffff R13: 000000000000b621 R14: 00000000000003e8 R15: 000000000073bf0c Allocated by task 7141: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x70 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] v4l2_ctrl_new.part.9+0x22a/0x12b0 drivers/media/v4l2-core/v4l2-ctrls.c:2176 v4l2_ctrl_new drivers/media/v4l2-core/v4l2-ctrls.c:2109 [inline] v4l2_ctrl_new_std+0x1c9/0x2d0 drivers/media/v4l2-core/v4l2-ctrls.c:2293 vicodec_open+0x18d/0xa90 drivers/media/platform/vicodec/vicodec-core.c:1243 v4l2_open+0x17d/0x2d0 drivers/media/v4l2-core/v4l2-dev.c:427 chrdev_open+0x1f0/0x5c0 fs/char_dev.c:423 do_dentry_open+0x3f4/0x1010 fs/open.c:796 vfs_open+0x9a/0xc0 fs/open.c:902 do_last fs/namei.c:3421 [inline] path_openat+0x6fa/0x3c60 fs/namei.c:3537 do_filp_open+0x177/0x250 fs/namei.c:3567 do_sys_open+0x1dd/0x350 fs/open.c:1085 __do_sys_openat fs/open.c:1112 [inline] __se_sys_openat fs/open.c:1106 [inline] __x64_sys_openat+0x98/0xf0 fs/open.c:1106 do_syscall_64+0xd6/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7138: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x230 mm/slab.c:3822 kvfree+0x2c/0x30 mm/util.c:452 v4l2_ctrl_handler_free+0x421/0x7e0 drivers/media/v4l2-core/v4l2-ctrls.c:1930 vicodec_release+0x61/0x120 drivers/media/platform/vicodec/vicodec-core.c:1302 v4l2_release+0xee/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x24c/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x10e/0x190 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x1a9/0x200 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x419/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809c7abe40 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of 256-byte region [ffff88809c7abe40, ffff88809c7abf40) The buggy address belongs to the page: page:ffffea000271eac0 count:1 mapcount:0 mapping:ffff88812c31e7c0 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea0002185f88 ffffea000218b4c8 ffff88812c31e7c0 raw: 0000000000000000 ffff88809c7ab080 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809c7abd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809c7abd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809c7abe00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff88809c7abe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809c7abf00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_bond: link becomes ready