audit: type=1400 audit(1580905098.345:36): avc: denied { map } for pid=7302 comm="syz-executor989" path="/root/syz-executor989999373" dev="sda1" ino=16483 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+0xddf/0xeb0 drivers/media/v4l2-core/videobuf2-core.c:2379 Read of size 4 at addr ffff8880a7ab031c by task syz-executor989/7311 CPU: 1 PID: 7311 Comm: syz-executor989 Not tainted 4.14.169-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+0x142/0x197 lib/dump_stack.c:58 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:429 __vb2_perform_fileio+0xddf/0xeb0 drivers/media/v4l2-core/videobuf2-core.c:2379 vb2_read+0x3b/0x50 drivers/media/v4l2-core/videobuf2-core.c:2490 vb2_fop_read+0x1f5/0x3e0 drivers/media/v4l2-core/videobuf2-v4l2.c:895 v4l2_read+0x1a9/0x200 drivers/media/v4l2-core/v4l2-dev.c:309 do_loop_readv_writev fs/read_write.c:695 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_read+0x3e2/0x5b0 fs/read_write.c:919 vfs_readv+0xd3/0x130 fs/read_write.c:981 do_preadv+0x15d/0x200 fs/read_write.c:1065 SYSC_preadv fs/read_write.c:1115 [inline] SyS_preadv+0x31/0x40 fs/read_write.c:1110 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x444fe9 RSP: 002b:00007fff23ade0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000444fe9 RDX: 0000000000000008 RSI: 0000000020000400 RDI: 0000000000000003 RBP: 00000000006cf018 R08: 0000000000000004 R09: 00000000004002e0 R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000402180 R13: 0000000000402210 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 7311: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc mm/kasan/kasan.c:551 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] __vb2_init_fileio+0x182/0xa90 drivers/media/v4l2-core/videobuf2-core.c:2224 __vb2_perform_fileio+0x9f0/0xeb0 drivers/media/v4l2-core/videobuf2-core.c:2358 vb2_read+0x3b/0x50 drivers/media/v4l2-core/videobuf2-core.c:2490 vb2_fop_read+0x1f5/0x3e0 drivers/media/v4l2-core/videobuf2-v4l2.c:895 v4l2_read+0x1a9/0x200 drivers/media/v4l2-core/v4l2-dev.c:309 do_loop_readv_writev fs/read_write.c:695 [inline] do_loop_readv_writev fs/read_write.c:682 [inline] do_iter_read+0x3e2/0x5b0 fs/read_write.c:919 vfs_readv+0xd3/0x130 fs/read_write.c:981 do_preadv+0x15d/0x200 fs/read_write.c:1065 SYSC_preadv fs/read_write.c:1115 [inline] SyS_preadv+0x31/0x40 fs/read_write.c:1110 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7313: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x45/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 __vb2_cleanup_fileio+0xfc/0x150 drivers/media/v4l2-core/videobuf2-core.c:2317 vb2_core_queue_release+0x1d/0x80 drivers/media/v4l2-core/videobuf2-core.c:2040 vb2_queue_release drivers/media/v4l2-core/videobuf2-v4l2.c:669 [inline] _vb2_fop_release+0x1cf/0x2a0 drivers/media/v4l2-core/videobuf2-v4l2.c:840 vb2_fop_release+0x75/0xc0 drivers/media/v4l2-core/videobuf2-v4l2.c:854 vivid_fop_release+0x180/0x3f0 drivers/media/platform/vivid/vivid-core.c:486 v4l2_release+0xf9/0x190 drivers/media/v4l2-core/v4l2-dev.c:446 __fput+0x275/0x7a0 fs/file_table.c:210 ____fput+0x16/0x20 fs/file_table.c:244 task_work_run+0x114/0x190 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa1a/0x2cd0 kernel/exit.c:858 do_group_exit+0x111/0x330 kernel/exit.c:955 SYSC_exit_group kernel/exit.c:966 [inline] SyS_exit_group+0x1d/0x20 kernel/exit.c:964 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a7ab0000 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 796 bytes inside of 1024-byte region [ffff8880a7ab0000, ffff8880a7ab0400) The buggy address belongs to the page: page:ffffea00029eac00 count:1 mapcount:0 mapping:ffff8880a7ab0000 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a7ab0000 0000000000000000 0000000100000007 raw: ffffea0002962020 ffffea00025cb7a0 ffff8880aa800ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a7ab0200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a7ab0280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a7ab0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a7ab0380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a7ab0400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================