{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-35811",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-35811"
  ],
  "published": "2024-05-17T13:23:58Z",
  "summary": "wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nwifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach\n\nThis is the candidate patch of CVE-2023-47233 :\nhttps://nvd.nist.gov/vuln/detail/CVE-2023-47233\n\nIn brcm80211 driver,it starts with the following invoking chain\nto start init a timeout worker:\n\n->brcmf_usb_probe\n  ->brcmf_usb_probe_cb\n    ->brcmf_attach\n      ->brcmf_bus_started\n        ->brcmf_cfg80211_attach\n          ->wl_init_priv\n            ->brcmf_init_escan\n              ->INIT_WORK(&cfg->escan_timeout_work,\n\t\t  brcmf_cfg80211_escan_timeout_worker);\n\nIf we disconnect the USB by hotplug, it will call\nbrcmf_usb_disconnect to make cleanup. The invoking chain is :\n\nbrcmf_usb_disconnect\n  ->brcmf_usb_disconnect_cb\n    ->brcmf_detach\n      ->brcmf_cfg80211_detach\n        ->kfree(cfg);\n\nWhile the timeout woker may still be running. This will cause\na use-after-free bug on cfg in brcmf_cfg80211_escan_timeout_worker.\n\nFix it by deleting the timer and canceling the worker in\nbrcmf_cfg80211_detach.\n\n[arend.vanspriel@broadcom.com: keep timer delete as is and cancel work just before free]",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:A/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.21-1+rpt1",
        "1:6.1.47-1+rpt2",
        "1:6.1.47-1+rpt4",
        "1:6.1.54-1+rpt2",
        "1:6.1.58-1+rpt2",
        "1:6.1.63-1+rpt1",
        "1:6.1.73-1+rpt1",
        "1:6.6.20-1+rpt1"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v6",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v7l",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi1-rpi-v8",
            "binary_version": "1:6.1.21-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi2-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi2-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi2-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi2-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt2"
          },
          {
            "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"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi4-rpi-2712",
            "binary_version": "1:6.1.54-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi4-rpi-v6",
            "binary_version": "1:6.1.54-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi4-rpi-v7",
            "binary_version": "1:6.1.54-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi4-rpi-v7l",
            "binary_version": "1:6.1.54-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi4-rpi-v8",
            "binary_version": "1:6.1.54-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi6-rpi-2712",
            "binary_version": "1:6.1.58-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi6-rpi-v6",
            "binary_version": "1:6.1.58-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi6-rpi-v7",
            "binary_version": "1:6.1.58-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi6-rpi-v7l",
            "binary_version": "1:6.1.58-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi6-rpi-v8",
            "binary_version": "1:6.1.58-1+rpt2"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi7-rpi-2712",
            "binary_version": "1:6.1.63-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi7-rpi-v6",
            "binary_version": "1:6.1.63-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi7-rpi-v7",
            "binary_version": "1:6.1.63-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi7-rpi-v7l",
            "binary_version": "1:6.1.63-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi7-rpi-v8",
            "binary_version": "1:6.1.63-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi8-rpi-2712",
            "binary_version": "1:6.1.73-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi8-rpi-v6",
            "binary_version": "1:6.1.73-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi8-rpi-v7",
            "binary_version": "1:6.1.73-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi8-rpi-v7l",
            "binary_version": "1:6.1.73-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi8-rpi-v8",
            "binary_version": "1:6.1.73-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-2712",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v6",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v7l",
            "binary_version": "1:6.6.20-1+rpt1"
          },
          {
            "binary_name": "linux-image-6.6.20+rpt-rpi-v8",
            "binary_version": "1:6.6.20-1+rpt1"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.21-1+rpt1": {
            "linux_commit": "0afb5e98488aed7017b9bf321b575d0177feb7ed",
            "upstream_version": "6.1.21",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.1.47-1+rpt2": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.84",
            "compiled_filter": false
          },
          "1:6.1.54-1+rpt2": {
            "linux_commit": "2906f7abdc03d4a92b6b0e2e0c87ea2a9dffe8f7",
            "upstream_version": "6.1.54",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.1.58-1+rpt2": {
            "linux_commit": "ccf1586ad0663fa91238ac56abf6340d6d740d18",
            "upstream_version": "6.1.58",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.1.63-1+rpt1": {
            "linux_commit": null,
            "upstream_version": "6.1.63",
            "assessment": "upstream version (no usable Linux commit)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.1.73-1+rpt1": {
            "linux_commit": null,
            "upstream_version": "6.1.73",
            "assessment": "upstream version (no usable Linux commit)",
            "upstream_fixed": "6.1.84"
          },
          "1:6.6.20-1+rpt1": {
            "linux_commit": "6f16847710cc0502450788b9f12f0a14d3429668",
            "upstream_version": "6.6.20",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.6.24"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-35811"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/202c503935042272e2f9e1bb549d5f69a8681169"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8e3f03f4ef7c36091f46e7349096efb5a2cdb3a1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bacb8c3ab86dcd760c15903fcee58169bc3026aa"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8c36205123dc57349b59b4f1a2301eb278cbc731"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0b812f706fd7090be74812101114a0e165b36744"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/190794848e2b9d15de92d502b6ac652806904f5a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6678a1e7d896c00030b31491690e8ddc9a90767a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0a7591e14a8da794d0b93b5d1c6254ccb23adacb"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0f7352557a35ab7888bc7831411ec8a3cbe20d78"
    }
  ],
  "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": 8.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:A - The vulnerable free/use race is in a WiFi driver and is reached automatically via the firmware-crash recovery path (`brcmf_fw_crashed()` \u2192 `bus_reset` work \u2192 `brcmf_pcie_reset`/`brcmf_sdio_bus_reset` \u2192 `brcmf_detach` \u2192 `brcmf_cfg80211_detach` \u2192 `kfree(cfg)`), while the escan timeout worker fires precisely because the firmware stopped responding mid-scan. An adjacent 802.11 attacker who induces a firmware halt (a well-documented failure mode of Broadcom fullmac firmware when fed malformed frames) while the station is doing its routine background scanning triggers both sides of the race over the air.\nAC:L - The attacker controls both halves of the race \u2014 the stalled scan that guarantees the 10 s escan timer expires and the firmware halt that drives the detach \u2014 and the window is wide because the worker blocks in `brcmf_fil_cmd_data_set()` waiting on a dead firmware while `brcmf_cfg80211_detach()` frees `escan_buf` and `cfg` in parallel. The attempt is freely repeatable, and heap grooming of the freed 65000-byte buffer and `cfg` slab is standard.\nPR:N - No local account or capability is needed on the affected system: the scan is issued by the normal background supplicant/NetworkManager activity, and the detach is performed autonomously by the driver's bus-reset recovery worker in response to a firmware halt. The originally reported USB-hotplug variant likewise requires no privileges.\nUI:N - Background scanning by wpa_supplicant/NetworkManager is continuous and automatic, and the `brcmf_fw_crashed()` \u2192 bus-reset \u2192 detach sequence runs entirely inside the kernel without any user action. No victim interaction is required at any point.\nS:U - The use-after-free corrupts kernel heap objects and is exploited within the kernel's own security authority, with no crossing of a hypervisor, IOMMU, or sandbox boundary. Impact remains confined to the kernel that owns the vulnerable component.\nC:H - After the free, `brcmf_inform_bss()` walks the dangling `escan_info.escan_buf` with a length/count taken from reallocated memory, giving controlled out-of-bounds reads, and `brcmf_inform_single_bss()` hands the resulting `notify_ie`/`notify_ielen` to `cfg80211_inform_bss_data()`, which copies that kernel memory into a BSS entry retrievable by userspace via nl80211. This is an arbitrary kernel-memory read with a direct exfiltration channel.\nI:H - The worker performs an indirect call through `cfg->d11inf.decchspec`, a function pointer loaded from the freed `cfg` object, giving control-flow hijack once the slab is reallocated with attacker-controlled data, and it also writes into freed memory (`bi->ctl_ch`, `cfg->scan_request = NULL`, `timer_delete_sync()` on a freed `timer_list`). Combined with the stale `ifp` and `scan_request` passed into further kernel calls, this yields write and code-execution primitives.\nA:H - Even without full exploitation, dereferencing the freed `cfg`, freed `escan_buf`, and freed `brcmf_if`, and running `timer_delete_sync()`/`cfg80211_scan_done()` on freed structures, reliably produces oopses, slab corruption, and kernel panic. The WiFi interface is destroyed and the system crashes."
    }
  }
}
