This is a note to let you know that I've just added the patch titled pstore/zone: Use GFP_ATOMIC to allocate zone buffer to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: pstore-zone-use-gfp_atomic-to-allocate-zone-buffer.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 99b3b837855b987563bcfb397cf9ddd88262814b Mon Sep 17 00:00:00 2001 From: Qiujun Huang <hqjagain@xxxxxxxxx> Date: Sun, 4 Sep 2022 23:17:13 +0800 Subject: pstore/zone: Use GFP_ATOMIC to allocate zone buffer From: Qiujun Huang <hqjagain@xxxxxxxxx> commit 99b3b837855b987563bcfb397cf9ddd88262814b upstream. There is a case found when triggering a panic_on_oom, pstore fails to dump kmsg. Because psz_kmsg_write_record can't get the new buffer. Handle this by using GFP_ATOMIC to allocate a buffer at lower watermark. Signed-off-by: Qiujun Huang <hqjagain@xxxxxxxxx> Fixes: 335426c6dcdd ("pstore/zone: Provide way to skip "broken" zone for MTD devices") Cc: WeiXiong Liao <gmpy.liaowx@xxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/CAJRQjofRCF7wjrYmw3D7zd5QZnwHQq+F8U-mJDJ6NZ4bddYdLA@xxxxxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/pstore/zone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -761,7 +761,7 @@ static inline int notrace psz_kmsg_write /* avoid destroying old data, allocate a new one */ len = zone->buffer_size + sizeof(*zone->buffer); zone->oldbuf = zone->buffer; - zone->buffer = kzalloc(len, GFP_KERNEL); + zone->buffer = kzalloc(len, GFP_ATOMIC); if (!zone->buffer) { zone->buffer = zone->oldbuf; return -ENOMEM; Patches currently in stable-queue which might be from hqjagain@xxxxxxxxx are queue-5.15/pstore-zone-use-gfp_atomic-to-allocate-zone-buffer.patch