projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74b0a2f
)
pstore/zone: Use GFP_ATOMIC to allocate zone buffer
author
Qiujun Huang
<hqjagain@gmail.com>
Sun, 4 Sep 2022 15:17:13 +0000
(23:17 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:58:46 +0000
(11:58 +0100)
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@gmail.com>
Fixes:
335426c6dcdd
("pstore/zone: Provide way to skip "broken" zone for MTD devices")
Cc: WeiXiong Liao <gmpy.liaowx@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link:
https://lore.kernel.org/r/CAJRQjofRCF7wjrYmw3D7zd5QZnwHQq+F8U-mJDJ6NZ4bddYdLA@mail.gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/pstore/zone.c
patch
|
blob
|
history
diff --git
a/fs/pstore/zone.c
b/fs/pstore/zone.c
index
7c8f8fe
..
5d3f944
100644
(file)
--- a/
fs/pstore/zone.c
+++ b/
fs/pstore/zone.c
@@
-761,7
+761,7
@@
static inline int notrace psz_kmsg_write_record(struct psz_context *cxt,
/* 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;