You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mm: zswap: move allocations during CPU init outside the lock
JIRA: https://issues.redhat.com/browse/RHEL-78678
CVE: CVE-2025-21693
Conflicts:
* differences in the 2nd and 3rd hunks in this backport are due to RHEL9
missing upstream commits 6c303f1 ("crypto: introduce: acomp_is_async
to expose if comp drivers might sleep") and 270700d ("mm/zswap: remove
the memcpy if acomp is not sleepable"), which are not required for the sake
of this work correctness.
commit 779b995
Author: Yosry Ahmed <[email protected]>
Date: Mon Jan 13 21:44:58 2025 +0000
mm: zswap: move allocations during CPU init outside the lock
In zswap_cpu_comp_prepare(), allocations are made and assigned to various
members of acomp_ctx under acomp_ctx->mutex. However, allocations may
recurse into zswap through reclaim, trying to acquire the same mutex and
deadlocking.
Move the allocations before the mutex critical section. Only the
initialization of acomp_ctx needs to be done with the mutex held.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 12dcb0e ("mm: zswap: properly synchronize freeing resources during CPU hotunplug")
Signed-off-by: Yosry Ahmed <[email protected]>
Reviewed-by: Chengming Zhou <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Nhat Pham <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Rafael Aquini <[email protected]>
0 commit comments