Bug 2320683 (CVE-2022-48950) - CVE-2022-48950 kernel: perf: Fix perf_pending_task() UaF
Summary: CVE-2022-48950 kernel: perf: Fix perf_pending_task() UaF
Keywords:
Status: NEW
Alias: CVE-2022-48950
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-10-21 21:02 UTC by OSIDB Bzimport
Modified: 2025-01-02 18:27 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-10-21 21:02:34 UTC
In the Linux kernel, the following vulnerability has been resolved:

perf: Fix perf_pending_task() UaF

Per syzbot it is possible for perf_pending_task() to run after the
event is free()'d. There are two related but distinct cases:

 - the task_work was already queued before destroying the event;
 - destroying the event itself queues the task_work.

The first cannot be solved using task_work_cancel() since
perf_release() itself might be called from a task_work (____fput),
which means the current->task_works list is already empty and
task_work_cancel() won't be able to find the perf_pending_task()
entry.

The simplest alternative is extending the perf_event lifetime to cover
the task_work.

The second is just silly, queueing a task_work while you know the
event is going away makes no sense and is easily avoided by
re-arranging how the event is marked STATE_DEAD and ensuring it goes
through STATE_OFF on the way down.

Comment 1 Avinash Hanwate 2024-10-22 08:14:49 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024102141-CVE-2022-48950-dc5f@gregkh/T

Comment 3 Avinash Hanwate 2024-10-22 12:42:24 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024102141-CVE-2022-48950-dc5f@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.