================================================================== 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 ffff8880a1a8c460 by task syz-executor.3/1916 CPU: 1 PID: 1916 Comm: syz-executor.3 Not tainted 4.19.75 #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 selinux_nlmsg_perm: 251 callbacks suppressed SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 __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 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 vicodec_stop_streaming+0x158/0x1a0 drivers/media/platform/vicodec/vicodec-core.c:1166 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 __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 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 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 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 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:0x459a09 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:00007f3604c7bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000124 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 RAX: 0000000000000004 RBX: 0000000000000003 RCX: 0000000000459a09 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3604c7c6d4 R13: 00000000004c0072 R14: 00000000004d20d8 R15: 00000000ffffffff SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 Allocated by task 1916: 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 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1916: 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 ffff8880a1a8c440 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 32 bytes inside of 256-byte region [ffff8880a1a8c440, ffff8880a1a8c540) The buggy address belongs to the page: page:ffffea000286a300 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0x0 flags: 0x1fffc0000000100(slab) raw: 01fffc0000000100 ffffea00021aa748 ffffea0002317008 ffff88812c3f07c0 raw: 0000000000000000 ffff8880a1a8c080 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a1a8c300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a1a8c380: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc >ffff8880a1a8c400: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880a1a8c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a1a8c500: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== net_ratelimit: 12 callbacks suppressed protocol 88fb is buggy, dev hsr_slave_0 kobject: 'loop5' (000000000538d8da): kobject_uevent_env protocol 88fb is buggy, dev hsr_slave_1 kobject: 'loop5' (000000000538d8da): fill_kobj_path: path = '/devices/virtual/block/loop5' protocol 88fb is buggy, dev hsr_slave_0 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 protocol 88fb is buggy, dev hsr_slave_1 kobject: '…' (0000000042699ee3): fill_kobj_path: path = '/devices/virtual/net/…' protocol 88fb is buggy, dev hsr_slave_0 SELinux: unrecognized netlink message: protocol=4 nlmsg_type=0 sclass=netlink_tcpdiag_socket pig=1922 comm=syz-executor.0 protocol 88fb is buggy, dev hsr_slave_1 kobject: 'queues' (00000000063275c0): kobject_add_internal: parent: '…', set: ''