WARNING in raw_alloc_io_data
Subsystems (3)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: dcb6fa37fd7b Linux 6.18-rc3 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=160597e2580000 kernel config: https://syzkaller.appspot.com/x/.config?x=609c87dcb0628493 dashboard link: https://syzkaller.appspot.com/bug?extid=a894fe5447d0543e89c9 compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11af27e2580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c2d614580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-dcb6fa37.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/61176fd888a1/vmlinux-dcb6fa37.xz
kernel image: https://storage.googleapis.com/syzbot-assets/84e7e9924c22/bzImage-dcb6fa37.xz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
------------[ cut here ]------------ WARNING: CPU: 3 PID: 6091 at mm/page_alloc.c:5159 __alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Modules linked in: CPU: 3 UID: 0 PID: 6091 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:__alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Code: f0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 83 fe 0a 0f 86 0c fe ff ff 80 3d d4 63 52 0e 00 75 0b c6 05 cb 63 52 0e 01 90 <0f> 0b 90 45 31 f6 eb 81 4d 85 f6 74 22 44 89 fa 89 ee 4c 89 f7 e8 RSP: 0018:ffffc9000371f9f8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000014 RDI: 0000000000040cc0 RBP: 0000000000000014 R08: 0000000000000005 R09: 0000000000000009 R10: 0000000000000014 R11: 0000000000000001 R12: 0000000000040cc0 R13: 1ffff920006e3f55 R14: ffffffff9ab2c464 R15: 0000000000000014 FS: 000055557bf92500(0000) GS:ffff8880d6d0a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f84d9710300 CR3: 0000000032452000 CR4: 0000000000352ef0 Call Trace: <TASK> alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 ___kmalloc_large_node+0xed/0x160 mm/slub.c:5583 __kmalloc_large_node_noprof+0x1c/0x70 mm/slub.c:5614 __do_kmalloc_node mm/slub.c:5630 [inline] __kmalloc_noprof.cold+0xc/0x62 mm/slub.c:5654 kmalloc_noprof include/linux/slab.h:961 [inline] raw_alloc_io_data drivers/usb/gadget/legacy/raw_gadget.c:673 [inline] raw_alloc_io_data+0x12c/0x1a0 drivers/usb/gadget/legacy/raw_gadget.c:659 raw_ioctl_ep0_read drivers/usb/gadget/legacy/raw_gadget.c:776 [inline] raw_ioctl+0x1397/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f84d938efc9 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:00007ffe768729f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f84d95e5fa0 RCX: 00007f84d938efc9 RDX: 0000200000000080 RSI: 00000000c0085504 RDI: 0000000000000006 RBP: 00007f84d9411f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f84d95e5fa0 R14: 00007f84d95e5fa0 R15: 0000000000000003 </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 [email protected].
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 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.
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
Quoted 86 lines · syzbot
Hello,
syzbot found the following issue on:
HEAD commit: dcb6fa37fd7b Linux 6.18-rc3 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=160597e2580000 kernel config: https://syzkaller.appspot.com/x/.config?x=609c87dcb0628493 dashboard link: https://syzkaller.appspot.com/bug?extid=a894fe5447d0543e89c9 compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11af27e2580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c2d614580000Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-dcb6fa37.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/61176fd888a1/vmlinux-dcb6fa37.xz
kernel image: https://storage.googleapis.com/syzbot-assets/84e7e9924c22/bzImage-dcb6fa37.xzIMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by [email protected]------------[ cut here ]------------ WARNING: CPU: 3 PID: 6091 at mm/page_alloc.c:5159 __alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Modules linked in: CPU: 3 UID: 0 PID: 6091 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:__alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Code: f0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 83 fe 0a 0f 86 0c fe ff ff 80 3d d4 63 52 0e 00 75 0b c6 05 cb 63 52 0e 01 90 <0f> 0b 90 45 31 f6 eb 81 4d 85 f6 74 22 44 89 fa 89 ee 4c 89 f7 e8 RSP: 0018:ffffc9000371f9f8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000014 RDI: 0000000000040cc0 RBP: 0000000000000014 R08: 0000000000000005 R09: 0000000000000009 R10: 0000000000000014 R11: 0000000000000001 R12: 0000000000040cc0 R13: 1ffff920006e3f55 R14: ffffffff9ab2c464 R15: 0000000000000014 FS: 000055557bf92500(0000) GS:ffff8880d6d0a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f84d9710300 CR3: 0000000032452000 CR4: 0000000000352ef0 Call Trace: <TASK> alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 ___kmalloc_large_node+0xed/0x160 mm/slub.c:5583 __kmalloc_large_node_noprof+0x1c/0x70 mm/slub.c:5614 __do_kmalloc_node mm/slub.c:5630 [inline] __kmalloc_noprof.cold+0xc/0x62 mm/slub.c:5654 kmalloc_noprof include/linux/slab.h:961 [inline] raw_alloc_io_data drivers/usb/gadget/legacy/raw_gadget.c:673 [inline] raw_alloc_io_data+0x12c/0x1a0 drivers/usb/gadget/legacy/raw_gadget.c:659 raw_ioctl_ep0_read drivers/usb/gadget/legacy/raw_gadget.c:776 [inline] raw_ioctl+0x1397/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f84d938efc9 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:00007ffe768729f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f84d95e5fa0 RCX: 00007f84d938efc9 RDX: 0000200000000080 RSI: 00000000c0085504 RDI: 0000000000000006 RBP: 00007f84d9411f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f84d95e5fa0 R14: 00007f84d95e5fa0 R15: 0000000000000003 </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 [email protected].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-titleIf you want syzbot to run the reproducer, reply with:
#syz test:git://repo/address.gitbranch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.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)
Quoted 5 lines
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-reportIf you want to undo deduplication, reply with:
#syz undup
#syz test
From ec93e88de10f0c0b02645e9caedad75323cf767c Mon Sep 17 00:00:00 2001
From: Gopi Krishna Menon <[email protected]>
Date: Sat, 25 Oct 2025 20:48:56 +0530
Subject: [PATCH] usb: raw_gadget: validate io length in raw_alloc_io_data()
Not checking the urb buffer length can allow very large allocations which cannot be handled by the allocators and can result in warning by the allocators. Therefore for sizes larger than KMALLOC_MAX_SIZE we return -EINVAL.
For testing
--- drivers/usb/gadget/legacy/raw_gadget.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/legacy/raw_gadget.c +2 -0
@@ -667,6 +667,8 @@ static void *raw_alloc_io_data(struct usb_raw_ep_io *io, void __user *ptr,return ERR_PTR (-EINVAL );if (!usb_raw_io_flags_valid (io->flags))return ERR_PTR (-EINVAL ); +if (io->length >KMALLOC_MAX_SIZE ) +return ERR_PTR (-EINVAL );if (get_from_user) data =memdup_user (ptr +sizeof (*io), io->length);else {
Signature · 1 line
2.43.0
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Tested on:
commit: fd575722 Merge tag 'sched_ext-for-6.18-rc3-fixes' of g.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=1077d614580000 kernel config: https://syzkaller.appspot.com/x/.config?x=609c87dcb0628493 dashboard link: https://syzkaller.appspot.com/bug?extid=a894fe5447d0543e89c9 compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=127b9e7c580000
Note: testing is done by a robot and is best-effort only.
Quoted 86 lines · syzbot
Hello,
syzbot found the following issue on:
HEAD commit: dcb6fa37fd7b Linux 6.18-rc3 git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=160597e2580000 kernel config: https://syzkaller.appspot.com/x/.config?x=609c87dcb0628493 dashboard link: https://syzkaller.appspot.com/bug?extid=a894fe5447d0543e89c9 compiler: gcc (Debian 12.2.0-14+deb12u1) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11af27e2580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11c2d614580000Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-dcb6fa37.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/61176fd888a1/vmlinux-dcb6fa37.xz
kernel image: https://storage.googleapis.com/syzbot-assets/84e7e9924c22/bzImage-dcb6fa37.xzIMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by [email protected]------------[ cut here ]------------ WARNING: CPU: 3 PID: 6091 at mm/page_alloc.c:5159 __alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Modules linked in: CPU: 3 UID: 0 PID: 6091 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 RIP: 0010:__alloc_frozen_pages_noprof+0x309/0x2470 mm/page_alloc.c:5159 Code: f0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 83 fe 0a 0f 86 0c fe ff ff 80 3d d4 63 52 0e 00 75 0b c6 05 cb 63 52 0e 01 90 <0f> 0b 90 45 31 f6 eb 81 4d 85 f6 74 22 44 89 fa 89 ee 4c 89 f7 e8 RSP: 0018:ffffc9000371f9f8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000014 RDI: 0000000000040cc0 RBP: 0000000000000014 R08: 0000000000000005 R09: 0000000000000009 R10: 0000000000000014 R11: 0000000000000001 R12: 0000000000040cc0 R13: 1ffff920006e3f55 R14: ffffffff9ab2c464 R15: 0000000000000014 FS: 000055557bf92500(0000) GS:ffff8880d6d0a000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f84d9710300 CR3: 0000000032452000 CR4: 0000000000352ef0 Call Trace: <TASK> alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 ___kmalloc_large_node+0xed/0x160 mm/slub.c:5583 __kmalloc_large_node_noprof+0x1c/0x70 mm/slub.c:5614 __do_kmalloc_node mm/slub.c:5630 [inline] __kmalloc_noprof.cold+0xc/0x62 mm/slub.c:5654 kmalloc_noprof include/linux/slab.h:961 [inline] raw_alloc_io_data drivers/usb/gadget/legacy/raw_gadget.c:673 [inline] raw_alloc_io_data+0x12c/0x1a0 drivers/usb/gadget/legacy/raw_gadget.c:659 raw_ioctl_ep0_read drivers/usb/gadget/legacy/raw_gadget.c:776 [inline] raw_ioctl+0x1397/0x2c30 drivers/usb/gadget/legacy/raw_gadget.c:1313 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f84d938efc9 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:00007ffe768729f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f84d95e5fa0 RCX: 00007f84d938efc9 RDX: 0000200000000080 RSI: 00000000c0085504 RDI: 0000000000000006 RBP: 00007f84d9411f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f84d95e5fa0 R14: 00007f84d95e5fa0 R15: 0000000000000003 </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 [email protected].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-titleIf you want syzbot to run the reproducer, reply with:
#syz test:git://repo/address.gitbranch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.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)
Quoted 5 lines
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-reportIf you want to undo deduplication, reply with:
#syz undup
#syz dup: [syzbot] [mm?] WARNING in raw_ioctl