mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
pstore/zone: cap the maximum device size
Introduce an abritrary 128MiB cap to avoid malloc failures when using a larger block device. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: WeiXiong Liao <gmpy.liaowx@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20201016132047.3068029-2-hch@lst.de
This commit is contained in:
parent
3cea11cd5e
commit
cbf82e3503
@ -1299,6 +1299,10 @@ int register_pstore_zone(struct pstore_zone_info *info)
|
||||
pr_warn("total_size must be >= 4096\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (info->total_size > SZ_128M) {
|
||||
pr_warn("capping size to 128MiB\n");
|
||||
info->total_size = SZ_128M;
|
||||
}
|
||||
|
||||
if (!info->kmsg_size && !info->pmsg_size && !info->console_size &&
|
||||
!info->ftrace_size) {
|
||||
|
Loading…
Reference in New Issue
Block a user