{"id":"CVE-2026-138819","aliases":["CVE-2026-138819"],"related":[],"kind":"vulnerability","state":"published","title":"serial: 8250_exar: store the GPIO platform device in struct exar8250","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nserial: 8250_exar: store the GPIO platform device in struct exar8250\n\nThe GPIO platform device is registered via platform->register_gpio()\nwhen port 0 is being set up. It is stored to port->port.private_data of\nthe on-stack uart template (and from there it is copied into every\nregistered port). pci_xr17v35x_exit() then fetches it back by\nserial8250_get_port(priv->line[0]).\n\nBut port 0 does not have to exist at that point. If\nserial8250_register_8250_port() fails for port 0, priv->line[0] holds a\nnegative error code. The probe still succeeds (it only breaks the loop),\nso on unbind, priv->line[0] (a negative value) is passed to\nserial8250_get_port(). The GPIO device is never unregistered and a\nbogus port is accessed.\n\nThe same problem would also occur after the planned conversion of\nserial8250_register_8250_port() to return a uart port instead of a\nline. As Sashiko pointed out in that case:\n  If board->setup() fails for the first port (i=0) in exar_pci_probe(),\n  priv->uport[0] remains NULL. If serial8250_register_8250_port() fails,\n  it returns an ERR_PTR. In either case, the loop breaks and probe\n  returns success. When the device is later unbound,\n  pci_xr17v35x_exit() unconditionally passes priv->uport[0] to\n  platform->unregister_gpio(), which will dereference it without\n  checking for validity.\n\nThe GPIO device belongs to the PCI device, not to any particular port.\nSo store it in a new struct exar8250::gpio member. Pass priv to both\n->register_gpio() and ->unregister_gpio(), so that pci_xr17v35x_exit()\ndoes not need to look up any port at all.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nserial: 8250_exar: store the GPIO platform device in struct exar8250\n\nThe GPIO platform device is registered via platform->register_gpio()\nwhen port 0 is being set up. It is stored to port->port.private_data of\nthe on-stack uart template (and from there it is copied into every\nregistered port). pci_xr17v35x_exit() then fetches it back by\nserial8250_get_port(priv->line[0]).\n\nBut port 0 does not have to exist at that point. If\nserial8250_register_8250_port() fails for port 0, priv->line[0] holds a\nnegative error code. The probe still succeeds (it only breaks the loop),\nso on unbind, priv->line[0] (a negative value) is passed to\nserial8250_get_port(). The GPIO device is never unregistered and a\nbogus port is accessed.\n\nThe same problem would also occur after the planned conversion of\nserial8250_register_8250_port() to return a uart port instead of a\nline. As Sashiko pointed out in that case:\n  If board->setup() fails for the first port (i=0) in exar_pci_probe(),\n  priv->uport[0] remains NULL. If serial8250_register_8250_port() fails,\n  it returns an ERR_PTR. In either case, the loop breaks and probe\n  returns success. When the device is later unbound,\n  pci_xr17v35x_exit() unconditionally passes priv->uport[0] to\n  platform->unregister_gpio(), which will dereference it without\n  checking for validity.\n\nThe GPIO device belongs to the PCI device, not to any particular port.\nSo store it in a new struct exar8250::gpio member. Pass priv to both\n->register_gpio() and ->unregister_gpio(), so that pci_xr17v35x_exit()\ndoes not need to look up any port at all.","source":"cvelist"}],"published":"2026-11-30T13:25:16.809Z","modified":"2026-11-30T14:17:35.870Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"3a59d55604f47c48f069225a8bebedcb2b2a20d8","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"72990547fea5a865a5fb17480151826e9554d650","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"68825efacafc23872eb346b0c9caaae9f23e4669","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"9eb168ad47c80910016a0d0c14eba30de0647cf4","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"c16555815d4b7aae2b2b2aa2ea320c714d0fee6d","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"55265c0f41ebe877b00b09a3d0cda796e6737e03","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"3279fe10b300a97eac23a192088491b6a99cdbd1","status":"affected"},{"type":"git","introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2","fixed":"33d337816e00994daaf670243186d9e537ee090d","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.11","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.11","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/3a59d55604f47c48f069225a8bebedcb2b2a20d8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/72990547fea5a865a5fb17480151826e9554d650","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/68825efacafc23872eb346b0c9caaae9f23e4669","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9eb168ad47c80910016a0d0c14eba30de0647cf4","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c16555815d4b7aae2b2b2aa2ea320c714d0fee6d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55265c0f41ebe877b00b09a3d0cda796e6737e03","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3279fe10b300a97eac23a192088491b6a99cdbd1","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/33d337816e00994daaf670243186d9e537ee090d","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138819","url":"https://www.cve.org/CVERecord?id=CVE-2026-138819","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:16.809Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138819","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138819","licence":"Public domain","modified":"2026-11-30T14:17:35.870Z"}],"updatedAt":"2026-11-30T14:32:32.534Z","epss":{"score":0.0022,"percentile":0.13415,"date":"2026-12-01T12:00:22.000Z"}}