GHSA-646R-XG96-XJ9X

Vulnerability from github – Published: 2026-12-03 12:31 – Updated: 2026-12-03 12:31
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

usb: gadget: u_serial: fix NULL deref in gs_close() after failed open

gs_close() opens with

struct gs_port *port = tty->driver_data;
...
spin_lock_irq(&port->port_lock);

and never checks port. gs_open() assigns tty->driver_data only on the port.count 0 -> 1 edge, so any failure earlier in gs_open() leaves it NULL, and tty_open() calls tty_release(), and hence ->close(), when ->open() fails.

syzbot hit exactly this on arm64. Fault injection failed the kfifo_alloc() of the write buffer in gs_open():

__kfifo_alloc_node+0x10c/0x208 lib/kfifo.c:44 gs_open+0x144/0x514 drivers/usb/gadget/function/u_serial.c:636 tty_open+0x404/0x89c drivers/tty/tty_io.c:2137

and the tty core's close of the failed open then took port_lock through the NULL port:

BUG: unable to handle kernel paging request in gs_close KASAN: null-ptr-deref in range [0x00000000000003a0-0x00000000000003a7] Call trace: spin_lock_irq include/linux/spinlock.h:372 [inline] gs_close+0xac/0x65c drivers/usb/gadget/function/u_serial.c:698 tty_release+0x2c4/0xffc drivers/tty/tty_io.c:1745 tty_open+0x46c/0x89c drivers/tty/tty_io.c:2146

Return early instead. There is nothing to release when the open never got far enough to claim the port.

Unlike the check reverted by commit f6c7bc4a6823 ("Revert "usb: gadget: u_serial: Add null pointer check in gs_start_io""), this is not hiding a race: the tty core calls ->close() for an ->open() that failed by design, so driver_data is legitimately unset on that path.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-142985"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-12-03T10:17:22Z",
    "severity": null
  },
  "details": "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-\u003edriver_data;\n\t...\n\tspin_lock_irq(\u0026port-\u003eport_lock);\n\nand never checks port.  gs_open() assigns tty-\u003edriver_data only on the\nport.count 0 -\u003e 1 edge, so any failure earlier in gs_open() leaves it NULL,\nand tty_open() calls tty_release(), and hence -\u003eclose(), when -\u003eopen()\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\u0027s 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 -\u003eclose() for an -\u003eopen() that failed by design,\nso driver_data is legitimately unset on that path.",
  "id": "GHSA-646r-xg96-xj9x",
  "modified": "2026-12-03T12:31:01Z",
  "published": "2026-12-03T12:31:01Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-142985"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/63b69946c0de838af7324a504766fa13ad947d3d"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ce8c7b4b562aa7c3847145dc2e3a2d0953a054b2"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/d010585071193e268c4152df2b3281255280529b"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ea6cf69ad03c8d85138830c0d2c3b946b5ae231d"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ea6e4e3a7c8453674337c7773cf3b101f328c876"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ece1756e054ffcb38a8aab7d0ab7d0e02e65dd99"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.