general protection fault in fsg_common_set_num_buffers

Status: upstream: reported C repro on 2026/08/17 07:39
Subsystems: usb
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+791be35f1fbcc85d06d7@syzkaller.appspotmail.com
First crash: 20d, last: 7h02m
✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision
46fa5a32 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ general protection fault in fsg_common_set_num_buffers 2026/08/09 11:28 2026/08/09 11:28 2026/08/09 12:12 5d63f80b
876f51da assessment-security 💥 general protection fault in fsg_common_set_num_buffers 2026/08/04 01:04 2026/08/04 01:04 2026/08/04 01:04 cb1adeae
6fc2a5eb assessment-security 💥 general protection fault in fsg_common_set_num_buffers 2026/08/02 01:21 2026/08/02 01:21 2026/08/02 01:21 e611ffe1
Discussions (5)
Title Replies (including bot) Last reply
[PATCH v2] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers() 2 (2) 2026/08/18 15:59
[PATCH] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers() 6 (6) 2026/08/17 16:49
Re: [PATCH] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers() 2 (2) 2026/08/17 13:15
Re: [PATCH] usb: gadget: f_mass_storage: fix null pointer dereference in fsg_common_set_num_buffers() 1 (1) 2026/08/17 11:10
[syzbot] [usb?] general protection fault in fsg_common_set_num_buffers 0 (2) 2026/08/17 08:07

Sample crash report:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN NOPTI
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 UID: 0 PID: 5606 Comm: syz-executor407 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
RIP: 0010:fsg_common_set_num_buffers+0xad/0x340 drivers/usb/gadget/function/f_mass_storage.c:2763
Code: 42 80 3c 30 00 0f 85 52 02 00 00 48 89 6d e0 e8 99 48 2c fa be c0 0c 00 00 bf 00 40 00 00 e8 ca 6c 90 fa 48 89 ea 48 c1 ea 03 <42> 80 3c 32 00 0f 85 04 02 00 00 48 89 45 00 48 85 c0 75 95 e8 6a
RSP: 0018:ffffc9000333fbc0 EFLAGS: 00010202
RAX: ffff88807ec24000 RBX: 0000000000000000 RCX: 0000000000004000
RDX: 0000000000000002 RSI: ffffffff8c600300 RDI: ffffffff8e674928
RBP: 0000000000000010 R08: 0000000000000cc0 R09: 00000000ffffffff
R10: ffffed100fd85000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000010 R14: dffffc0000000000 R15: ffff88807c0b4000
FS:  000055556964e400(0000) GS:ffff888123cde000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056020ff0f000 CR3: 00000000772e6000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 fsg_opts_num_buffers_store+0x168/0x1b0 drivers/usb/gadget/function/f_mass_storage.c:3452
 flush_write_buffer fs/configfs/file.c:207 [inline]
 configfs_write_iter+0x302/0x4e0 fs/configfs/file.c:229
 new_sync_write fs/read_write.c:595 [inline]
 vfs_write+0x6ac/0x1050 fs/read_write.c:687
 ksys_write+0x12a/0x250 fs/read_write.c:739
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fb82a557cb9
Code: c0 79 93 eb d5 48 8d 7c 1d 00 eb 99 0f 1f 44 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 d8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc1e17d488 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007fb82a557cb9
RDX: 0000000000000002 RSI: 0000200000000000 RDI: 0000000000000003
RBP: 6769666e6f632f2e R08: 0000000000000000 R09: 00007ffc1e17d5c8
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffc1e17d5b8
R13: 0000000000000002 R14: 0000200000000008 R15: 0000000000000002
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:fsg_common_set_num_buffers+0xad/0x340 drivers/usb/gadget/function/f_mass_storage.c:2763
Code: 42 80 3c 30 00 0f 85 52 02 00 00 48 89 6d e0 e8 99 48 2c fa be c0 0c 00 00 bf 00 40 00 00 e8 ca 6c 90 fa 48 89 ea 48 c1 ea 03 <42> 80 3c 32 00 0f 85 04 02 00 00 48 89 45 00 48 85 c0 75 95 e8 6a
RSP: 0018:ffffc9000333fbc0 EFLAGS: 00010202
RAX: ffff88807ec24000 RBX: 0000000000000000 RCX: 0000000000004000
RDX: 0000000000000002 RSI: ffffffff8c600300 RDI: ffffffff8e674928
RBP: 0000000000000010 R08: 0000000000000cc0 R09: 00000000ffffffff
R10: ffffed100fd85000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000010 R14: dffffc0000000000 R15: ffff88807c0b4000
FS:  000055556964e400(0000) GS:ffff888123cde000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000056020ff0f000 CR3: 00000000772e6000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	42 80 3c 30 00       	cmpb   $0x0,(%rax,%r14,1)
   5:	0f 85 52 02 00 00    	jne    0x25d
   b:	48 89 6d e0          	mov    %rbp,-0x20(%rbp)
   f:	e8 99 48 2c fa       	call   0xfa2c48ad
  14:	be c0 0c 00 00       	mov    $0xcc0,%esi
  19:	bf 00 40 00 00       	mov    $0x4000,%edi
  1e:	e8 ca 6c 90 fa       	call   0xfa906ced
  23:	48 89 ea             	mov    %rbp,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	42 80 3c 32 00       	cmpb   $0x0,(%rdx,%r14,1) <-- trapping instruction
  2f:	0f 85 04 02 00 00    	jne    0x239
  35:	48 89 45 00          	mov    %rax,0x0(%rbp)
  39:	48 85 c0             	test   %rax,%rax
  3c:	75 95                	jne    0xffffffd3
  3e:	e8                   	.byte 0xe8
  3f:	6a                   	.byte 0x6a

Crashes (11):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/08/17 08:07 upstream dcb68831eac7 746171ee .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in fsg_common_set_num_buffers
2026/08/17 10:12 upstream 8d3ae59288f1 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in fsg_common_set_num_buffers
2026/08/17 07:39 upstream dcb68831eac7 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in fsg_common_set_num_buffers
2026/08/17 07:35 upstream dcb68831eac7 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in fsg_common_set_num_buffers
2026/08/07 17:31 upstream f9a2394a2348 e4ef95d6 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in fsg_common_set_num_buffers
2026/08/09 00:19 upstream a59f57e2aa12 5d63f80b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in fsg_common_set_num_buffers
2026/07/31 07:39 upstream 3708dd948844 aaffb173 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 general protection fault in fsg_common_set_num_buffers
2026/08/17 09:32 linux-next 4477a78374a5 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in fsg_common_set_num_buffers
2026/08/17 09:27 linux-next 4477a78374a5 746171ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in fsg_common_set_num_buffers
2026/08/20 15:58 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next 8da45c93dfa9 1e72964b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 BUG: unable to handle kernel paging request in fsg_common_set_num_buffers
2026/08/20 15:43 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next 8da45c93dfa9 1e72964b .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 BUG: unable to handle kernel paging request in fsg_common_set_num_buffers
* Struck through repros no longer work on HEAD.