general protection fault in mct_u232_open

Status: upstream: reported C repro on 2026/11/06 07:35
Subsystems: usb
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+58b2d8b19cd6761a395b@syzkaller.appspotmail.com
First crash: 4d03h, last: 3h33m
✨ AI-generated root cause summary:

In mct_u232_open(), if submitting the read URB via usb_submit_urb(priv->read_urb, GFP_KERNEL) fails, the driver logs an error message referencing port->read_urb->pipe instead of priv->read_urb->pipe. Because the MCT U232 adapter uses interrupt-in endpoints instead of bulk-in endpoints, port->read_urb is never allocated or set up by the usb-serial core and remains NULL. Dereferencing port->read_urb->pipe in the error path results in a NULL-pointer dereference at offset 0x50 (the offset of the pipe field in struct urb), crashing the kernel with an oops.

▶ ▼ ✨ Full AI root cause analysis
Based on kernel commit 46fec1c3029b:

Technical Root Cause Analysis

Involved Components

  • File: drivers/usb/serial/mct_u232.c
  • Function: mct_u232_open()
  • Structs & Fields:
    • struct usb_serial_port: port->read_urb
    • struct mct_u232_private: priv->read_urb
    • struct urb: urb->pipe (located at offset 0x50 / byte 80)

Bug Mechanism

In the USB serial subsystem (drivers/usb/serial/usb-serial.c), port->read_urb is reserved for bulk-IN transfers and is only allocated and initialized by setup_port_bulk_in() when a port has bulk-IN endpoints.

The MCT U232 USB-to-RS232 adapter does not use bulk-IN endpoints for data transfer. Instead, it uses two interrupt-IN endpoints:

  1. port->interrupt_in_urb (used for modem/line status notifications)
  2. serial->port[1]->interrupt_in_urb (used for data reception)

During port initialization in mct_u232_port_probe(), the driver allocates its private context (struct mct_u232_private *priv) and assigns the second interrupt-IN URB to priv->read_urb:

priv->read_urb = serial->port[1]->interrupt_in_urb;
priv->read_urb->context = port;

Because no bulk-IN endpoints exist for the port, setup_port_bulk_in() is never called, leaving port->read_urb == NULL.

When opening the serial port in mct_u232_open(), the driver submits priv->read_urb:

retval = usb_submit_urb(priv->read_urb, GFP_KERNEL);
if (retval) {
    dev_err(&port->dev,
        "usb_submit_urb(read) failed pipe 0x%x err %d\n",
        port->read_urb->pipe, retval);
    goto error;
}

If usb_submit_urb(priv->read_urb, GFP_KERNEL) fails (e.g. if communication with the device fails or the device is disconnected), control enters the error block. When formatting the error log, the code mistakenly references port->read_urb->pipe instead of priv->read_urb->pipe.

Because port->read_urb is NULL, evaluating port->read_urb->pipe attempts to read 4 bytes at offset 0x50 (offset of pipe in struct urb). In KASAN-enabled kernels, checking the shadow memory for range [0x0000000000000050-0x0000000000000057] (address 0xdffffc000000000a) triggers a KASAN null-ptr-deref / general protection fault. In standard kernels, this triggers an immediate NULL pointer dereference page fault (unable to handle kernel paging request at 0000000000000050).

▶ ▼ ✨ AI Jobs (2)
ID Workflow Result Correct Bug Created Started Finished Revision
ef85d09b repro-c Reproduced: ✅ ❓ general protection fault in mct_u232_open 2026/11/05 22:13 2026/11/05 22:13 2026/11/05 23:58 5cecaf1f
4fd4e9c8 assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ FuzzingArtifact: ❌ MemoryCorruption: ❌ NetworkNeedsSetup: ❌ NetworkTrigger: ❌ PeripheralTrigger: ✅ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ general protection fault in mct_u232_open 2026/11/02 07:23 2026/11/02 07:24 2026/11/02 08:10 25a0ae84
▶ ▼ Discussions (4)
Title Replies (including bot) Last reply
[PATCH] USB: serial: mct_u232: fix NULL deref in open error path 3 (3) 2026/11/06 08:21
Re: [PATCH] USB: serial: mct_u232: fix NULL-deref on open() failure 1 (1) 2026/11/06 08:06
[PATCH] USB: serial: mct_u232: fix NULL-deref on open() failure 1 (1) 2026/11/06 08:01
[syzbot] [usb?] general protection fault in mct_u232_open 0 (1) 2026/11/06 07:35
▶ ▼ Last patch testing requests (1)
Created Duration User Patch Repo Result
2026/11/06 07:03 38m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d68ce4e71248e1ff5af9654b407541d9260b3ba5 report job log log
▶ ▼ Cause bisection attempts (1)
Created Duration User Patch Repo Result
2026/11/06 09:58 bisect git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git running

Sample crash report:
mct_u232 ttyUSB0: Set MODEM CTRL 0xb failed (error = -71)
mct_u232 ttyUSB0: Set LINE CTRL 0x3 failed (error = -71)
mct_u232 ttyUSB0: Get MODEM STATus failed (error = -19)
Oops: general protection fault, probably for non-canonical address 0xdffffc000000000a: 0000 [#1] SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057]
CPU: 0 UID: 0 PID: 5718 Comm: syz-executor711 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026
RIP: 0010:mct_u232_open+0x39c/0x680 drivers/usb/serial/mct_u232.c:460
Code: 8d 9e 20 04 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 62 c3 6e fa 48 8b 1b 48 83 c3 50 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 a7 01 00 00 8b 13 49 81 c6 40 05 00 00
RSP: 0018:ffffc90003b7f760 EFLAGS: 00010206
RAX: 000000000000000a RBX: 0000000000000050 RCX: ffff88802e889f40
RDX: 0000000000000000 RSI: 00000000ffffffed RDI: 0000000000000000
RBP: 00000000ffffffed R08: ffffffff91e120bf R09: 1ffffffff23c2417
R10: dffffc0000000000 R11: fffffbfff23c2418 R12: 1ffff11005c8bf50
R13: dffffc0000000000 R14: ffff888034df4000 R15: dffffc0000000000
FS:  0000555579e9e400(0000) GS:ffff888123159000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2cf0c571bc CR3: 0000000037ff2000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 serial_port_activate+0x151/0x250 drivers/usb/serial/usb-serial.c:268
 tty_port_open+0x1df/0x2d0 drivers/tty/tty_port.c:798
 tty_open+0x48a/0xd80 drivers/tty/tty_io.c:2112
 chrdev_open+0x4d9/0x600 fs/char_dev.c:413
 do_dentry_open+0x80e/0x1360 fs/open.c:1000
 vfs_open_consume+0x4a/0x350 fs/open.c:1131
 do_open fs/namei.c:4851 [inline]
 path_openat+0x16fc/0x20f0 fs/namei.c:5016
 do_file_open+0x23e/0x4a0 fs/namei.c:5045
 do_sys_openat2+0x115/0x200 fs/open.c:1443
 do_sys_open fs/open.c:1449 [inline]
 __do_sys_openat fs/open.c:1789 [inline]
 __se_sys_openat fs/open.c:1784 [inline]
 __x64_sys_openat+0x138/0x170 fs/open.c:1784
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x00007f2cf0bf0079
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:00007ffe3866ad58 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f2cf0bf0079
RDX: 0000000000000000 RSI: 0000200000000200 RDI: 00000000ffffff9c
RBP: 00000000000f4240 R08: 0000000000000009 R09: 0000000000000009
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000014f37
R13: 00007ffe3866ad6c R14: 00007ffe3866ad80 R15: 00007ffe3866ad70
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:mct_u232_open+0x39c/0x680 drivers/usb/serial/mct_u232.c:460
Code: 8d 9e 20 04 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 62 c3 6e fa 48 8b 1b 48 83 c3 50 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 a7 01 00 00 8b 13 49 81 c6 40 05 00 00
RSP: 0018:ffffc90003b7f760 EFLAGS: 00010206
RAX: 000000000000000a RBX: 0000000000000050 RCX: ffff88802e889f40
RDX: 0000000000000000 RSI: 00000000ffffffed RDI: 0000000000000000
RBP: 00000000ffffffed R08: ffffffff91e120bf R09: 1ffffffff23c2417
R10: dffffc0000000000 R11: fffffbfff23c2418 R12: 1ffff11005c8bf50
R13: dffffc0000000000 R14: ffff888034df4000 R15: dffffc0000000000
FS:  0000555579e9e400(0000) GS:ffff888123159000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2cf0c92680 CR3: 0000000037ff2000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	8d 9e 20 04 00 00    	lea    0x420(%rsi),%ebx
   6:	48 89 d8             	mov    %rbx,%rax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 62 c3 6e fa       	call   0xfa6ec37e
  1c:	48 8b 1b             	mov    (%rbx),%rbx
  1f:	48 83 c3 50          	add    $0x50,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 a7 01 00 00    	jne    0x1de
  37:	8b 13                	mov    (%rbx),%edx
  39:	49 81 c6 40 05 00 00 	add    $0x540,%r14

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/05 23:29 linux-next ddfe51b0a0f5 5cecaf1f .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce general protection fault in mct_u232_open
2026/11/06 07:41 git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git d68ce4e71248 5cecaf1f .config console log report C ci-upstream-kasan-gce-386 general protection fault in mct_u232_open
2026/11/02 07:23 upstream 46fec1c3029b 25a0ae84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 general protection fault in mct_u232_open
2026/11/05 20:34 linux-next ddfe51b0a0f5 5cecaf1f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce general protection fault in mct_u232_open
* Struck through repros no longer work on HEAD.