GHSA-7H25-FGH3-HP6R

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: Check fastcall stack contract once for all stack accesses

When the verifier inlines a bpf_fastcall helper or kfunc, it removes the spill/fill pairs that clang emitted around the call and lowers the subprogram's stack depth so that their slots are no longer part of the frame. This is only safe if nothing else accesses those slots or any slot below them. check_fastcall_stack_contract() enforces this: an access to that region from outside a fastcall pattern disables the rewrite for the subprogram. It is called from the four stack load and store paths, and two kinds of access escape it.

Stack buffers passed to helpers and kfuncs are validated by check_stack_range_initialized(), which does not call it. If such a buffer is the only other access to the region, the rewrite is still applied, the JIT reserves a frame that does not contain the buffer, and the helper reads or writes live kernel stack below the program's frame. For example, without CAP_PERFMON:

*(u64 *)(r10 - 8) = r1;
call bpf_get_smp_processor_id;
r1 = *(u64 *)(r10 - 8);
r2 = 0;
r3 = r10;
r3 += -64;
r4 = 8;
call bpf_skb_load_bytes;

is accepted with a stack depth of 0 instead of 64.

Some buffers got the check indirectly. For constant-sized outputs in raw mode, mark_raw_stack() marks the buffer initialized through ordinary byte stores, which call the check. Commit 5da4a9f26fca ("bpf: Preserve stack initialization for generic output buffers") limited raw mode to programs that may read uninitialized stack, so outputs of programs without CAP_PERFMON lost the check, as in the example above. Buffers that never used raw mode have lacked the check since fastcall support was added: helper inputs such as a map key whose only store is a fastcall spill, variable-sized outputs, and buffers at a variable stack offset.

check_stack_read_fixed_off() applies the check to the current frame, even when the pointer targets a caller's stack. A callee can therefore read a caller's fastcall spill slot without disabling the caller's rewrite:

caller:
r1 = 1;
*(u64 *)(r10 - 8) = r1;
call bpf_get_smp_processor_id;
r1 = *(u64 *)(r10 - 8);
r1 = r10;
r1 += -8;
call callee;

callee:
r0 = *(u64 *)(r1 + 0);

The caller's spill and fill are removed and its stack depth drops to 0, but the verifier still tracks the slot as holding the spilled constant. The callee's load then reads kernel stack outside the caller's frame, while the verifier assumes r0 is 1.

Every stack access first goes through check_stack_access_within_bounds(): loads and stores from check_mem_access(), helper and kfunc buffers from check_stack_range_initialized(), and the dynptr, iterator and irq flag slots that kfuncs initialize, whose handlers use check_mem_access(). It resolves the frame that owns the slots and the lowest offset the access can touch, and it is the only place where a frame's stack depth grows. Check the contract there, once for every access, and drop the calls from the stack read and write paths. Zero-sized buffers touch no stack and leave the rewrite enabled.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-139629"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-30T14:19:45Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Check fastcall stack contract once for all stack accesses\n\nWhen the verifier inlines a bpf_fastcall helper or kfunc, it removes the\nspill/fill pairs that clang emitted around the call and lowers the\nsubprogram\u0027s stack depth so that their slots are no longer part of the\nframe. This is only safe if nothing else accesses those slots or any slot\nbelow them. check_fastcall_stack_contract() enforces this: an access to\nthat region from outside a fastcall pattern disables the rewrite for the\nsubprogram. It is called from the four stack load and store paths, and\ntwo kinds of access escape it.\n\nStack buffers passed to helpers and kfuncs are validated by\ncheck_stack_range_initialized(), which does not call it. If such a buffer\nis the only other access to the region, the rewrite is still applied, the\nJIT reserves a frame that does not contain the buffer, and the helper\nreads or writes live kernel stack below the program\u0027s frame. For example,\nwithout CAP_PERFMON:\n\n\t*(u64 *)(r10 - 8) = r1;\n\tcall bpf_get_smp_processor_id;\n\tr1 = *(u64 *)(r10 - 8);\n\tr2 = 0;\n\tr3 = r10;\n\tr3 += -64;\n\tr4 = 8;\n\tcall bpf_skb_load_bytes;\n\nis accepted with a stack depth of 0 instead of 64.\n\nSome buffers got the check indirectly. For constant-sized outputs in raw\nmode, mark_raw_stack() marks the buffer initialized through ordinary\nbyte stores, which call the check. Commit 5da4a9f26fca (\"bpf: Preserve\nstack initialization for generic output buffers\") limited raw mode to\nprograms that may read uninitialized stack, so outputs of programs\nwithout CAP_PERFMON lost the check, as in the example above. Buffers\nthat never used raw mode have lacked the check since fastcall support\nwas added: helper inputs such as a map key whose only store is a fastcall\nspill, variable-sized outputs, and buffers at a variable stack offset.\n\ncheck_stack_read_fixed_off() applies the check to the current frame,\neven when the pointer targets a caller\u0027s stack. A callee can therefore\nread a caller\u0027s fastcall spill slot without disabling the caller\u0027s\nrewrite:\n\n\tcaller:\n\tr1 = 1;\n\t*(u64 *)(r10 - 8) = r1;\n\tcall bpf_get_smp_processor_id;\n\tr1 = *(u64 *)(r10 - 8);\n\tr1 = r10;\n\tr1 += -8;\n\tcall callee;\n\n\tcallee:\n\tr0 = *(u64 *)(r1 + 0);\n\nThe caller\u0027s spill and fill are removed and its stack depth drops to 0,\nbut the verifier still tracks the slot as holding the spilled constant.\nThe callee\u0027s load then reads kernel stack outside the caller\u0027s frame,\nwhile the verifier assumes r0 is 1.\n\nEvery stack access first goes through check_stack_access_within_bounds():\nloads and stores from check_mem_access(), helper and kfunc buffers from\ncheck_stack_range_initialized(), and the dynptr, iterator and irq flag\nslots that kfuncs initialize, whose handlers use check_mem_access(). It\nresolves the frame that owns the slots and the lowest offset the access\ncan touch, and it is the only place where a frame\u0027s stack depth grows.\nCheck the contract there, once for every access, and drop the calls from\nthe stack read and write paths. Zero-sized buffers touch no stack and\nleave the rewrite enabled.",
  "id": "GHSA-7h25-fgh3-hp6r",
  "modified": "2026-11-30T15:32:38Z",
  "published": "2026-11-30T15:32:38Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139629"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/31594d4872dfdbad767e67fcc74bcd0a31f02150"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/6acd70ced460317eb8d0dd8b5907b65292c59a42"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/ec3a69e7c021cd826be8886ba6af4ee3147788fb"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/f19a6264a62b910332a61523177b3cccf4bab46d"
    }
  ],
  "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.