Hello,
syzbot found the following issue on:
HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output:
https://syzkaller.appspot.com/x/log.txt?x=118cd2d9880000
kernel config:
https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link:
https://syzkaller.appspot.com/bug?extid=e7e6a21455f64ea20024
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
Unfortunately, I don't have any reproducer for this issue yet.
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+e7e6a2...@syzkaller.appspotmail.com
netlink: 12 bytes leftover after parsing attributes in process `syz-executor.1'.
==================================================================
BUG: KASAN: use-after-free in v4l2_m2m_try_schedule drivers/media/v4l2-core/v4l2-mem2mem.c:361 [inline]
BUG: KASAN: use-after-free in v4l2_m2m_job_finish+0x33f/0x350 drivers/media/v4l2-core/v4l2-mem2mem.c:427
Read of size 8 at addr ffff88809b20e4c8 by task kworker/1:0/19
CPU: 1 PID: 19 Comm: kworker/1:0 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Workqueue: events device_work
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
kasan_report mm/kasan/report.c:412 [inline]
__asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
v4l2_m2m_try_schedule drivers/media/v4l2-core/v4l2-mem2mem.c:361 [inline]
v4l2_m2m_job_finish+0x33f/0x350 drivers/media/v4l2-core/v4l2-mem2mem.c:427
device_work+0x28b/0x350 drivers/media/platform/vim2m.c:417
process_one_work+0x864/0x1570 kernel/workqueue.c:2153
worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
kthread+0x33f/0x460 kernel/kthread.c:259
ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415
Allocated by task 13245:
kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
kmalloc include/linux/slab.h:515 [inline]
kzalloc include/linux/slab.h:709 [inline]
v4l2_m2m_ctx_init+0x49/0x380 drivers/media/v4l2-core/v4l2-mem2mem.c:885
vim2m_open+0x445/0x620 drivers/media/platform/vim2m.c:928
v4l2_open+0x1af/0x350 drivers/media/v4l2-core/v4l2-dev.c:427
chrdev_open+0x266/0x770 fs/char_dev.c:423
do_dentry_open+0x4aa/0x1160 fs/open.c:796
do_last fs/namei.c:3421 [inline]
path_openat+0x793/0x2df0 fs/namei.c:3537
do_filp_open+0x18c/0x3f0 fs/namei.c:3567
do_sys_open+0x3b3/0x520 fs/open.c:1085
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 13245:
__cache_free mm/slab.c:3503 [inline]
kfree+0xcc/0x210 mm/slab.c:3822
vim2m_release+0xe0/0x140 drivers/media/platform/vim2m.c:961
v4l2_release+0xf4/0x190 drivers/media/v4l2-core/v4l2-dev.c:448
__fput+0x2ce/0x890 fs/file_table.c:278
task_work_run+0x148/0x1c0 kernel/task_work.c:113
get_signal+0x1b64/0x1f70 kernel/signal.c:2400
do_signal+0x8f/0x1670 arch/x86/kernel/signal.c:799
exit_to_usermode_loop+0x204/0x2a0 arch/x86/entry/common.c:163
prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
entry_SYSCALL_64_after_hwframe+0x49/0xbe
The buggy address belongs to the object at ffff88809b20e4c0
which belongs to the cache kmalloc-2048 of size 2048
The buggy address is located 8 bytes inside of
2048-byte region [ffff88809b20e4c0, ffff88809b20ecc0)
The buggy address belongs to the page:
page:ffffea00026c8380 count:1 mapcount:0 mapping:ffff88813bff0c40 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea00027f8988 ffffea00027b8508 ffff88813bff0c40
raw: 0000000000000000 ffff88809b20e4c0 0000000100000003 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88809b20e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88809b20e400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88809b20e480: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff88809b20e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88809b20e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
---
This report is generated by a bot. It may contain errors.
See
https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at
syzk...@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.