{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2"
            },
            {
              "fixed": "4eb2cba206a3d23094b698c7f32c91f05dd04d49"
            },
            {
              "fixed": "f669abbb186f8de34c775855c64e8659ecb365a1"
            },
            {
              "fixed": "f4565811b80e8302eb3a25b01fa9d3dc803bbd16"
            },
            {
              "fixed": "40d8518dd43dd0edcd83a347f1854058b123c7ba"
            },
            {
              "fixed": "c6e790c0b9166e91d1c5d638c14f24c7b6dcec9e"
            },
            {
              "fixed": "ca783a2d55b3361493917ad4a3573715ba902503"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2.6.12"
            },
            {
              "fixed": "5.10.276"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "5.15.227"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "5.16.0"
            },
            {
              "fixed": "6.12.120"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.66"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142971.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nUSB: serial: garmin_gps: validate packet data length in nat_receive()\n\nIn nat_receive() (called from garmin_write() when userspace writes to\n/dev/ttyUSBn in MODE_NATIVE mode), while garmin_data_p-\u003einsize is less\nthan GARMIN_PKTHDR_LENGTH (12), the loop copies up to 12 bytes into\ngarmin_data_p-\u003einbuffer. Once garmin_data_p-\u003einsize reaches\nGARMIN_PKTHDR_LENGTH, nat_receive() computes the total packet size as:\n\n  len = GARMIN_PKTHDR_LENGTH + getDataLength(garmin_data_p-\u003einbuffer);\n\nBecause getDataLength() returns a signed int from __le32_to_cpup(), a\n12-byte header with a negative 32-bit length field (such as 0xfffffff5,\ni.e., -11) causes len to underflow to a small positive value (12 + (-11)\n= 1) without any bounds check at that point. Then garmin_data_p-\u003einsize\n\u003e= len (12 \u003e= 1) evaluates to true and nat_receive() calls\ngarmin_write_bulk(port, inbuffer, 1, 0), which allocates a 1-byte slab\nbuffer via kmemdup() and immediately reads 4 bytes from it in\ngetLayerId(buffer) (and again in garmin_write_bulk_callback() when the\nURB completes):\n\n  BUG: KASAN: slab-out-of-bounds in garmin_write_bulk.constprop.0+0x3eb/0x500\n  Read of size 4 at addr ffff888002cc0ba0 by task init/1\n  Call Trace:\n   \u003cTASK\u003e\n   dump_stack_lvl+0x70/0xa0\n   print_report+0x153/0x4c6\n   kasan_report+0xf1/0x120\n   garmin_write_bulk.constprop.0+0x3eb/0x500\n   garmin_write+0x60f/0x1450\n   serial_write+0x123/0x200\n   n_tty_write+0x8ea/0xeb0\n   file_tty_write.isra.0+0x44f/0x7a0\n   vfs_write+0x671/0xd20\n\nValidate the unsigned 32-bit data length (dlen \u003e= GPS_IN_BUFSIZ -\nGARMIN_PKTHDR_LENGTH, matching the existing len \u003e= GPS_IN_BUFSIZ bound)\nin nat_receive() as soon as the 12-byte header is present, resetting\ninsize and returning -EINVPKT on invalid lengths so garmin_write_bulk()\nis only ever called with a full valid packet header (12 \u003c= len \u003c\nGPS_IN_BUFSIZ).\n\nTested in QEMU against Linux 7.3.0-rc3 by emulating a Garmin USB GPS\ndevice (091e:0003) via dummy_hcd + raw-gadget, switching /dev/ttyUSB0\nto MODE_NATIVE via PRIV_PKTID_SET_MODE, and writing a 12-byte native\npacket with data length 0xfffffff5: on the unfixed kernel this triggers\nKASAN slab-out-of-bounds reads in garmin_write_bulk() and\ngarmin_write_bulk_callback(), whereas on the fixed kernel nat_receive()\nrejects the packet with -EINVPKT and 0 KASAN faults.\n\n[ johan: move comment and dev_dbg(); add comment about redundant check ]",
  "id": "CVE-2026-142971",
  "modified": "2026-12-03T10:45:28.668123004Z",
  "published": "2026-12-03T09:17:01.268Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/40d8518dd43dd0edcd83a347f1854058b123c7ba"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/4eb2cba206a3d23094b698c7f32c91f05dd04d49"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/c6e790c0b9166e91d1c5d638c14f24c7b6dcec9e"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ca783a2d55b3361493917ad4a3573715ba902503"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/f4565811b80e8302eb3a25b01fa9d3dc803bbd16"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/f669abbb186f8de34c775855c64e8659ecb365a1"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142971.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-142971"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "USB: serial: garmin_gps: validate packet data length in nat_receive()"
}