Bug 2373560 (CVE-2022-49995) - CVE-2022-49995 kernel: writeback: avoid use-after-free after removing device
Summary: CVE-2022-49995 kernel: writeback: avoid use-after-free after removing device
Keywords:
Status: NEW
Alias: CVE-2022-49995
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: 2025-06-18 12:08 UTC by OSIDB Bzimport
Modified: 2025-06-19 12:29 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-06-18 12:08:17 UTC
In the Linux kernel, the following vulnerability has been resolved:

writeback: avoid use-after-free after removing device

When a disk is removed, bdi_unregister gets called to stop further
writeback and wait for associated delayed work to complete.  However,
wb_inode_writeback_end() may schedule bandwidth estimation dwork after
this has completed, which can result in the timer attempting to access the
just freed bdi_writeback.

Fix this by checking if the bdi_writeback is alive, similar to when
scheduling writeback work.

Since this requires wb->work_lock, and wb_inode_writeback_end() may get
called from interrupt, switch wb->work_lock to an irqsafe lock.

Comment 1 Avinash Hanwate 2025-06-19 12:19:58 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025061826-CVE-2022-49995-2d74@gregkh/T


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