sshd (5694) used greatest stack depth: 15744 bytes left ================================================================== BUG: KASAN: use-after-free in __vb2_cleanup_fileio+0x13d/0x160 drivers/media/common/videobuf2/videobuf2-core.c:2327 Write of size 4 at addr ffff8801d13fe900 by task syz-executor010/5717 CPU: 0 PID: 5717 Comm: syz-executor010 Not tainted 4.19.0+ #216 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_store4_noabort+0x17/0x20 mm/kasan/report.c:437 __vb2_cleanup_fileio+0x13d/0x160 drivers/media/common/videobuf2/videobuf2-core.c:2327 vb2_core_queue_release+0x1e/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2052 vb2_queue_release drivers/media/common/videobuf2/videobuf2-v4l2.c:672 [inline] _vb2_fop_release+0x1d2/0x2b0 drivers/media/common/videobuf2/videobuf2-v4l2.c:843 vb2_fop_release+0x77/0xc0 drivers/media/common/videobuf2/videobuf2-v4l2.c:857 vivid_fop_release+0x18e/0x440 drivers/media/platform/vivid/vivid-core.c:474 v4l2_release+0xfb/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:341 [inline] do_fast_syscall_32+0xcd5/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f3fa29 Code: 85 d2 74 02 89 0a 5b 5d c3 8b 04 24 c3 8b 14 24 c3 8b 3c 24 c3 90 90 90 90 90 90 90 90 90 90 90 90 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 eb 0d 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 002b:00000000ffe05f7c EFLAGS: 00000246 ORIG_RAX: 0000000000000006 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000020000100 RDX: 0000000000000003 RSI: 0000000000000000 RDI: 00000000200000cc RBP: 00000000ffe05fd8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 5711: 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 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] __vb2_init_fileio+0x1ce/0xc90 drivers/media/common/videobuf2/videobuf2-core.c:2236 __vb2_perform_fileio+0xcfb/0x1210 drivers/media/common/videobuf2/videobuf2-core.c:2370 vb2_read+0x3b/0x50 drivers/media/common/videobuf2/videobuf2-core.c:2502 vb2_fop_read+0x20a/0x400 drivers/media/common/videobuf2/videobuf2-v4l2.c:898 v4l2_read+0x168/0x220 drivers/media/v4l2-core/v4l2-dev.c:317 __vfs_read+0x117/0x9b0 fs/read_write.c:416 vfs_read+0x17f/0x3c0 fs/read_write.c:452 ksys_read+0x101/0x260 fs/read_write.c:578 __do_sys_read fs/read_write.c:588 [inline] __se_sys_read fs/read_write.c:586 [inline] __ia32_sys_read+0x71/0xb0 fs/read_write.c:586 do_syscall_32_irqs_on arch/x86/entry/common.c:326 [inline] do_fast_syscall_32+0x34d/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 5718: 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:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 __vb2_cleanup_fileio+0xf8/0x160 drivers/media/common/videobuf2/videobuf2-core.c:2329 vb2_core_queue_release+0x1e/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2052 vb2_queue_release drivers/media/common/videobuf2/videobuf2-v4l2.c:672 [inline] _vb2_fop_release+0x1d2/0x2b0 drivers/media/common/videobuf2/videobuf2-v4l2.c:843 vb2_fop_release+0x77/0xc0 drivers/media/common/videobuf2/videobuf2-v4l2.c:857 vivid_fop_release+0x18e/0x440 drivers/media/platform/vivid/vivid-core.c:474 v4l2_release+0xfb/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:341 [inline] do_fast_syscall_32+0xcd5/0xfb2 arch/x86/entry/common.c:397 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff8801d13fe900 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 0 bytes inside of 1024-byte region [ffff8801d13fe900, ffff8801d13fed00) The buggy address belongs to the page: page:ffffea000744ff80 count:1 mapcount:0 mapping:ffff8801da800ac0 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea00073c7d88 ffffea00073ba008 ffff8801da800ac0 raw: 0000000000000000 ffff8801d13fe000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d13fe800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d13fe880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d13fe900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d13fe980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d13fea00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================