bisecting fixing commit since 4d552acf337038028f7e2f63a927afb7adf65fc1 building syzkaller on e955ac5009431b0201f2e3cf548472bb8acea696 testing commit 4d552acf337038028f7e2f63a927afb7adf65fc1 with gcc (GCC) 8.1.0 kernel signature: e949d6b43772bafa161f8a2b99a02093c7298a75ded72064c043f5db182c1414 all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab testing current HEAD 765675379b6253b6901563e649a2f87d28ada3ff testing commit 765675379b6253b6901563e649a2f87d28ada3ff with gcc (GCC) 8.1.0 kernel signature: 72ef61b891c41964d01914ceb1bc85fadaa5ef8effdd913aaf9dbcb8054c88a7 all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab revisions tested: 2, total time: 26m24.410060658s (build: 18m58.088366897s, test: 6m5.37339628s) the crash still happens on HEAD commit msg: Linux 4.19.119 crash: KASAN: use-after-free Read in v4l2_ctrl_grab IPv6: ADDRCONF(NETDEV_UP): veth0_to_team: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_team: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_team: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_0: link becomes ready ================================================================== BUG: KASAN: use-after-free in v4l2_ctrl_grab+0x114/0x120 drivers/media/v4l2-core/v4l2-ctrls.c:2527 IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_team: link becomes ready Read of size 8 at addr ffff888097f9dae0 by task syz-executor.3/7132 CPU: 0 PID: 7132 Comm: syz-executor.3 Not tainted 4.19.119-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 IPv6: ADDRCONF(NETDEV_CHANGE): team_slave_1: link becomes ready 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 IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready 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:00007ffd9f028400 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00000000004120b1 RDX: 0000001b32120000 RSI: 0000000000740490 RDI: 0000000000000003 RBP: 000000000073c900 R08: 000000000000bb22 R09: 000000000000bb22 R10: 00007ffd9f0284d0 R11: 0000000000000293 R12: ffffffffffffffff R13: 000000000000bb24 R14: 00000000000003e8 R15: 000000000073bf0c Allocated by task 7133: 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 7132: 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 IPv6: ADDRCONF(NETDEV_UP): hsr0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready The buggy address belongs to the object at ffff888097f9dac0 which belongs to the cache kmalloc-256 of size 256 IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready The buggy address is located 32 bytes inside of 256-byte region [ffff888097f9dac0, ffff888097f9dbc0) 8021q: adding VLAN 0 to HW filter on device batadv0 The buggy address belongs to the page: page:ffffea00025fe740 count:1 mapcount:0 mapping:ffff88812c31e7c0 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea0002619248 ffffea000261d008 ffff88812c31e7c0 raw: 0000000000000000 ffff888097f9d0c0 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888097f9d980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097f9da00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888097f9da80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff888097f9db00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888097f9db80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== 8021q: adding VLAN 0 to HW filter on device batadv0 IPv6: ADDRCONF(NETDEV_UP): veth0_to_hsr: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): team0: link becomes ready