Pasha Tatashin dabba87229 fs/kernel_read_file: allow to read files up-to ssize_t
Patch series "Allow to kexec with initramfs larger than 2G", v2.

Currently, the largest initramfs that is supported by kexec_file_load()
syscall is 2G.

This is because kernel_read_file() returns int, and is limited to INT_MAX
or 2G.

On the other hand, there are kexec based boot loaders (i.e.  u-root), that
may need to boot netboot images that might be larger than 2G.

The first patch changes the return type from int to ssize_t in
kernel_read_file* functions.

The second patch increases the maximum initramfs file size to 4G.

Tested: verified that can kexec_file_load() works with 4G initramfs
on x86_64.


This patch (of 2):

Currently, the maximum file size that is supported is 2G.  This may be too
small in some cases.  For example, kexec_file_load() system call loads
initramfs.  In some netboot cases initramfs can be rather large.

Allow to use up-to ssize_t bytes.  The callers still can limit the maximum
file size via buf_size.

Link: https://lkml.kernel.org/r/20220527025535.3953665-1-pasha.tatashin@soleen.com
Link: https://lkml.kernel.org/r/20220527025535.3953665-2-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Baoquan He <bhe@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-16 19:58:21 -07:00
..
2022-05-09 16:21:44 -04:00
2022-05-09 16:21:45 -04:00
2022-05-24 19:55:07 -07:00
2022-06-12 11:05:44 -07:00
2022-05-09 16:21:45 -04:00
2022-05-02 11:23:49 -05:00
2022-06-01 11:54:29 -07:00
2022-05-24 19:55:07 -07:00
2022-06-06 09:53:03 +02:00
2022-05-24 19:55:07 -07:00
2022-05-31 16:52:59 -07:00
2022-06-03 10:34:34 -07:00
2022-05-27 15:49:30 -07:00
2022-05-24 19:55:07 -07:00
2022-05-09 16:21:45 -04:00
2022-05-28 11:27:17 -07:00
2022-05-24 19:55:07 -07:00
2022-05-24 19:55:07 -07:00
2022-06-10 17:28:43 -07:00
2022-05-24 19:55:07 -07:00
\n
2022-05-25 19:29:54 -07:00
2022-06-03 16:57:16 -07:00
2022-05-09 23:12:53 -04:00
2022-05-30 11:19:16 -07:00
2022-05-09 16:21:46 -04:00
2022-05-23 20:24:12 -05:00
2022-05-24 19:55:07 -07:00
2022-05-24 19:55:07 -07:00
2022-05-24 19:55:07 -07:00
2022-06-01 17:23:53 -07:00
2021-11-17 09:26:09 +01:00
2022-03-28 17:29:53 -07:00
2022-05-27 15:49:30 -07:00
2022-05-09 18:20:49 -07:00
2022-06-04 18:52:00 -07:00
2022-04-01 19:35:56 -07:00
2022-06-04 19:07:15 -07:00
2022-04-19 10:19:02 -07:00
2022-05-22 21:03:01 +01:00
2022-04-17 19:49:59 -06:00