Skip to content
Snippets Groups Projects

CVE-2025-21786: workqueue: Put the pwq after detaching the rescuer from the pool

JIRA: https://issues.redhat.com/browse/RHEL-81472
CVE: CVE-2025-21786

commit e76946110137703c16423baf6ee177b751a34b7e
Author: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Date:   Thu Jan 23 16:25:35 2025 +0800

    workqueue: Put the pwq after detaching the rescuer from the pool
    
    The commit 68f83057b913("workqueue: Reap workers via kthread_stop() and
    remove detach_completion") adds code to reap the normal workers but
    mistakenly does not handle the rescuer and also removes the code waiting
    for the rescuer in put_unbound_pool(), which caused a use-after-free bug
    reported by Cheung Wall.
    
    To avoid the use-after-free bug, the pool’s reference must be held until
    the detachment is complete. Therefore, move the code that puts the pwq
    after detaching the rescuer from the pool.
    
    Reported-by: cheung wall <zzqq0103.hey@gmail.com>
    Cc: cheung wall <zzqq0103.hey@gmail.com>
    Link: https://lore.kernel.org/lkml/CAKHoSAvP3iQW+GwmKzWjEAOoPvzeWeoMO0Gz7Pp3_4kxt-RMoA@mail.gmail.com/
    Fixes: 68f83057b913("workqueue: Reap workers via kthread_stop() and remove detach_completion")
    Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>```

Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>

---

<small>Created 2025-02-27 22:46 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small>

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading