bisecting fixing commit since f6e27dbb1afabcba436e346d6aa88a592a1436bb building syzkaller on a3355dba737fedcd171f8b9e60bf35d733986f16 testing commit f6e27dbb1afabcba436e346d6aa88a592a1436bb with gcc (GCC) 8.1.0 kernel signature: 55bd052a410094e5720c713531289fd969ea9f065954e9d8aedd7bceea1305af all runs: crashed: INFO: task hung in vivid_stop_generating_vid_cap testing current HEAD c10b57a567e4333b9fdf60b5ec36de9859263ca2 testing commit c10b57a567e4333b9fdf60b5ec36de9859263ca2 with gcc (GCC) 8.1.0 kernel signature: b43e2785f0f21edf506c660844f5f8d1caed78261c1bcada81d9a37c08c5f620 all runs: crashed: KASAN: use-after-free Read in __vb2_perform_fileio revisions tested: 2, total time: 28m52.062549104s (build: 17m40.791950173s, test: 10m8.276702269s) the crash still happens on HEAD commit msg: Linux 4.14.176 crash: KASAN: use-after-free Read in __vb2_perform_fileio IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready 8021q: adding VLAN 0 to HW filter on device batadv0 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 __vb2_perform_fileio+0x10fd/0x12b0 drivers/media/v4l2-core/videobuf2-core.c:2379 Read of size 4 at addr ffff8880986ff99c by task syz-executor.5/7765 CPU: 1 PID: 7765 Comm: syz-executor.5 Not tainted 4.14.176-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __vb2_perform_fileio+0x10fd/0x12b0 drivers/media/v4l2-core/videobuf2-core.c:2379 vb2_read+0xf/0x20 drivers/media/v4l2-core/videobuf2-core.c:2490 vb2_fop_read+0x1b6/0x390 drivers/media/v4l2-core/videobuf2-v4l2.c:895 v4l2_read+0x133/0x240 drivers/media/v4l2-core/v4l2-dev.c:309 do_loop_readv_writev fs/read_write.c:695 [inline] do_iter_read+0x35e/0x570 fs/read_write.c:919 vfs_readv+0xb6/0x110 fs/read_write.c:981 do_preadv+0x158/0x250 fs/read_write.c:1065 SYSC_preadv fs/read_write.c:1115 [inline] SyS_preadv+0xc/0x10 fs/read_write.c:1110 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x459a29 RSP: 002b:00007f29c513bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459a29 RDX: 0000000000000006 RSI: 00000000200018c0 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f29c513c6d4 R13: 00000000004c6d3d R14: 00000000004dc0b8 R15: 00000000ffffffff Allocated by task 7764: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x152/0x7a0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] __vb2_init_fileio+0x160/0xaf0 drivers/media/v4l2-core/videobuf2-core.c:2224 __vb2_perform_fileio+0xa9f/0x12b0 drivers/media/v4l2-core/videobuf2-core.c:2358 vb2_read+0xf/0x20 drivers/media/v4l2-core/videobuf2-core.c:2490 vb2_fop_read+0x1b6/0x390 drivers/media/v4l2-core/videobuf2-v4l2.c:895 v4l2_read+0x133/0x240 drivers/media/v4l2-core/v4l2-dev.c:309 do_loop_readv_writev fs/read_write.c:695 [inline] do_iter_read+0x35e/0x570 fs/read_write.c:919 vfs_readv+0xb6/0x110 fs/read_write.c:981 do_preadv+0x158/0x250 fs/read_write.c:1065 SYSC_preadv fs/read_write.c:1115 [inline] SyS_preadv+0xc/0x10 fs/read_write.c:1110 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7779: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 __vb2_cleanup_fileio+0xee/0x140 drivers/media/v4l2-core/videobuf2-core.c:2317 vb2_core_queue_release+0xf/0x70 drivers/media/v4l2-core/videobuf2-core.c:2040 vb2_queue_release drivers/media/v4l2-core/videobuf2-v4l2.c:669 [inline] _vb2_fop_release+0x1ac/0x280 drivers/media/v4l2-core/videobuf2-v4l2.c:840 vb2_fop_release+0x66/0xd0 drivers/media/v4l2-core/videobuf2-v4l2.c:854 vivid_fop_release+0x15f/0x3a0 drivers/media/platform/vivid/vivid-core.c:486 v4l2_release+0xeb/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:446 __fput+0x232/0x750 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 get_signal+0x148c/0x1b30 kernel/signal.c:2234 do_signal+0x7f/0x19a0 arch/x86/kernel/signal.c:814 exit_to_usermode_loop+0x114/0x1b0 arch/x86/entry/common.c:160 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880986ff680 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 796 bytes inside of 1024-byte region [ffff8880986ff680, ffff8880986ffa80) The buggy address belongs to the page: page:ffffea000261bf80 count:1 mapcount:0 mapping:ffff8880986fe000 index:0xffff8880986fe900 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff8880986fe000 ffff8880986fe900 0000000100000004 raw: ffffea00026167a0 ffffea0002225ba0 ffff8880aa800ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880986ff880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880986ff900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880986ff980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880986ffa00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880986ffa80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================