PT-2026-166942
CVE-2026-143087
·
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:
sched/uclamp: Reject clamp values above SCHED CAPACITY SCALE
sched setattr() accepts sched util min and sched util max values that do
not fit in uclamp se::value. A single thread can do:
sched setattr(max = 800) returns 0
sched setattr(min = 0xfffffffe) returns 0
sched getattr() min=2046 max=800
which leaves the minimum above both SCHED CAPACITY SCALE and the task's own
maximum.
The range check in uclamp validate() relies on the + 1 wrapping -1, the
reset value, to 0:
if (util min + 1 > SCHED CAPACITY SCALE + 1)That only works for an unsigned type. util min and util max are int and
SCHED CAPACITY SCALE is a long, so every negative value passes the check,
and so does INT MAX, whose + 1 wraps.
uclamp se set() then truncates what got through to the 11 bits of
uclamp se::value, but computes the bucket from the full value. A minimum
of 0xfffff800 is stored as 0 in the top bucket, where uclamp rq max value()
takes it for the highest active clamp once a higher value leaves the rq.
The rq clamp falls below what the remaining tasks requested, and emptying
their bucket trips the WARN ON ONCE() in uclamp rq dec id(), without any
privilege:
WARNING: kernel/sched/core.c:1862 at dequeue task+0x2a3/0x2b0, CPU#0: repro/126
Call Trace:
schedule+0x933/0x1320
schedule+0x36/0x100
do nanosleep+0x61/0x190
hrtimer nanosleep+0xb5/0x1d0
Make util min and util max unsigned int, so that -1 is the only value that
wraps. The pair check below is unaffected, since it skips -1 explicitly and
anything else is at most SCHED CAPACITY SCALE by then.
Requests that were only accepted because of this now fail with -EINVAL.
The following program triggers the warning when run by any user outside
a child cpu cgroup. With this applied, its 0xfffff800 request fails with
-EINVAL and the warning no longer appears:
#define GNU SOURCE
#include <pthread.h>
#include <sched.h>
#include <stdint.h>
#include <sys/syscall.h>
#include <time.h>
#include <unistd.h>
struct attr {
uint32 t size, policy;
uint64 t flags;
int32 t nice;
uint32 t prio;
uint64 t runtime, deadline, period;
uint32 t util min, util max;
};
static volatile int stop;
static void set min(uint32 t v)
{
/* KEEP POLICY | KEEP PARAMS | UTIL CLAMP MIN */
struct attr a = { .size = sizeof(a), .flags = 0x38, .util min = v };
syscall(SYS sched setattr, 0, &a, 0);
}
static void burn(long us)
{
struct timespec s, n;
clock gettime(CLOCK MONOTONIC, &s);
do
clock gettime(CLOCK MONOTONIC, &n);
while ((n.tv sec - s.tv sec) * 1000000 +
(n.tv nsec - s.tv nsec) / 1000 < us);
}
static void *bogus(void *arg)
{
set min(0xfffff800);
while (!stop)
burn(1000);
return arg;
}
static void *worker(void *arg)
{
long v = (long)arg;
set min(v);
while (!stop) {
burn(v == 800 ? 300 : 1500);
usleep(100);
}
return arg;
}
int main(void)
{
pthread t t[3];
cpu set t c;
int i;
CPU ZERO(&c);
CPU SET(0, &c);
sched setaffinity(0, sizeof(c), &c);
pthread create(&t[0], NULL, bogus, NULL);
usleep(50000);
pthread create(&t[1], NULL, worker, (void *)500L);
pthread create(&t[2], NULL, worker, (void *)800L);
sleep(15);
stop = 1;
for (i = 0; i < 3; i++)
pthread join(t[i], NULL);
return 0;
}
An LLM helped find the warning and write this patch and its tests.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾