general protection fault in fsg_common_set_num_buffers

Status: upstream: reported C repro on 2026/09/08 13:05
Reported-by: syzbot+650aee9d4e6d1b23176c@syzkaller.appspotmail.com
First crash: 2d14h, last: 2d13h
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in fsg_common_set_num_buffers prio:low usb 10 syz, C 17 2d06h 24d 18/29 upstream: reported C repro on 2026/08/17 07:39
android-6-12 general protection fault in fsg_common_set_num_buffers 2 syz, C 4 2d13h 2d14h 0/1 premoderation: reported C repro on 2026/09/08 12:28
linux-6.1 BUG: unable to handle kernel paging request in fsg_common_set_num_buffers 8 syz, C 7 2d13h 2d14h 0/3 upstream: reported C repro on 2026/09/08 12:35

Sample crash report:
Mass Storage Function, version: 2009/09/11
LUN: removable file: (no medium)
general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]
CPU: 1 PID: 303 Comm: syz-executor126 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:fsg_common_set_num_buffers+0x65/0x2b0 drivers/usb/gadget/function/f_mass_storage.c:2664
Code: 89 c6 49 bd 00 00 00 00 00 fc ff df bf 00 40 00 00 be c0 0c 00 00 ba 02 00 00 00 e8 95 28 6e fe 48 89 c3 4c 89 f0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 f7 e8 1c 1d 7c fe 49 89 1e 48 85 db 0f
RSP: 0018:ffffc90000997b08 EFLAGS: 00010202

RAX: 0000000000000002 RBX: ffff8881251c4000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: ffffffff832d118b RDI: ffffed1024a39000
RBP: ffffc90000997b50 R08: 0000000000004000 R09: ffffed1024a39000
R10: dffffc0000000000 R11: fffff94000928e33 R12: ffff888123b48400
R13: dffffc0000000000 R14: 0000000000000010 R15: 0000000000000000
FS:  00005555716b13c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6e6595b008 CR3: 00000001097a7000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 fsg_opts_num_buffers_store+0x138/0x1c0 drivers/usb/gadget/function/f_mass_storage.c:3344
 flush_write_buffer fs/configfs/file.c:207 [inline]
 configfs_write_iter+0x312/0x400 fs/configfs/file.c:229
 call_write_iter include/linux/fs.h:2212 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x831/0xfd0 fs/read_write.c:594
 ksys_write+0x14a/0x260 fs/read_write.c:647
 __do_sys_write fs/read_write.c:659 [inline]
 __se_sys_write fs/read_write.c:656 [inline]
 __x64_sys_write+0x7b/0x90 fs/read_write.c:656
 x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f6e658beef9
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:00007ffe8c546458 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000200000000300 RCX: 00007f6e658beef9
RDX: 0000000000000012 RSI: 0000200000000300 RDI: 0000000000000003
RBP: 6769666e6f632f2e R08: 000000000000000f R09: 00007ffe8c546598
R10: 0000000000000001 R11: 0000000000000246 R12: 00007ffe8c546588
R13: 0000000000000002 R14: 0000200000000008 R15: 0000000000000002
 </TASK>
Modules linked in:
---[ end trace 5e29a1eef4fd0852 ]---
RIP: 0010:fsg_common_set_num_buffers+0x65/0x2b0 drivers/usb/gadget/function/f_mass_storage.c:2664
Code: 89 c6 49 bd 00 00 00 00 00 fc ff df bf 00 40 00 00 be c0 0c 00 00 ba 02 00 00 00 e8 95 28 6e fe 48 89 c3 4c 89 f0 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 f7 e8 1c 1d 7c fe 49 89 1e 48 85 db 0f
RSP: 0018:ffffc90000997b08 EFLAGS: 00010202
RAX: 0000000000000002 RBX: ffff8881251c4000 RCX: 0000000000000002
RDX: 0000000000000000 RSI: ffffffff832d118b RDI: ffffed1024a39000
RBP: ffffc90000997b50 R08: 0000000000004000 R09: ffffed1024a39000
R10: dffffc0000000000 R11: fffff94000928e33 R12: ffff888123b48400
R13: dffffc0000000000 R14: 0000000000000010 R15: 0000000000000000
FS:  00005555716b13c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6e6595b008 CR3: 00000001097a7000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	89 c6                	mov    %eax,%esi
   2:	49 bd 00 00 00 00 00 	movabs $0xdffffc0000000000,%r13
   9:	fc ff df
   c:	bf 00 40 00 00       	mov    $0x4000,%edi
  11:	be c0 0c 00 00       	mov    $0xcc0,%esi
  16:	ba 02 00 00 00       	mov    $0x2,%edx
  1b:	e8 95 28 6e fe       	call   0xfe6e28b5
  20:	48 89 c3             	mov    %rax,%rbx
  23:	4c 89 f0             	mov    %r14,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 f7             	mov    %r14,%rdi
  34:	e8 1c 1d 7c fe       	call   0xfe7c1d55
  39:	49 89 1e             	mov    %rbx,(%r14)
  3c:	48 85 db             	test   %rbx,%rbx
  3f:	0f                   	.byte 0xf

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/08 13:13 android13-5.15-lts e9b8a6529ffa 680aa3e1 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in fsg_common_set_num_buffers
2026/09/08 12:53 android13-5.15-lts e9b8a6529ffa 680aa3e1 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in fsg_common_set_num_buffers
2026/09/08 12:34 android13-5.15-lts e9b8a6529ffa 680aa3e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in fsg_common_set_num_buffers
2026/09/08 12:33 android13-5.15-lts e9b8a6529ffa 680aa3e1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 general protection fault in fsg_common_set_num_buffers
* Struck through repros no longer work on HEAD.