{"id":"CVE-2026-138819","summary":"serial: 8250_exar: store the GPIO platform device in struct exar8250","details":"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-\u003eregister_gpio()\nwhen port 0 is being set up. It is stored to port-\u003eport.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-\u003eline[0]).\n\nBut port 0 does not have to exist at that point. If\nserial8250_register_8250_port() fails for port 0, priv-\u003eline[0] holds a\nnegative error code. The probe still succeeds (it only breaks the loop),\nso on unbind, priv-\u003eline[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-\u003esetup() fails for the first port (i=0) in exar_pci_probe(),\n  priv-\u003euport[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-\u003euport[0] to\n  platform-\u003eunregister_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-\u003eregister_gpio() and -\u003eunregister_gpio(), so that pci_xr17v35x_exit()\ndoes not need to look up any port at all.","modified":"2026-11-30T15:01:08.547710344Z","published":"2026-11-30T13:25:16.809Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138819.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3279fe10b300a97eac23a192088491b6a99cdbd1"},{"type":"WEB","url":"https://git.kernel.org/stable/c/33d337816e00994daaf670243186d9e537ee090d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3a59d55604f47c48f069225a8bebedcb2b2a20d8"},{"type":"WEB","url":"https://git.kernel.org/stable/c/55265c0f41ebe877b00b09a3d0cda796e6737e03"},{"type":"WEB","url":"https://git.kernel.org/stable/c/68825efacafc23872eb346b0c9caaae9f23e4669"},{"type":"WEB","url":"https://git.kernel.org/stable/c/72990547fea5a865a5fb17480151826e9554d650"},{"type":"WEB","url":"https://git.kernel.org/stable/c/9eb168ad47c80910016a0d0c14eba30de0647cf4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c16555815d4b7aae2b2b2aa2ea320c714d0fee6d"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138819.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138819"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"d0aeaa83f0b0f7a92615bbdd6b1f96812f7dcfd2"},{"fixed":"3a59d55604f47c48f069225a8bebedcb2b2a20d8"},{"fixed":"72990547fea5a865a5fb17480151826e9554d650"},{"fixed":"68825efacafc23872eb346b0c9caaae9f23e4669"},{"fixed":"9eb168ad47c80910016a0d0c14eba30de0647cf4"},{"fixed":"c16555815d4b7aae2b2b2aa2ea320c714d0fee6d"},{"fixed":"55265c0f41ebe877b00b09a3d0cda796e6737e03"},{"fixed":"3279fe10b300a97eac23a192088491b6a99cdbd1"},{"fixed":"33d337816e00994daaf670243186d9e537ee090d"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138819.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.11.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138819.json"}}],"schema_version":"1.9.2"}