GHSA-747M-HF38-QMJP

Vulnerability from github – Published: 2026-12-03 12:31 – Updated: 2026-12-03 12:31
VLAI
Details

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

perf/core: Do not resurrect cpuctx->cgrp after last cgroup event exit

perf_cgroup_switch() relies on:

/*
 * cpuctx->cgrp is set when the first cgroup event enabled,
 * and is cleared when the last cgroup event disabled.
 */

It computes the next task's cgroup, schedules out the CPU context and then assigns cpuctx->cgrp unconditionally:

ctx_sched_out(&cpuctx->ctx, NULL, EVENT_ALL|EVENT_CGROUP);
/*
 * must not be done before ctxswout due
 * to update_cgrp_time_from_cpuctx() in
 * ctx_sched_out()
 */
cpuctx->cgrp = cgrp;

However, ctx_sched_out() can disable events itself. If a cgroup event has a pending disable from perf_event_disable_inatomic() (e.g. its PERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not handled yet, event_sched_out() consumes it inline:

if (event->pending_disable) {
    event->pending_disable = 0;
    perf_cgroup_event_disable(event, ctx);
    state = PERF_EVENT_STATE_OFF;
}

If that was the last cgroup event, perf_cgroup_event_disable() clears cpuctx->cgrp:

if (--ctx->nr_cgroups)
    return;

cpuctx->cgrp = NULL;

and perf_cgroup_switch() then sets it again. cpuctx->cgrp is left non-NULL with ctx.nr_cgroups == 0, so the NULL check in perf_cgroup_switch() no longer catches it and the next switch trips:

WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);

cpuctx->cgrp does not hold a reference on the cgroup. Once that cgroup is removed, the next ctx_sched_in() dereferences the stale pointer:

BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0 Read of size 8 at addr ffff8881008972d0 by task swapper/3/0

Tainted: [W]=WARN Call Trace: ctx_sched_in+0xb1f/0xfa0 perf_event_sched_in+0x1a/0x70 ctx_resched+0x32b/0xac0 __perf_install_in_context+0x475/0xab0 remote_function+0x105/0x200 __flush_smp_call_function_queue+0x179/0x8d0 __sysvec_call_function_single+0x1b/0x1c0 sysvec_call_function_single+0x66/0x80 asm_sysvec_call_function_single+0x1a/0x20

Only assign cpuctx->cgrp when cgroup events remain after the context has been scheduled out, so that it stays NULL as the invariant requires.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-143122"
  ],
  "database_specific": {
    "cwe_ids": [],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-12-03T10:17:44Z",
    "severity": null
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nperf/core: Do not resurrect cpuctx-\u003ecgrp after last cgroup event exit\n\nperf_cgroup_switch() relies on:\n\n    /*\n     * cpuctx-\u003ecgrp is set when the first cgroup event enabled,\n     * and is cleared when the last cgroup event disabled.\n     */\n\nIt computes the next task\u0027s cgroup, schedules out the CPU context and\nthen assigns cpuctx-\u003ecgrp unconditionally:\n\n    ctx_sched_out(\u0026cpuctx-\u003ectx, NULL, EVENT_ALL|EVENT_CGROUP);\n    /*\n     * must not be done before ctxswout due\n     * to update_cgrp_time_from_cpuctx() in\n     * ctx_sched_out()\n     */\n    cpuctx-\u003ecgrp = cgrp;\n\nHowever, ctx_sched_out() can disable events itself. If a cgroup event\nhas a pending disable from perf_event_disable_inatomic() (e.g. its\nPERF_EVENT_IOC_REFRESH limit ran out) that the irq_work has not\nhandled yet, event_sched_out() consumes it inline:\n\n    if (event-\u003epending_disable) {\n        event-\u003epending_disable = 0;\n        perf_cgroup_event_disable(event, ctx);\n        state = PERF_EVENT_STATE_OFF;\n    }\n\nIf that was the last cgroup event, perf_cgroup_event_disable() clears\ncpuctx-\u003ecgrp:\n\n    if (--ctx-\u003enr_cgroups)\n        return;\n\n    cpuctx-\u003ecgrp = NULL;\n\nand perf_cgroup_switch() then sets it again. cpuctx-\u003ecgrp is left\nnon-NULL with ctx.nr_cgroups == 0, so the NULL check in\nperf_cgroup_switch() no longer catches it and the next switch trips:\n\n    WARN_ON_ONCE(cpuctx-\u003ectx.nr_cgroups == 0);\n\ncpuctx-\u003ecgrp does not hold a reference on the cgroup. Once that cgroup\nis removed, the next ctx_sched_in() dereferences the stale pointer:\n\n  BUG: KASAN: slab-use-after-free in ctx_sched_in+0xb1f/0xfa0\n  Read of size 8 at addr ffff8881008972d0 by task swapper/3/0\n\n  Tainted: [W]=WARN\n  Call Trace:\n   \u003cIRQ\u003e\n   ctx_sched_in+0xb1f/0xfa0\n   perf_event_sched_in+0x1a/0x70\n   ctx_resched+0x32b/0xac0\n   __perf_install_in_context+0x475/0xab0\n   remote_function+0x105/0x200\n   __flush_smp_call_function_queue+0x179/0x8d0\n   __sysvec_call_function_single+0x1b/0x1c0\n   sysvec_call_function_single+0x66/0x80\n   \u003c/IRQ\u003e\n   \u003cTASK\u003e\n   asm_sysvec_call_function_single+0x1a/0x20\n\nOnly assign cpuctx-\u003ecgrp when cgroup events remain after the context\nhas been scheduled out, so that it stays NULL as the invariant\nrequires.",
  "id": "GHSA-747m-hf38-qmjp",
  "modified": "2026-12-03T12:31:06Z",
  "published": "2026-12-03T12:31:06Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-143122"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/1c7567304c778e347c16a819cec83250118ebf17"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/59f1398140869432c7171b9a2a279ca315467c4e"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/84ef23287df05f2086af7a21eb6a6d44a095f119"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/b06c73f3d18edbf3ca40fbbadc8740757465ee5c"
    }
  ],
  "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.