CVE-2026-45939: gpib: Fix memory leak in ni_usb_init()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
gpib: Fix memory leak in ni_usb_init()
In ni_usb_init(), if ni_usb_setup_init() fails, the function returns -EFAULT without freeing the allocated writes buffer, leading to a memory leak.
Additionally, ni_usb_setup_init() returns 0 on failure, which causes ni_usb_init() to return -EFAULT, an inappropriate error code for this situation.
Fix the leak by freeing writes in the error path. Modify ni_usb_setup_init() to return -EINVAL on failure and propagate this error code in ni_usb_init().
The Linux kernel CVE team has assigned CVE-2026-45939 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.13 with commit 4e127de14fa78bcd98c6459b0b984b8266cd0203 and fixed in 6.18.14 with commit 9c97fcfb7a62dea893104a046d544da8ac23370b Issue introduced in 6.13 with commit 4e127de14fa78bcd98c6459b0b984b8266cd0203 and fixed in 6.19.4 with commit c899d4b62c0757a280831e89c1f3801b597e8f38 Issue introduced in 6.13 with commit 4e127de14fa78bcd98c6459b0b984b8266cd0203 and fixed in 7.0 with commit b89921eed8cf2d97250bac4be38dbcfbf048b586
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-45939
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/gpib/ni_usb/ni_usb_gpib.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/9c97fcfb7a62dea893104a046d544da8ac23370b https://git.kernel.org/stable/c/c899d4b62c0757a280831e89c1f3801b597e8f38 https://git.kernel.org/stable/c/b89921eed8cf2d97250bac4be38dbcfbf048b586