]> git.baikalelectronics.ru Git - kernel.git/commit
kexec_file: increase maximum file size to 4G
authorPasha Tatashin <pasha.tatashin@soleen.com>
Fri, 27 May 2022 02:55:35 +0000 (02:55 +0000)
committerakpm <akpm@linux-foundation.org>
Fri, 17 Jun 2022 02:58:21 +0000 (19:58 -0700)
commit96c3d94a14c6843c288737698792449d6b619272
tree43935c8bf06b673b322197fb93d646db481cc996
parent3554be9a11c4d2af408a0cf9b7b12a948677fafb
kexec_file: increase maximum file size to 4G

In some case initrd can be large.  For example, it could be a netboot
image loaded by u-root, that is kexec'ing into it.

The maximum size of initrd is arbitrary set to 2G.  Also, the limit is not
very obvious because it is hidden behind a generic INT_MAX macro.

Theoretically, we could make it LONG_MAX, but it is safer to keep it sane,
and just increase it to 4G.

Increase the size to 4G, and make it obvious by having a new macro that
specifies the maximum file size supported by kexec_file_load() syscall:
KEXEC_FILE_SIZE_MAX.

Link: https://lkml.kernel.org/r/20220527025535.3953665-3-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Sasha Levin <sashal@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/kexec_file.c