PT-2026-163218
CVE-2026-139177
·
Publicado
2026-11-30
·
Atualizado
2026-11-30
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
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:
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
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.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾