[v6.1] WARNING: kmalloc bug in __v4l2_ctrl_modify_dimensions

3 views
Skip to first unread message

syzbot

unread,
Oct 27, 2024, 10:37:31 PM10/27/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7ec6f9fa3d97 Linux 6.1.114
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=128f1a87980000
kernel config: https://syzkaller.appspot.com/x/.config?x=c3430b5172170129
dashboard link: https://syzkaller.appspot.com/bug?extid=45079ede99a2f8bb29d2
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/85855dd3567d/disk-7ec6f9fa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2938cf086485/vmlinux-7ec6f9fa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/708aae50ad2d/bzImage-7ec6f9fa.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+45079e...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 0 PID: 4696 at mm/util.c:596 kvmalloc_node+0x171/0x180
Modules linked in:
CPU: 0 PID: 4696 Comm: syz.3.80 Not tainted 6.1.114-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:kvmalloc_node+0x171/0x180 mm/util.c:596
Code: 5d c3 44 89 fe 81 e6 00 20 00 00 31 ff e8 a7 22 c5 ff 41 81 e7 00 20 00 00 74 0a e8 39 1f c5 ff e9 3f ff ff ff e8 2f 1f c5 ff <0f> 0b e9 33 ff ff ff 0f 1f 84 00 00 00 00 00 41 56 53 49 89 f6 48
RSP: 0018:ffffc90006017950 EFLAGS: 00010287
RAX: ffffffff81c57431 RBX: 00000000852e7e00 RCX: 0000000000040000
RDX: ffffc900058d1000 RSI: 0000000000001064 RDI: 0000000000001065
RBP: 0000000000000000 R08: ffffffff81c57419 R09: 00000000ffffffff
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000852e7e00
R13: ffffc90006017a80 R14: 00000000ffffffff R15: 0000000000000000
FS: 00007ff8231f16c0(0000) GS:ffff8880b8e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc525e3ae0 CR3: 000000002f72a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvmalloc include/linux/slab.h:710 [inline]
kvzalloc include/linux/slab.h:718 [inline]
__v4l2_ctrl_modify_dimensions+0x437/0xb50 drivers/media/v4l2-core/v4l2-ctrls-api.c:999
v4l2_ctrl_modify_dimensions include/media/v4l2-ctrls.h:1005 [inline]
vivid_update_format_cap+0x148f/0x2230 drivers/media/test-drivers/vivid/vivid-vid-cap.c:480
vivid_vid_cap_s_dv_timings+0x528/0x1210 drivers/media/test-drivers/vivid/vivid-vid-cap.c:1760
__video_do_ioctl+0xa3a/0xe30 drivers/media/v4l2-core/v4l2-ioctl.c:3037
video_usercopy+0xa79/0x10c0 drivers/media/v4l2-core/v4l2-ioctl.c:3384
v4l2_ioctl+0x181/0x1d0 drivers/media/v4l2-core/v4l2-dev.c:364
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7ff82237e719
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff8231f1038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ff822535f80 RCX: 00007ff82237e719
RDX: 0000000020000040 RSI: 00000000c0845657 RDI: 0000000000000003
RBP: 00007ff8223f132e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007ff822535f80 R15: 00007ffdd56d38c8
</TASK>


---
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.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Oct 27, 2024, 10:57:24 PM10/27/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 7ec6f9fa3d97 Linux 6.1.114
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=177baebb980000
kernel config: https://syzkaller.appspot.com/x/.config?x=c3430b5172170129
dashboard link: https://syzkaller.appspot.com/bug?extid=45079ede99a2f8bb29d2
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=135f1a87980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10e8aca7980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/85855dd3567d/disk-7ec6f9fa.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2938cf086485/vmlinux-7ec6f9fa.xz
kernel image: https://storage.googleapis.com/syzbot-assets/708aae50ad2d/bzImage-7ec6f9fa.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+45079e...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 4244 at mm/util.c:596 kvmalloc_node+0x171/0x180
Modules linked in:
CPU: 1 PID: 4244 Comm: syz-executor336 Not tainted 6.1.114-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:kvmalloc_node+0x171/0x180 mm/util.c:596
Code: 5d c3 44 89 fe 81 e6 00 20 00 00 31 ff e8 a7 22 c5 ff 41 81 e7 00 20 00 00 74 0a e8 39 1f c5 ff e9 3f ff ff ff e8 2f 1f c5 ff <0f> 0b e9 33 ff ff ff 0f 1f 84 00 00 00 00 00 41 56 53 49 89 f6 48
RSP: 0018:ffffc900039cf950 EFLAGS: 00010293
RAX: ffffffff81c57431 RBX: 00000000852e7e00 RCX: ffff88802d813b80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff81c57419 R09: 00000000ffffffff
R10: 0000000000000000 R11: dffffc0000000001 R12: 00000000852e7e00
R13: ffffc900039cfa80 R14: 00000000ffffffff R15: 0000000000000000
FS: 000055558c24b380(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000000 CR3: 000000007b39b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvmalloc include/linux/slab.h:710 [inline]
kvzalloc include/linux/slab.h:718 [inline]
__v4l2_ctrl_modify_dimensions+0x437/0xb50 drivers/media/v4l2-core/v4l2-ctrls-api.c:999
v4l2_ctrl_modify_dimensions include/media/v4l2-ctrls.h:1005 [inline]
vivid_update_format_cap+0x148f/0x2230 drivers/media/test-drivers/vivid/vivid-vid-cap.c:480
vivid_vid_cap_s_dv_timings+0x528/0x1210 drivers/media/test-drivers/vivid/vivid-vid-cap.c:1760
__video_do_ioctl+0xa3a/0xe30 drivers/media/v4l2-core/v4l2-ioctl.c:3037
video_usercopy+0xa79/0x10c0 drivers/media/v4l2-core/v4l2-ioctl.c:3384
v4l2_ioctl+0x181/0x1d0 drivers/media/v4l2-core/v4l2-dev.c:364
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:870 [inline]
__se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7faa165dd229
Code: 48 83 c4 28 c3 e8 37 17 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdee7a7b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffdee7a7cf8 RCX: 00007faa165dd229
RDX: 0000000020000040 RSI: 00000000c0845657 RDI: 0000000000000003
RBP: 00007faa16650610 R08: 00007ffdee7a7cf8 R09: 00007ffdee7a7cf8
R10: 00236962762f7665 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffdee7a7ce8 R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Jan 20, 2025, 1:32:05 AM1/20/25
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 9f070b1862f3411b8bcdfd51a8eaad25286f9deb
git tree: upstream
Author: Hans Verkuil <hver...@xs4all.nl>
Date: Mon Oct 14 14:52:41 2024 +0000

media: v4l2-core: v4l2-dv-timings: check cvt/gtf result

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=135b4618580000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Jan 20, 2025, 3:14:04 AM1/20/25
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit 71f9c0f1e3414a17544b5a7fb4ef6e8702c9c21f
Author: <hver...@xs4all.nl>
Date: Mon Oct 14 14:52:41 2024 +0000

media: v4l2-core: v4l2-dv-timings: check cvt/gtf result

If you believe this is correct, please reply with
#syz fix: media: v4l2-core: v4l2-dv-timings: check cvt/gtf result

The commit was initially detected here:

commit 9f070b1862f3411b8bcdfd51a8eaad25286f9deb
git tree: upstream
Author: Hans Verkuil <hver...@xs4all.nl>
Date: Mon Oct 14 14:52:41 2024 +0000

media: v4l2-core: v4l2-dv-timings: check cvt/gtf result

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=135b4618580000
Reply all
Reply to author
Forward
0 new messages