bisecting fixing commit since 4d552acf337038028f7e2f63a927afb7adf65fc1 building syzkaller on e955ac5009431b0201f2e3cf548472bb8acea696 testing commit 4d552acf337038028f7e2f63a927afb7adf65fc1 with gcc (GCC) 8.1.0 kernel signature: 9ffb641b555a41f4810251dd66b6f0c42a9ef098065d01d183fedca3119f11ab all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab testing current HEAD f6d5cb9e2c06f7d583dd9f4f7cca21d13d78c32a testing commit f6d5cb9e2c06f7d583dd9f4f7cca21d13d78c32a with gcc (GCC) 8.1.0 kernel signature: 5856fbaec425b1951fa05ebc3771d27062e3a1b8432c7a945cba4ecd66c01269 all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab revisions tested: 2, total time: 25m50.626934812s (build: 18m34.554693095s, test: 5m42.349287961s) the crash still happens on HEAD commit msg: Linux 4.19.142 crash: KASAN: use-after-free Read in v4l2_ctrl_grab IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): hsr0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready ================================================================== 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 ffff88809f46fea0 by task syz-executor.0/7121 CPU: 1 PID: 7121 Comm: syz-executor.0 Not tainted 4.19.142-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 8021q: adding VLAN 0 to HW filter on device batadv0 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:00007ffc6ea9ca30 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00000000004120b1 RDX: 0000001b30f20000 RSI: 0000000000740490 RDI: 0000000000000003 RBP: 000000000073c900 R08: 000000000000baf7 R09: 000000000000baf7 IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready R10: 00007ffc6ea9cb00 R11: 0000000000000293 R12: ffffffffffffffff R13: 000000000000bb16 R14: 00000000000003e8 R15: 000000000073bf0c Allocated by task 7122: 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 8021q: adding VLAN 0 to HW filter on device batadv0 __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/0x11c0 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 7121: 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 ffff88809f46fe80 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of 256-byte region [ffff88809f46fe80, ffff88809f46ff80) The buggy address belongs to the page: page:ffffea00027d1bc0 count:1 mapcount:0 mapping:ffff88812c31e7c0 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea0002355488 ffffea00027b5088 ffff88812c31e7c0 raw: 0000000000000000 ffff88809f46f0c0 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809f46fd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809f46fe00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88809f46fe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809f46ff00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809f46ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== IPv6: ADDRCONF(NETDEV_UP): veth1_to_hsr: link is not ready hsr0: Slave B (hsr_slave_1) is not up; please bring it up to get a fully working HSR network