{"id":"CVE-2026-143085","summary":"sched_ext: Fix stale pick when the donor changes during dispatch","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nsched_ext: Fix stale pick when the donor changes during dispatch\n\nDispatch takes rq-\u003edonor as @prev and can drop the rq lock. With proxy\nexecution, @prev may not be the running task, and another CPU can reset the\ndonor to rq-\u003ecurr meanwhile, through proxy_needs_return() on a wakeup or\nsched_proxy_block_task() on a class or scheduler change. The wakeup case:\n\n1. dispatch_one() drops the rq lock, e.g. to move a task from another CPU.\n2. Another CPU wakes the donor, which proxy execution migrated to this CPU.\n   proxy_needs_return() dequeues it and resets the donor to rq-\u003ecurr, and\n   the wakeup enqueues it, possibly on another CPU.\n3. dispatch_one() sees @prev queued and returns SCX_DSP_PREV.\n4. do_pick_task_scx() returns @prev, and this CPU runs a task that is queued\n   on another rq.\n\nUnder core scheduling, the core pick runs dispatch for the sibling rqs with\neach sibling's donor as @prev, and a sibling can switch @prev out while\ndispatch has the lock dropped.\n\nWhatever dispatch concluded, and whatever it does with @prev after the drop,\nis about a task the rq no longer owns, whether it keeps @prev running or\nhands it to ops.dispatch().\n\nrq_modified_above() catches the change only when rq-\u003ecurr is in a class\nabove ext, and the dl_server pick skips that check. dispatch_core_pick()\nretries after a lock drop, but by then dispatch has used @prev.\n\nRestart the pick when @prev is no longer the donor. dispatch_one() tests\nafter each step that can drop the lock, and scx_dispatch_sched() decides per\nops.dispatch() call whether to hand @prev over, which also covers a class or\nscheduler change across a drop.\n\nWith proxy execution alone, the donor only ever changes to rq-\u003ecurr during a\npick, so the retried pick can't go stale again. Under core scheduling, the\nrestart goes through the core pick, which already retries after any lock\ndrop.\n\n7a3a6bfbd62a (\"sched: Rework prev_balance() to avoid stale prev references\")\nclosed the same window in prev_balance() by reading rq-\u003edonor instead of\ntaking @prev. That doesn't work here, as dispatch never evaluated the new\ndonor, which may not even be a sched_ext task.\n\nVerified with synthetic reproducers for both cases.\n\nv2: Also cover rq lock drops inside dispatch (sashiko).\n\nv3: Don't keep a stale @prev after ops.dispatch() (sashiko).\n\nv4: Also cover a sibling switching @prev out under core scheduling. Retitle.","modified":"2026-12-03T11:01:17.494729233Z","published":"2026-12-03T09:19:06.531Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143085.json","cna_assigner":"Linux"},"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/9ce6fca02867911ba79bc3664219effe8c7be8f4"},{"type":"WEB","url":"https://git.kernel.org/stable/c/b88438530ee3978b1d3f24576c4f508be2b30b82"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143085.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143085"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7b0888b7cc1924b74ce660e02f6211df8dd46e7b"},{"fixed":"b88438530ee3978b1d3f24576c4f508be2b30b82"},{"fixed":"9ce6fca02867911ba79bc3664219effe8c7be8f4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143085.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.12.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143085.json"}}],"schema_version":"1.9.2"}