GHSA-65H9-942V-78F3

Vulnerability from github – Published: 2026-11-30 15:32 – Updated: 2026-11-30 15:32
VLAI
Details

In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix bpf_timer callback running on a freed map

A bpf_timer in an inner map can fire after the map has been freed, and bpf_timer_cb() then reads the freed map:

[ 50.709520] BUG: KASAN: slab-use-after-free in bpf_timer_cb+0x249/0x290 [ 50.709540] Read of size 4 at addr ff11000003bc1030 by task bpftimer/72 ... [ 50.710783] Freed by task 12: ... [ 50.710826] bpf_map_free+0x1a2/0x380

When user space closes the map, its timers are cancelled and their callbacks are cleared. Since commit 1bfbc267ec91 ("bpf: Enable bpf_timer and bpf_wq in any context"), bpf_timer_set_callback() and bpf_timer_start() run without a lock, so a program that found the timer just before the close can still use it afterwards:

Task A Task B Task C ------ ------ ------ bpf_timer_start() finds the timer bpf_timer_set_callback() finds the timer close(map_fd) clears the callback cancels the timer sets the callback arms the timer deletes the map from the outer map map is freed the timer fires bpf_timer_cb() reads the freed map

The timer is cancelled once more when it is finally freed, but that happens well after the inner map is freed, so a timer started this way can still fire on the freed map.

Clear the timer's map pointer in bpf_async_cancel_and_free() before the map can be freed, and make the bpf_timer and bpf_wq callbacks return early when it is NULL. The map is not freed until callbacks that are already running have finished, so a callback either sees the map while it is still valid or sees NULL.

The reproducer below calls the two helpers in a loop on two CPUs while a third CPU keeps creating an inner map with a timer, closing it and removing it from the outer map. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development, but the non-deterministic C reproducer can typically trigger it in the 1-50s time range. With the fix, nothing is triggered after 600 seconds.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-139176"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-30T14:18:36Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Fix bpf_timer callback running on a freed map\n\nA bpf_timer in an inner map can fire after the map has been freed, and\nbpf_timer_cb() then reads the freed map:\n\n  [   50.709520] BUG: KASAN: slab-use-after-free in bpf_timer_cb+0x249/0x290\n  [   50.709540] Read of size 4 at addr ff11000003bc1030 by task bpftimer/72\n  ...\n  [   50.710783] Freed by task 12:\n  ...\n  [   50.710826]  bpf_map_free+0x1a2/0x380\n\nWhen user space closes the map, its timers are cancelled and their\ncallbacks are cleared.  Since commit 1bfbc267ec91 (\"bpf: Enable\nbpf_timer and bpf_wq in any context\"), bpf_timer_set_callback() and\nbpf_timer_start() run without a lock, so a program that found the timer\njust before the close can still use it afterwards:\n\n  Task A                  Task B                  Task C\n  ------                  ------                  ------\n  bpf_timer_start()\n    finds the timer\n                          bpf_timer_set_callback()\n                            finds the timer\n                                                  close(map_fd)\n                                                    clears the callback\n                                                    cancels the timer\n                            sets the callback\n    arms the timer\n                                                  deletes the map from\n                                                  the outer map\n                                                    map is freed\n  the timer fires\n    bpf_timer_cb() reads the freed map\n\nThe timer is cancelled once more when it is finally freed, but that\nhappens well after the inner map is freed, so a timer started this way\ncan still fire on the freed map.\n\nClear the timer\u0027s map pointer in bpf_async_cancel_and_free() before the\nmap can be freed, and make the bpf_timer and bpf_wq callbacks return\nearly when it is NULL.  The map is not freed until callbacks that are\nalready running have finished, so a callback either sees the map while\nit is still valid or sees NULL.\n\nThe reproducer below calls the two helpers in a loop on two CPUs while a\nthird CPU keeps creating an inner map with a timer, closing it and\nremoving it from the outer map.  This bug was identified and confirmed\nwith the help of a deterministic hypervisor currently under development,\nbut the non-deterministic C reproducer can typically trigger it in the\n1-50s time range.  With the fix, nothing is triggered after 600 seconds.",
  "id": "GHSA-65h9-942v-78f3",
  "modified": "2026-11-30T15:32:20Z",
  "published": "2026-11-30T15:32:20Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139176"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/59d581d8e9cc019ebedc8145ec8ba56ca04e2383"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/815a0a2a40d6c5985a153041231731651bc4024b"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.