net: usb: kalmia: bound RX frame length in kalmia_rx_fixup()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d40261236e8e278cb1936cb5e934262971692b10 · < e24eb271061db384a3c3ef6f107fe515e68ef222| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
net: usb: kalmia: bound RX frame length in kalmia_rx_fixup()
kalmia_rx_fixup() computes usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH) as a u16, guarded only by a pre-loop check that skb->len is at least KALMIA_HEADER_LENGTH, which is 6. A device can deliver a short bulk-IN frame with skb->len in the 6 to 11 range, or leave a short trailing remainder on a later loop iteration. Either case underflows usb_packet_length to about 65530.
That bypasses the usb_packet_length < ether_packet_length truncation path. The device-supplied ether_packet_length, a le16 up to 65535 read from header_start[2], then drives a memcmp() and the following skb_trim() and skb_pull() past the end of the rx buffer. The rx buffer is hard_mtu * 10, which is 14000 bytes. That is an out of bounds read.
Require both the start and end framing headers to be present before subtracting them, on every loop iteration.
From the CVE record · Linux
The Linux kernel’s kalmia USB network driver can read beyond its receive buffer when a device supplies a short or malformed bulk-IN frame. The issue occurs while processing device-supplied frames; the input does not specify authentication requirements or user interaction.
Engineers running the Linux kernel with the kalmia USB network driver should check whether their kernel is affected; affected versions are not specified.