CVE-2022-48921

Severity CVSS v4.0:
Pending analysis
Type:
CWE-362 Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Publication date:
22/08/2024
Last modified:
12/09/2024

Description

In the Linux kernel, the following vulnerability has been resolved:<br /> <br /> sched/fair: Fix fault in reweight_entity<br /> <br /> Syzbot found a GPF in reweight_entity. This has been bisected to<br /> commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid<br /> sched_task_group")<br /> <br /> There is a race between sched_post_fork() and setpriority(PRIO_PGRP)<br /> within a thread group that causes a null-ptr-deref in<br /> reweight_entity() in CFS. The scenario is that the main process spawns<br /> number of new threads, which then call setpriority(PRIO_PGRP, 0, -20),<br /> wait, and exit. For each of the new threads the copy_process() gets<br /> invoked, which adds the new task_struct and calls sched_post_fork()<br /> for it.<br /> <br /> In the above scenario there is a possibility that<br /> setpriority(PRIO_PGRP) and set_one_prio() will be called for a thread<br /> in the group that is just being created by copy_process(), and for<br /> which the sched_post_fork() has not been executed yet. This will<br /> trigger a null pointer dereference in reweight_entity(), as it will<br /> try to access the run queue pointer, which hasn&amp;#39;t been set.<br /> <br /> Before the mentioned change the cfs_rq pointer for the task has been<br /> set in sched_fork(), which is called much earlier in copy_process(),<br /> before the new task is added to the thread_group. Now it is done in<br /> the sched_post_fork(), which is called after that. To fix the issue<br /> the remove the update_load param from the update_load param() function<br /> and call reweight_task() only if the task flag doesn&amp;#39;t have the<br /> TASK_NEW flag set.

Vulnerable products and versions

CPE From Up to
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.10.80 (including) 5.10.137 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.14.19 (including) 5.15 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.15.3 (including) 5.15.27 (excluding)
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.16 (including) 5.16.13 (excluding)
cpe:2.3:o:linux:linux_kernel:5.17:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.17:rc2:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:5.17:rc3:*:*:*:*:*:*