bisecting fixing commit since 4d552acf337038028f7e2f63a927afb7adf65fc1 building syzkaller on e955ac5009431b0201f2e3cf548472bb8acea696 testing commit 4d552acf337038028f7e2f63a927afb7adf65fc1 with gcc (GCC) 8.1.0 kernel signature: ba9669dd1d594a85933ee5a84a91c962de658f9099c1b0c8e3e2146e1a9e3516 all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab testing current HEAD ad326970d25cc85128cd22d62398751ad072efff testing commit ad326970d25cc85128cd22d62398751ad072efff with gcc (GCC) 8.1.0 kernel signature: 5350b6b222b0ee91bcb457c9d2586e900c3607f7d722d27deb6e6fb3a4a12aa2 all runs: crashed: KASAN: use-after-free Read in v4l2_ctrl_grab revisions tested: 2, total time: 22m41.947667606s (build: 16m8.805144766s, test: 5m47.045916374s) the crash still happens on HEAD commit msg: Linux 4.19.152 crash: KASAN: use-after-free Read in v4l2_ctrl_grab IPv6: ADDRCONF(NETDEV_UP): veth1_to_bridge: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth0_to_hsr: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_hsr: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth0: 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 ffff888094360a60 by task syz-executor.0/7119 IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_bridge: link becomes ready CPU: 1 PID: 7119 Comm: syz-executor.0 Not tainted 4.19.152-syzkaller #0 IPv6: ADDRCONF(NETDEV_CHANGE): bridge_slave_1: link becomes ready Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: bridge0: port 2(bridge_slave_1) entered blocking state __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 bridge0: port 2(bridge_slave_1) entered forwarding state IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_hsr: link becomes ready 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): hsr_slave_0: 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 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:00007ffc02a9bc70 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00000000004120b1 RDX: 0000001b30b20000 RSI: 0000000000740490 RDI: 0000000000000003 RBP: 000000000073c900 R08: 000000000000af73 R09: 000000000000af73 R10: 00007ffc02a9bd40 R11: 0000000000000293 R12: ffffffffffffffff R13: 000000000000af75 R14: 00000000000003e8 R15: 000000000073bf0c IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_hsr: link becomes ready Allocated by task 7120: IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready save_stack+0x43/0xd0 mm/kasan/kasan.c:448 IPv6: ADDRCONF(NETDEV_UP): veth0_to_bond: link is not ready 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/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 8021q: adding VLAN 0 to HW filter on device batadv0 __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 IPv6: ADDRCONF(NETDEV_UP): veth1_to_bond: link is not ready do_syscall_64+0xd6/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe IPv6: ADDRCONF(NETDEV_UP): veth0_to_team: link is not ready IPv6: ADDRCONF(NETDEV_UP): veth1_to_team: link is not ready Freed by task 7119: 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 IPv6: ADDRCONF(NETDEV_UP): veth0_to_hsr: link is not 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 entry_SYSCALL_64_after_hwframe+0x49/0xbe IPv6: ADDRCONF(NETDEV_UP): veth1_to_hsr: link is not ready The buggy address belongs to the object at ffff888094360a40 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of 256-byte region [ffff888094360a40, ffff888094360b40) The buggy address belongs to the page: page:ffffea000250d800 count:1 mapcount:0 mapping:ffff88813bf1e7c0 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea0002502988 ffffea0002c91dc8 ffff88813bf1e7c0 hsr0: Slave A (hsr_slave_0) is not up; please bring it up to get a fully working HSR network raw: 0000000000000000 ffff888094360040 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888094360900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888094360980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888094360a00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff888094360a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb hsr0: Slave B (hsr_slave_1) is not up; please bring it up to get a fully working HSR network ffff888094360b00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================