{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-40937",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-40937"
  ],
  "published": "2024-07-12T12:27:31Z",
  "summary": "gve: Clear napi->skb before dev_kfree_skb_any()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ngve: Clear napi->skb before dev_kfree_skb_any()\n\ngve_rx_free_skb incorrectly leaves napi->skb referencing an skb after it\nis freed with dev_kfree_skb_any(). This can result in a subsequent call\nto napi_get_frags returning a dangling pointer.\n\nFix this by clearing napi->skb before the skb is freed.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.95",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-40937"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/75afd8724739ee5ed8165acde5f6ac3988b485cc"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d221284991118c0ab16480b53baecd857c0bc442"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2ce5341c36993b776012601921d7688693f8c037"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a68184d5b420ea4fc7e6b7ceb52bbc66f90d3c50"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6f4d93b78ade0a4c2cafd587f7b429ce95abb02e"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "AV:N - The vulnerable code is the gVNIC DQO NAPI receive poll (`gve_rx_poll_dqo`), executed in softirq context for every frame arriving on the wire. gve is the primary NIC on Google Compute Engine instances that are routinely internet-facing, so a remote attacker reaches the code purely by sending packets.\nAC:L - The attacker controls both trigger ingredients \u2014 packet shape (large multi-buffer/RSC frames above rx_copybreak, malformed or truncated frames causing the device to set rx_error mid-packet) and the traffic volume that drives the GFP_ATOMIC allocation failures in gve_rx_append_frags/gve_rx_copy_ondemand. The error path can be provoked repeatedly at line rate until it lands.\nPR:N - There is no syscall, ioctl, socket, capability check or authentication anywhere on the path; the receive poll runs unconditionally on incoming frames. An entirely unauthenticated off-host attacker can reach it.\nUI:N - No victim action is required \u2014 the driver processes received packets automatically in softirq context. Simply having the interface up is sufficient.\nS:U - The corruption is confined to the kernel's own memory within the same security authority; there is no crossing of a VM, IOMMU or sandbox boundary. Standard kernel-level compromise is Unchanged.\nC:H - The stale napi->skb is a freed sk_buff on the heavily-sprayable skbuff_head_cache; the driver and the subsequent napi_gro_frags/GRO path read skb->head, skb->data, skb_headlen and skb_shinfo from reallocated memory, so attacker-groomed or unrelated kernel data is parsed and can be leaked out via the receive path.\nI:H - The dangling pointer is written through \u2014 skb_add_rx_frag updates len/data_len/truesize and skb_shinfo, and gve_rx_complete_skb writes hash, ip_summed, gso_type and gso_size into freed memory \u2014 giving a write-after-free into a general-purpose slab plus a subsequent double free, which is the classic basis for control-flow hijack and privilege escalation.\nA:H - Use of the freed sk_buff reliably produces slab corruption, KASAN splats, list corruption and kernel panics, and the double free of the skb compounds this. A remote attacker can crash the host repeatedly."
    }
  }
}
