PT-2026-166980
CVE-2026-143122
·
Publicado
2026-12-03
·
Atualizado
2026-12-03
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:
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.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾