CVE-2022-48921

Source
https://cve.org/CVERecord?id=CVE-2022-48921
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48921.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-48921
Downstream
Related
Published
2024-08-22T01:32:53.131Z
Modified
2026-04-02T08:27:08.591182Z
Summary
sched/fair: Fix fault in reweight_entity
Details

In the Linux kernel, the following vulnerability has been resolved:

sched/fair: Fix fault in reweight_entity

Syzbot found a GPF in reweightentity. This has been bisected to commit 4ef0c5c6b5ba ("kernel/sched: Fix schedfork() access an invalid schedtaskgroup")

There is a race between schedpostfork() and setpriority(PRIOPGRP) within a thread group that causes a null-ptr-deref in reweightentity() in CFS. The scenario is that the main process spawns number of new threads, which then call setpriority(PRIOPGRP, 0, -20), wait, and exit. For each of the new threads the copyprocess() gets invoked, which adds the new taskstruct and calls schedpost_fork() for it.

In the above scenario there is a possibility that setpriority(PRIOPGRP) and setoneprio() will be called for a thread in the group that is just being created by copyprocess(), and for which the schedpostfork() has not been executed yet. This will trigger a null pointer dereference in reweight_entity(), as it will try to access the run queue pointer, which hasn't been set.

Before the mentioned change the cfsrq pointer for the task has been set in schedfork(), which is called much earlier in copyprocess(), before the new task is added to the threadgroup. Now it is done in the schedpostfork(), which is called after that. To fix the issue the remove the updateload param from the updateload param() function and call reweighttask() only if the task flag doesn't have the TASKNEW flag set.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48921.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c85c6fadbef0a3eab41540ea628fa8fe8928c820
Fixed
8f317cd888059c59e2fa924bf4b0957cfa53f78e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
3869eecf050416a1d19bac60926f6b5d64b0aa58
Fixed
e0bcd6b5779352aed88f2e538a82a39f1a7715bb
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
4ef0c5c6b5ba1f38f0ea1cedad0cad722f00c14a
Fixed
589a954daab5e18399860b6c8ffaeaf79844eb20
Fixed
13765de8148f71fa795e0a6607de37c49ea5915a
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
25d40b828fb855ee62e1039c65a666c9afd60786

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-48921.json"