audit: type=1400 audit(1555797155.173:36): avc: denied { map } for pid=7881 comm="syz-executor672" path="/root/syz-executor672615674" dev="sda1" ino=1426 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1 ================================================================== BUG: KASAN: use-after-free in __vb2_perform_fileio+0x105d/0x1140 drivers/media/common/videobuf2/videobuf2-core.c:2389 Read of size 4 at addr ffff888092d6909c by task syz-executor672/7898 CPU: 0 PID: 7898 Comm: syz-executor672 Not tainted 4.19.36 #4 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 __vb2_perform_fileio+0x105d/0x1140 drivers/media/common/videobuf2/videobuf2-core.c:2389 vb2_read+0x3b/0x50 drivers/media/common/videobuf2/videobuf2-core.c:2500 vb2_fop_read+0x212/0x410 drivers/media/common/videobuf2/videobuf2-v4l2.c:897 v4l2_read+0x1ce/0x230 drivers/media/v4l2-core/v4l2-dev.c:317 __vfs_read+0x116/0x800 fs/read_write.c:416 vfs_read+0x194/0x3d0 fs/read_write.c:452 ksys_pread64+0x183/0x1c0 fs/read_write.c:626 __do_sys_pread64 fs/read_write.c:636 [inline] __se_sys_pread64 fs/read_write.c:633 [inline] __x64_sys_pread64+0x97/0xf0 fs/read_write.c:633 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x444f09 Code: e8 ac e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 0b cd fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fffc688cd98 EFLAGS: 00000246 ORIG_RAX: 0000000000000011 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000444f09 RDX: 000000000000008a RSI: 0000000020000140 RDI: 0000000000000003 RBP: 00000000000aa251 R08: 0000000000000004 R09: 00000000004002e0 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000004020a0 R13: 0000000000402130 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7898: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 kmem_cache_alloc_trace+0x152/0x760 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] __vb2_init_fileio+0x1cb/0xbe0 drivers/media/common/videobuf2/videobuf2-core.c:2234 __vb2_perform_fileio+0xbff/0x1140 drivers/media/common/videobuf2/videobuf2-core.c:2368 vb2_read+0x3b/0x50 drivers/media/common/videobuf2/videobuf2-core.c:2500 vb2_fop_read+0x212/0x410 drivers/media/common/videobuf2/videobuf2-v4l2.c:897 v4l2_read+0x1ce/0x230 drivers/media/v4l2-core/v4l2-dev.c:317 __vfs_read+0x116/0x800 fs/read_write.c:416 vfs_read+0x194/0x3d0 fs/read_write.c:452 ksys_pread64+0x183/0x1c0 fs/read_write.c:626 __do_sys_pread64 fs/read_write.c:636 [inline] __se_sys_pread64 fs/read_write.c:633 [inline] __x64_sys_pread64+0x97/0xf0 fs/read_write.c:633 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7895: save_stack+0x45/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 __vb2_cleanup_fileio+0x100/0x170 drivers/media/common/videobuf2/videobuf2-core.c:2327 vb2_core_queue_release+0x20/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2050 vb2_queue_release drivers/media/common/videobuf2/videobuf2-v4l2.c:671 [inline] _vb2_fop_release+0x1cf/0x2a0 drivers/media/common/videobuf2/videobuf2-v4l2.c:842 vb2_fop_release+0x75/0xc0 drivers/media/common/videobuf2/videobuf2-v4l2.c:856 vivid_fop_release+0x18e/0x430 drivers/media/platform/vivid/vivid-core.c:474 v4l2_release+0xfb/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x2df/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x933/0x2fa0 kernel/exit.c:876 do_group_exit+0x135/0x370 kernel/exit.c:979 __do_sys_exit_group kernel/exit.c:990 [inline] __se_sys_exit_group kernel/exit.c:988 [inline] __x64_sys_exit_group+0x44/0x50 kernel/exit.c:988 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888092d68d80 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 796 bytes inside of 1024-byte region [ffff888092d68d80, ffff888092d69180) The buggy address belongs to the page: page:ffffea00024b5a00 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0002a8b988 ffffea0002a24e08 ffff88812c3f0ac0 raw: 0000000000000000 ffff888092d68000 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888092d68f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092d69000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888092d69080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888092d69100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092d69180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================