{"id":"CVE-2026-142985","sourceIdentifier":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","published":"2026-12-03T10:17:22.790","lastModified":"2026-12-03T10:17:22.790","vulnStatus":"Received","cveTags":[],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nusb: gadget: u_serial: fix NULL deref in gs_close() after failed open\n\ngs_close() opens with\n\n\tstruct gs_port *port = tty->driver_data;\n\t...\n\tspin_lock_irq(&port->port_lock);\n\nand never checks port.  gs_open() assigns tty->driver_data only on the\nport.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL,\nand tty_open() calls tty_release(), and hence ->close(), when ->open()\nfails.\n\nsyzbot hit exactly this on arm64.  Fault injection failed the kfifo_alloc()\nof the write buffer in gs_open():\n\n   __kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44\n   gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636\n   tty_open+0x404/0x89c drivers/tty/tty_io.c:2137\n\nand the tty core's close of the failed open then took port_lock through\nthe NULL port:\n\n  BUG: unable to handle kernel paging request in gs_close\n  KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7]\n  Call trace:\n   spin_lock_irq include/linux/spinlock.h:372 [inline]\n   gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698\n   tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745\n   tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146\n\nReturn early instead.  There is nothing to release when the open never got\nfar enough to claim the port.\n\nUnlike the check reverted by commit f6c7bc4a6823 (\"Revert \"usb: gadget:\nu_serial: Add null pointer check in gs_start_io\"\"), this is not hiding a\nrace: the tty core calls ->close() for an ->open() that failed by design,\nso driver_data is legitimately unset on that path."}],"affected":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","affectedData":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","programFiles":["drivers/usb/gadget/function/u_serial.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"ece1756e054ffcb38a8aab7d0ab7d0e02e65dd99","versionType":"git","status":"affected"},{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"ce8c7b4b562aa7c3847145dc2e3a2d0953a054b2","versionType":"git","status":"affected"},{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"63b69946c0de838af7324a504766fa13ad947d3d","versionType":"git","status":"affected"},{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"ea6e4e3a7c8453674337c7773cf3b101f328c876","versionType":"git","status":"affected"},{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"d010585071193e268c4152df2b3281255280529b","versionType":"git","status":"affected"},{"version":"c1dca562be8ada614ef193aa246c6f8705bcd6b9","lessThan":"ea6cf69ad03c8d85138830c0d2c3b946b5ae231d","versionType":"git","status":"affected"}]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","programFiles":["drivers/usb/gadget/function/u_serial.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","versions":[{"version":"2.6.27","status":"affected"},{"version":"0","lessThan":"2.6.27","versionType":"semver","status":"unaffected"},{"version":"5.10.276","lessThanOrEqual":"5.10.*","versionType":"semver","status":"unaffected"},{"version":"5.15.227","lessThanOrEqual":"5.15.*","versionType":"semver","status":"unaffected"},{"version":"6.12.120","lessThanOrEqual":"6.12.*","versionType":"semver","status":"unaffected"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","versionType":"semver","status":"unaffected"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","versionType":"semver","status":"unaffected"},{"version":"7.4-rc4","lessThanOrEqual":"*","versionType":"original_commit_for_fix","status":"unaffected"}]}]}],"metrics":{},"references":[{"url":"https://git.kernel.org/stable/c/63b69946c0de838af7324a504766fa13ad947d3d","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/ce8c7b4b562aa7c3847145dc2e3a2d0953a054b2","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/d010585071193e268c4152df2b3281255280529b","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/ea6cf69ad03c8d85138830c0d2c3b946b5ae231d","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/ea6e4e3a7c8453674337c7773cf3b101f328c876","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/ece1756e054ffcb38a8aab7d0ab7d0e02e65dd99","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}]}