diff options
| author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2026-03-27 07:33:59 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-04-11 15:16:37 +0300 |
| commit | a35e45b49418c8f242f078f954813dc53c64dfd9 (patch) | |
| tree | 7e95638c4acefdd206982a8632e786d73a63146b /fs | |
| parent | c1172e65aad4b115392ea4c6e61e56e5b9b69df4 (diff) | |
| download | linux-a35e45b49418c8f242f078f954813dc53c64dfd9.tar.xz | |
erofs: fix PSI memstall accounting
commit 1a2180f6859c73c674809f9f82e36c94084682ba upstream.
Max Kellermann recently reported psi_group_cpu.tasks[NR_MEMSTALL] is
incorrect in the 6.11.9 kernel.
The root cause appears to be that, since the problematic commit, bio
can be NULL, causing psi_memstall_leave() to be skipped in
z_erofs_submit_queue().
Reported-by: Max Kellermann <max.kellermann@ionos.com>
Closes: https://lore.kernel.org/r/CAKPOu+8tvSowiJADW2RuKyofL_CSkm_SuyZA7ME5vMLWmL6pqw@mail.gmail.com
Fixes: 9e2f9d34dd12 ("erofs: handle overlapped pclusters out of crafted images properly")
Reviewed-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20241127085236.3538334-1-hsiangkao@linux.alibaba.com
Signed-off-by: Alexey Panov <apanov@astralinux.ru>
Link: https://lore.kernel.org/r/20250304110558.8315-3-apanov@astralinux.ru
Link: https://lore.kernel.org/r/20250304110558.8315-1-apanov@astralinux.ru
[ Gao Xiang: re-address the previous Alexey's backport. ]
CVE: CVE-2024-47736
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/erofs/zdata.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 0461c41d15b1..66c323cbdd73 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1574,11 +1574,10 @@ drain_io: move_to_bypass_jobqueue(pcl, qtail, owned_head); } while (owned_head != Z_EROFS_PCLUSTER_TAIL); - if (bio) { + if (bio) submit_bio(bio); - if (memstall) - psi_memstall_leave(&pflags); - } + if (memstall) + psi_memstall_leave(&pflags); /* * although background is preferred, no one is pending for submission. |
