{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-53577",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-53577"
  ],
  "published": "2025-10-04T15:17:41Z",
  "summary": "bpf, cpumap: Make sure kthread is running before map update returns",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, cpumap: Make sure kthread is running before map update returns\n\nThe following warning was reported when running stress-mode enabled\nxdp_redirect_cpu with some RT threads:\n\n  ------------[ cut here ]------------\n  WARNING: CPU: 4 PID: 65 at kernel/bpf/cpumap.c:135\n  CPU: 4 PID: 65 Comm: kworker/4:1 Not tainted 6.5.0-rc2+ #1\n  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)\n  Workqueue: events cpu_map_kthread_stop\n  RIP: 0010:put_cpu_map_entry+0xda/0x220\n  ......\n  Call Trace:\n   <TASK>\n   ? show_regs+0x65/0x70\n   ? __warn+0xa5/0x240\n   ......\n   ? put_cpu_map_entry+0xda/0x220\n   cpu_map_kthread_stop+0x41/0x60\n   process_one_work+0x6b0/0xb80\n   worker_thread+0x96/0x720\n   kthread+0x1a5/0x1f0\n   ret_from_fork+0x3a/0x70\n   ret_from_fork_asm+0x1b/0x30\n   </TASK>\n\nThe root cause is the same as commit 436901649731 (\"bpf: cpumap: Fix memory\nleak in cpu_map_update_elem\"). The kthread is stopped prematurely by\nkthread_stop() in cpu_map_kthread_stop(), and kthread() doesn't call\ncpu_map_kthread_run() at all but XDP program has already queued some\nframes or skbs into ptr_ring. So when __cpu_map_ring_cleanup() checks\nthe ptr_ring, it will find it was not emptied and report a warning.\n\nAn alternative fix is to use __cpu_map_ring_cleanup() to drop these\npending frames or skbs when kthread_stop() returns -EINTR, but it may\nconfuse the user, because these frames or skbs have been handled\ncorrectly by XDP program. So instead of dropping these frames or skbs,\njust make sure the per-cpu kthread is running before\n__cpu_map_entry_alloc() returns.\n\nAfter apply the fix, the error handle for kthread_stop() will be\nunnecessary because it will always return 0, so just remove it.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/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"
      ],
      "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"
          }
        ]
      },
      "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.45"
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-53577"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b44d28b98f185d2f2348aa3c3636838c316f889e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7a1178a3671b40746830d355836b72e47ceb2490"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/ecb45b852af5e88257020b88bea5ff0798d72aca"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/640a604585aa30f93e39b17d4d6ba69fcb1e66c9"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - Triggering requires local `bpf()` syscall access to create a `BPF_MAP_TYPE_CPUMAP` and repeatedly update/delete its entries, plus attaching an XDP program \u2014 all local operations. Per kernel scoring guidance BPF map manipulation is Local.\nAC:L - The attacker drives both sides of the race: it produces the queued frames/skbs (self-generated traffic through a generic-mode XDP redirect on a veth/lo it controls) and issues the map update that calls `kthread_stop()`, and it chooses the CPU the kthread is bound to so it can starve it with spinner threads or a softirq flood. No special kernel config is required, and the update/delete loop can be repeated indefinitely until the race is won.\nPR:L - Creating the cpumap needs `bpf_capable()` and the XDP program needs `CAP_NET_ADMIN`, but these are delegatable non-root capabilities routinely granted to unprivileged XDP dataplane daemons/containers, not administrative control over the kernel. Consistent with kernel CNA scoring of comparable CAP_BPF/CAP_NET_ADMIN XDP and devmap/cpumap issues (e.g. CVE-2026-23294, CVE-2025-21808).\nUI:N - The entire sequence \u2014 map create, XDP attach, traffic generation, and the update/delete that races the kthread \u2014 is performed by the attacker's own process. No victim action is involved.\nS:U - The corruption and crash occur inside the kernel itself, within the same security authority as the vulnerable component. There is no VM, IOMMU, or sandbox boundary crossed.\nC:H - In generic/skb XDP mode the leftover ring entries are tagged `sk_buff` pointers passed to `xdp_return_frame()` as `struct xdp_frame *`; when the misread `flags` field sets `XDP_FLAGS_HAS_FRAGS`, `xdp_get_shared_info_from_frame()` builds a wild pointer from misread `data`/`frame_sz` and reads `sinfo->nr_frags` and the frag array out of bounds. This type confusion yields an uncontrolled kernel-memory read primitive whose results feed `page_address()`/`__xdp_return()`.\nI:H - The same type confusion drives `__xdp_return()` with a garbage `mem.type` and garbage `data`, reaching `page_frag_free()`, `put_page()`, or `page_pool_put_full_page()` on uncontrolled pointers \u2014 arbitrary page refcount decrements that can prematurely free live pages and be leveraged into a write primitive. Type confusion / memory corruption of this class is scored High.\nA:H - The bug reliably produces a `WARN_ON_ONCE` splat in `__cpu_map_ring_cleanup()` (kernel panic under `panic_on_warn`), and the follow-on wild-pointer dereference in `xdp_return_frame()`/`__xdp_return()` causes a GPF/oops. It also leaks the pending skbs on every occurrence."
    }
  }
}
