PT-2026-166826

CVE-2026-142971

·

تاريخ النشر

2026-12-03

·

تاريخ التحديث

2026-12-03

الوصف من

الدرجة
N/A
غير متوفر

لا تتوفر حاليًا تقييمات أو مقاييس للخطورة. سنحدّث المعلومات المقابلة في الصفحة فور توفرها.

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: 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 ]
المورّدون
المنتجات المتأثرة
المعرّفات ذات الصلة
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾