CVE-2026-142971

Not scored yetLast modified Dec 3, 2026

Description

In the Linux kernel, the following vulnerability has been resolved:

USB: serial: garmin_gps: validate packet data length in nat_receive()

In nat_receive() (called from garmin_write() when userspace writes to /dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p->insize is less than GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into garmin_data_p->inbuffer. Once garmin_data_p->insize reaches GARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as:

len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p->inbuffer);

Because getDataLength() returns a signed int from __le32_to_cpup(), a 12-byte header with a negative 32-bit length field (such as 0xfffffff5, i.e., -11) causes len to underflow to a small positive value (12 + (-11) = 1) without any bounds check at that point. Then garmin_data_p->insize >= len (12 >= 1) evaluates to true and nat_receive() calls garmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab buffer via kmemdup() and immediately reads 4 bytes from it in getLayerId(buffer) (and again in garmin_write_bulk_callback() when the URB completes):

BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500 Read of size 4 at addr ffff888002cc0ba0 by task init/1 Call Trace: <TASK> dump_stack_lvl+0x70/0xa0 print_report+0x153/0x4c6 kasan_report+0xf1/0x120 garmin_write_bulk.constprop.0+0x3eb/0x500 garmin_write+0x60f/0x1450 serial_write+0x123/0x200 n_tty_write+0x8ea/0xeb0 file_tty_write.isra.0+0x44f/0x7a0 vfs_write+0x671/0xd20

Validate the unsigned 32-bit data length (dlen >= GPS_IN_BUFSIZ - GARMIN_PKTHDR_LENGTH, matching the existing len >= GPS_IN_BUFSIZ bound) in nat_receive() as soon as the 12-byte header is present, resetting insize and returning -EINVPKT on invalid lengths so garmin_write_bulk() is only ever called with a full valid packet header (12 <= len < GPS_IN_BUFSIZ).

Tested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS device (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0 to MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native packet with data length 0xfffffff5: on the unfixed kernel this triggers KASAN slab-out-of-bounds reads in garmin_write_bulk() and garmin_write_bulk_callback(), whereas on the fixed kernel nat_receive() rejects the packet with -EINVPKT and 0 KASAN faults.

[ johan: move comment and dev_dbg(); add comment about redundant check ]

Metrics

No CVSS score has been published yet.

Affected software

Source: the vendor's advisory (CNA). NVD analysis pending.

No affected versions have been published.

Timeline

Published
Dec 3, 2026
Last modified
Dec 3, 2026
NVD status
Received

Related CVEs from 2026

CVE-2026-142972In the Linux kernel, the following vulnerability has been resolved: drm/amdgpu: fix the error handling of amdgpu_vm_init_entities() When iCVE-2026-142973In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: skip GPUs without a VM when checkpointing the BO mappings CVE-2026-142974In the Linux kernel, the following vulnerability has been resolved: w1: w1_therm: leave the slaves of other families alone The file therm_CVE-2026-142975In the Linux kernel, the following vulnerability has been resolved: w1: use the bus mutex for the "rw" file Commit b02f8bede217 ("W1: spliCVE-2026-142976In the Linux kernel, the following vulnerability has been resolved: w1: remove the master's files before taking its locks __w1_remove_mastCVE-2026-142977In the Linux kernel, the following vulnerability has been resolved: w1: netlink: drop the slave after the bus is unlocked w1_process_cb() CVE-2026-142978In the Linux kernel, the following vulnerability has been resolved: w1: ds28e04: use the bus mutex to talk on the bus Since commit b02f8beCVE-2026-142979In the Linux kernel, the following vulnerability has been resolved: w1: ds2805: use the bus mutex to talk on the bus Since commit b02f8bedCVE-2026-142986.5Mattermost versions 11.9.x <= 11.9.0, 11.8.x <= 11.8.4, 11.7.x <= 11.7.7, 10.11.x <= 10.11.22 fail to limit decompressed content size and enCVE-2026-142980In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: gadget: Track a timed out End Transfer If an End Transfer cCVE-2026-142981In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: gadget: Reset endpoint flags on controller start The flags CVE-2026-142982In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: gadget: Reject requests to a disabled endpoint __dwc3_gadge
CVE-2026-142971: Unscored | Vulnix