Bug 2347997 (CVE-2022-49554) - CVE-2022-49554 kernel: zsmalloc: fix races between asynchronous zspage free and page migration
Summary: CVE-2022-49554 kernel: zsmalloc: fix races between asynchronous zspage free a...
Keywords:
Status: NEW
Alias: CVE-2022-49554
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-02-26 03:14 UTC by OSIDB Bzimport
Modified: 2025-05-14 17:17 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-02-26 03:14:01 UTC
In the Linux kernel, the following vulnerability has been resolved:

zsmalloc: fix races between asynchronous zspage free and page migration

The asynchronous zspage free worker tries to lock a zspage's entire page
list without defending against page migration.  Since pages which haven't
yet been locked can concurrently migrate off the zspage page list while
lock_zspage() churns away, lock_zspage() can suffer from a few different
lethal races.

It can lock a page which no longer belongs to the zspage and unsafely
dereference page_private(), it can unsafely dereference a torn pointer to
the next page (since there's a data race), and it can observe a spurious
NULL pointer to the next page and thus not lock all of the zspage's pages
(since a single page migration will reconstruct the entire page list, and
create_page_chain() unconditionally zeroes out each list pointer in the
process).

Fix the races by using migrate_read_lock() in lock_zspage() to synchronize
with page migration.

Comment 1 Avinash Hanwate 2025-02-26 19:15:30 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025022616-CVE-2022-49554-bd02@gregkh/T


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