Re: CVE-2022-48921: sched/fair: Fix fault in reweight_entity
From: Xia Fukun
Date: Sat Aug 24 2024 - 05:52:45 EST
On 2024/8/22 11:31, Greg Kroah-Hartman wrote:
> Description
> ===========
>
> In the Linux kernel, the following vulnerability has been resolved:
>
> sched/fair: Fix fault in reweight_entity
>
> Syzbot found a GPF in reweight_entity. This has been bisected to
> commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid
> sched_task_group")
>
> There is a race between sched_post_fork() and setpriority(PRIO_PGRP)
> within a thread group that causes a null-ptr-deref in
> reweight_entity() in CFS. The scenario is that the main process spawns
> number of new threads, which then call setpriority(PRIO_PGRP, 0, -20),
> wait, and exit. For each of the new threads the copy_process() gets
> invoked, which adds the new task_struct and calls sched_post_fork()
> for it.
>
>
> The Linux kernel CVE team has assigned CVE-2022-48921 to this issue.
>
Commit 13765de8148f ("sched/fair: Fix fault in reweight_entity")
is reverted by commit b1e8206582f9 ("sched: Fix yet more sched_fork()
races"). Since commit 13765de8148f only fixes a single instance
of this problem, not the whole class.
I think the CVE-2022-48921 needs to adjust the corresponding commit
to commit b1e8206582f9 ("sched: Fix yet more sched_fork() races").