Skip to contentSkip to conversation

CVE-2026-31567: PM: sleep: Drop spurious WARN_ON() from pm_restore_gfp_mask()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 24

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

PM: sleep: Drop spurious WARN_ON() from pm_restore_gfp_mask()

Commit 35e4a69b2003f ("PM: sleep: Allow pm_restrict_gfp_mask() stacking") introduced refcount-based GFP mask management that warns when pm_restore_gfp_mask() is called with saved_gfp_count == 0.

Some hibernation paths call pm_restore_gfp_mask() defensively where the GFP mask may or may not be restricted depending on the execution path. For example, the uswsusp interface invokes it in SNAPSHOT_CREATE_IMAGE, SNAPSHOT_UNFREEZE, and snapshot_release(). Before the stacking change this was a silent no-op; it now triggers a spurious WARNING.

Remove the WARN_ON() wrapper from the !saved_gfp_count check while retaining the check itself, so that defensive calls remain harmless without producing false warnings.

[ rjw: Subject tweak ]

The Linux kernel CVE team has assigned CVE-2026-31567 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.18 with commit 35e4a69b2003f20a69e7d19ae96ab1eef1aa8e8d and fixed in 6.18.21 with commit 3025ca5daa9d682b629c0c958b538e41deeb559d
	Issue introduced in 6.18 with commit 35e4a69b2003f20a69e7d19ae96ab1eef1aa8e8d and fixed in 6.19.11 with commit f19d1323aa3dd7ead469aef47d9085f8939565d9
	Issue introduced in 6.18 with commit 35e4a69b2003f20a69e7d19ae96ab1eef1aa8e8d and fixed in 7.0 with commit a8d51efb5929ae308895455a3e496b5eca2cd143
	Issue introduced in 6.17.8 with commit 4ddf7293928cb619077724b7d828734da8181e6c

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-31567

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
kernel/power/main.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/3025ca5daa9d682b629c0c958b538e41deeb559d
	https://git.kernel.org/stable/c/f19d1323aa3dd7ead469aef47d9085f8939565d9
	https://git.kernel.org/stable/c/a8d51efb5929ae308895455a3e496b5eca2cd143