CVE-2026-46151: usb: usblp: fix heap leak in IEEE 1284 device ID via short response
In the Linux kernel, the following vulnerability has been resolved:
usb: usblp: fix heap leak in IEEE 1284 device ID via short response
usblpctrlmsg() collapses the usbcontrolmsg() return value to 0/-errno, discarding the actual number of bytes transferred. A broken printer can complete the GETDEVICEID control transfer short and the driver has no way to know.
usblpcachedeviceidstring() reads the 2-byte big-endian length prefix from the response and trusts it (clamped only to the buffer bounds). The buffer is kmalloc(1024) at probe time. A device that sends exactly two bytes (e.g. 0x03 0xFF, claiming a 1023-byte ID) leaves deviceidstring[2..1022] holding stale kmalloc heap.
That stale data is then exposed: - via the ieee1284id sysfs attribute (sprintf("%s", buf+2), truncated at the first NUL in the stale heap), and - via the IOCNRGETDEVICEID ioctl, which copytouser()s the full claimed length regardless of NULs, up to 1021 bytes of uninitialized heap, with the leak size chosen by the device.
Fix this up by just zapping the buffer with zeros before each request sent to the device.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 6.6.141.1-1 - Upgrade
Upgrade
Linux kernel usb: usblpto a version that resolves this vulnerability.Patch usblp: fix heap leak in IEEE 1284 device ID via short response - Configuration
Modify usblp to clear (zero) the kmalloc(1024) device ID string buffer before each device request, so stale heap data cannot be exposed via ioctl/sysfs even when the device completes GET_DEVICE_ID control transfers short or claims a length with NULs.
usblp device ID string buffer handling = zap buffer with zeros before each request (before each request, clear kmalloc(1024) buffer)
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Systems using the Linux usblp printer driver are exposed when a broken or malicious USB printer provides a deliberately short IEEE 1284 GET_DEVICE_ID response. The affected data can be exposed through the ieee1284_id sysfs attribute or the IOCNR_GET_DEVICE_ID ioctl.
What access does an attacker need to trigger the leak?
An attacker needs local access and control of, or the ability to connect, a USB printer device that can send a crafted short control-transfer response. The CVSS vector also indicates low-privilege local access is required and no user interaction is required.
How much data can be disclosed?
The device can cause disclosure of stale kmalloc heap contents from the device-ID buffer. The ioctl can copy up to 1021 bytes of uninitialized heap data to user space, while the sysfs output stops at the first NUL byte.
What is the remediation described by the fix?
The fix clears the device-ID buffer to zeros before each request to the USB device. This prevents bytes not returned by a short response from retaining stale heap contents.