diff options
| author | Pasha Tatashin <[email protected]> | 2022-05-27 02:55:34 +0000 |
|---|---|---|
| committer | akpm <[email protected]> | 2022-06-17 02:58:21 +0000 |
| commit | dabba87229411a5e9d20ac03ffc36463c53ae672 (patch) | |
| tree | 18f5d1a121bb1723e153908378e1feeb4a6253d3 /lib/error-inject.c | |
| parent | include/uapi/linux/swab.h: move explicit cast outside ternary (diff) | |
| download | kernel-dabba87229411a5e9d20ac03ffc36463c53ae672.tar.gz kernel-dabba87229411a5e9d20ac03ffc36463c53ae672.zip | |
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/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Pasha Tatashin <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Greg Thelen <[email protected]>
Cc: Sasha Levin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/error-inject.c')
0 files changed, 0 insertions, 0 deletions
