FKIE_CVE-2026-139177

Vulnerability from fkie_nvd - Published: 2026-11-30 14:18 - Updated: 2026-11-30 14:18
Severity
Summary
In the Linux kernel, the following vulnerability has been resolved: sched_ext: Reject rq-lock-taking kfuncs in tracing programs scx_bpf_cpuperf_set() and scx_bpf_cidperf_set() are members of scx_kfunc_ids_any, which is registered for BPF_PROG_TYPE_TRACING. A tracing program can run in a context which already holds the target rq lock, in which case scx_cpuperf_set() attempts to acquire the same lock again: __schedule() rq_lock(rq); /* rq->__lock is held */ trace_sched_switch(); BPF tracing program scx_bpf_cpuperf_set(smp_processor_id(), 1024); scx_cpuperf_set(); locked_rq = scx_locked_rq(); /* NULL */ rq_lock_irqsave(rq, &rf); /* same lock */ scx_locked_rq() only tracks rq locks held during SCX callback invocations, so it cannot detect an rq lock held by the surrounding kernel code. The deadlock can be reproduced with two BPF programs. The first is a minimal SCX scheduler, which only needs to be registered and enabled: SEC(".struct_ops.link") struct sched_ext_ops minimal_ops = { .name = "minimal", }; The second is a tracing program attached to tp_btf/sched_switch, which fires from __schedule() with rq->__lock already held: SEC("tp_btf/sched_switch") int BPF_PROG(on_sched_switch, bool preempt, struct task_struct *prev, struct task_struct *next, unsigned int prev_state) { scx_bpf_cpuperf_set(bpf_get_smp_processor_id(), 1024); return 0; } With both programs attached, the next context switch on any CPU deadlocks that CPU. Lockdep reports: WARNING: possible recursive locking detected 7.3.0-rc7 #3 Not tainted swapper/3/0 is trying to acquire lock: (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x1e/0x30 but task is already holding lock: (&rq->__lock){-.-.}-{2:2}, at: __schedule+0xeb/0x1430 Possible unsafe locking scenario: CPU0 ---- lock(&rq->__lock); lock(&rq->__lock); *** DEADLOCK *** Call Trace: <TASK> print_deadlock_bug.cold+0xc0/0xd0 __lock_acquire+0x12fa/0x1b80 lock_acquire+0xd1/0x2f0 _raw_spin_lock_nested+0x32/0x40 raw_spin_rq_lock_nested+0x1e/0x30 scx_cpuperf_set+0x1e9/0x310 scx_bpf_cpuperf_set+0x9b/0x230 bpf_prog_..._on_sched_switch+0x3d/0x41 bpf_trace_run4+0x125/0x450 __traceiter_sched_switch+0x4b/0x70 __schedule+0x94a/0x1430 schedule_idle+0x26/0x50 cpu_startup_entry+0x2d/0x30 start_secondary+0xfc/0x100 </TASK> The CPU remains locked up with interrupts disabled. scx_bpf_cidperf_set() is similarly affected, as it resolves the CID through scx_cid_to_cpu() before reaching the same rq-locking path. There is no reliable way for these kfuncs to determine whether the surrounding tracing context already holds an rq lock. Reject calls to both kfuncs from tracing programs at verification time, while preserving their availability to SCX struct_ops and syscall programs.
Impacted products
Vendor Product Version

{
  "affected": [
    {
      "affectedData": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "kernel/sched/ext/ext.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "2bf613d098ffdeef30298d9306f6ff60461d7a3f",
              "status": "affected",
              "version": "a11d6784d7316a6c77ca9f14fb1a698ebbb3c1fb",
              "versionType": "git"
            },
            {
              "lessThan": "e62ca4fcc71482cf0e8d5ba3185498ce01864cc0",
              "status": "affected",
              "version": "a11d6784d7316a6c77ca9f14fb1a698ebbb3c1fb",
              "versionType": "git"
            },
            {
              "lessThan": "b07a7450f6ef98c79ebd450a92fc4bb6b8f1e02e",
              "status": "affected",
              "version": "a11d6784d7316a6c77ca9f14fb1a698ebbb3c1fb",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "kernel/sched/ext/ext.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.15"
            },
            {
              "lessThan": "6.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.18.*",
              "status": "unaffected",
              "version": "6.18.66",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "7.3.*",
              "status": "unaffected",
              "version": "7.3.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "7.4-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ],
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nsched_ext: Reject rq-lock-taking kfuncs in tracing programs\n\nscx_bpf_cpuperf_set() and scx_bpf_cidperf_set() are members of\nscx_kfunc_ids_any, which is registered for BPF_PROG_TYPE_TRACING.\nA tracing program can run in a context which already holds the target\nrq lock, in which case scx_cpuperf_set() attempts to acquire the same\nlock again:\n\n  __schedule()\n    rq_lock(rq);                          /* rq-\u003e__lock is held */\n    trace_sched_switch();\n      BPF tracing program\n        scx_bpf_cpuperf_set(smp_processor_id(), 1024);\n          scx_cpuperf_set();\n            locked_rq = scx_locked_rq(); /* NULL */\n            rq_lock_irqsave(rq, \u0026rf);    /* same lock */\n\nscx_locked_rq() only tracks rq locks held during SCX callback\ninvocations, so it cannot detect an rq lock held by the surrounding\nkernel code.\n\nThe deadlock can be reproduced with two BPF programs. The first is a\nminimal SCX scheduler, which only needs to be registered and enabled:\n\n  SEC(\".struct_ops.link\")\n  struct sched_ext_ops minimal_ops = {\n          .name = \"minimal\",\n  };\n\nThe second is a tracing program attached to tp_btf/sched_switch,\nwhich fires from __schedule() with rq-\u003e__lock already held:\n\n  SEC(\"tp_btf/sched_switch\")\n  int BPF_PROG(on_sched_switch, bool preempt, struct task_struct *prev,\n               struct task_struct *next, unsigned int prev_state)\n  {\n          scx_bpf_cpuperf_set(bpf_get_smp_processor_id(), 1024);\n          return 0;\n  }\n\nWith both programs attached, the next context switch on any CPU\ndeadlocks that CPU. Lockdep reports:\n\n  WARNING: possible recursive locking detected\n  7.3.0-rc7 #3 Not tainted\n  swapper/3/0 is trying to acquire lock:\n   (\u0026rq-\u003e__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x1e/0x30\n\n  but task is already holding lock:\n   (\u0026rq-\u003e__lock){-.-.}-{2:2}, at: __schedule+0xeb/0x1430\n\n   Possible unsafe locking scenario:\n\n         CPU0\n         ----\n    lock(\u0026rq-\u003e__lock);\n    lock(\u0026rq-\u003e__lock);\n\n    *** DEADLOCK ***\n\n  Call Trace:\n   \u003cTASK\u003e\n   print_deadlock_bug.cold+0xc0/0xd0\n   __lock_acquire+0x12fa/0x1b80\n   lock_acquire+0xd1/0x2f0\n   _raw_spin_lock_nested+0x32/0x40\n   raw_spin_rq_lock_nested+0x1e/0x30\n   scx_cpuperf_set+0x1e9/0x310\n   scx_bpf_cpuperf_set+0x9b/0x230\n   bpf_prog_..._on_sched_switch+0x3d/0x41\n   bpf_trace_run4+0x125/0x450\n   __traceiter_sched_switch+0x4b/0x70\n   __schedule+0x94a/0x1430\n   schedule_idle+0x26/0x50\n   cpu_startup_entry+0x2d/0x30\n   start_secondary+0xfc/0x100\n   \u003c/TASK\u003e\n\nThe CPU remains locked up with interrupts disabled.\nscx_bpf_cidperf_set() is similarly affected, as it resolves the CID\nthrough scx_cid_to_cpu() before reaching the same rq-locking path.\n\nThere is no reliable way for these kfuncs to determine whether the\nsurrounding tracing context already holds an rq lock. Reject calls to\nboth kfuncs from tracing programs at verification time, while\npreserving their availability to SCX struct_ops and syscall programs."
    }
  ],
  "id": "CVE-2026-139177",
  "lastModified": "2026-11-30T14:18:36.770",
  "metrics": {},
  "published": "2026-11-30T14:18:36.770",
  "references": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/2bf613d098ffdeef30298d9306f6ff60461d7a3f"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/b07a7450f6ef98c79ebd450a92fc4bb6b8f1e02e"
    },
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "url": "https://git.kernel.org/stable/c/e62ca4fcc71482cf0e8d5ba3185498ce01864cc0"
    }
  ],
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "vulnStatus": "Received"
}



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.