audit: type=1400 audit(2000000122.286:14091): avc: denied { associate } for pid=28932 comm="syz-executor.1" name="syz1" scontext=unconfined_u:object_r:unlabeled_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=filesystem permissive=1 ================================================================== BUG: KASAN: use-after-free in v4l2_ctrl_grab drivers/media/v4l2-core/v4l2-ctrls.c:2526 [inline] BUG: KASAN: use-after-free in v4l2_ctrl_grab+0x159/0x160 drivers/media/v4l2-core/v4l2-ctrls.c:2519 Read of size 8 at addr ffff8880834bcce0 by task syz-executor.0/28942 CPU: 0 PID: 28942 Comm: syz-executor.0 Not tainted 4.19.71 #0 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_load8_noabort+0x14/0x20 mm/kasan/report.c:433 v4l2_ctrl_grab drivers/media/v4l2-core/v4l2-ctrls.c:2526 [inline] v4l2_ctrl_grab+0x159/0x160 drivers/media/v4l2-core/v4l2-ctrls.c:2519 vicodec_stop_streaming+0x158/0x1a0 drivers/media/platform/vicodec/vicodec-core.c:1166 __vb2_queue_cancel+0xb1/0x790 drivers/media/common/videobuf2/videobuf2-core.c:1682 vb2_core_queue_release+0x28/0x80 drivers/media/common/videobuf2/videobuf2-core.c:2071 vb2_queue_release+0x16/0x20 drivers/media/common/videobuf2/videobuf2-v4l2.c:671 v4l2_m2m_ctx_release+0x2d/0x40 drivers/media/v4l2-core/v4l2-mem2mem.c:928 vicodec_release+0xc0/0x120 drivers/media/platform/vicodec/vicodec-core.c:1304 v4l2_release+0xf9/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4598e9 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fe3e3700c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00000000004598e9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe3e37016d4 R13: 00000000004f90b2 R14: 00000000004d1b90 R15: 00000000ffffffff Allocated by task 28942: 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 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x51/0x80 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x100 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] kvzalloc include/linux/mm.h:585 [inline] v4l2_ctrl_new.part.0+0x214/0x1450 drivers/media/v4l2-core/v4l2-ctrls.c:2175 v4l2_ctrl_new drivers/media/v4l2-core/v4l2-ctrls.c:2108 [inline] v4l2_ctrl_new_std+0x22d/0x360 drivers/media/v4l2-core/v4l2-ctrls.c:2292 vicodec_open+0x1a8/0xb30 drivers/media/platform/vicodec/vicodec-core.c:1243 v4l2_open+0x1b2/0x360 drivers/media/v4l2-core/v4l2-dev.c:427 chrdev_open+0x245/0x6b0 fs/char_dev.c:423 do_dentry_open+0x4c3/0x1210 fs/open.c:796 vfs_open+0xa0/0xd0 fs/open.c:905 do_last fs/namei.c:3418 [inline] path_openat+0x10d7/0x45e0 fs/namei.c:3534 do_filp_open+0x1a1/0x280 fs/namei.c:3564 do_sys_open+0x3fe/0x550 fs/open.c:1088 __do_sys_openat fs/open.c:1115 [inline] __se_sys_openat fs/open.c:1109 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1109 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 28942: 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/0x220 mm/slab.c:3822 kvfree+0x61/0x70 mm/util.c:452 v4l2_ctrl_handler_free drivers/media/v4l2-core/v4l2-ctrls.c:1929 [inline] v4l2_ctrl_handler_free+0x4a8/0x7e0 drivers/media/v4l2-core/v4l2-ctrls.c:1909 vicodec_release+0x6b/0x120 drivers/media/platform/vicodec/vicodec-core.c:1302 v4l2_release+0xf9/0x1a0 drivers/media/v4l2-core/v4l2-dev.c:448 __fput+0x2dd/0x8b0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x145/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x53d/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880834bccc0 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of 256-byte region [ffff8880834bccc0, ffff8880834bcdc0) The buggy address belongs to the page: page:ffffea00020d2f00 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0xffff8880834bcb80 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea0002951d08 ffffea000295ae08 ffff88812c3f07c0 raw: ffff8880834bcb80 ffff8880834bc040 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880834bcb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880834bcc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880834bcc80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880834bcd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880834bcd80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================