diff options
author | 2018-10-29 07:20:52 +0100 | |
---|---|---|
committer | 2018-10-29 07:20:52 +0100 | |
commit | f0718d792b8a6d4b5ddc929e418ac57cc4897375 (patch) | |
tree | 3dbaa824ce380e99709fae47c047383ca39c983a /fs/exec.c | |
parent | Merge tag 'perf-core-for-mingo-4.20-20181025' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent (diff) | |
parent | i2c-hid: properly terminate i2c_hid_dmi_desc_override_table[] array (diff) | |
download | wireguard-linux-f0718d792b8a6d4b5ddc929e418ac57cc4897375.tar.xz wireguard-linux-f0718d792b8a6d4b5ddc929e418ac57cc4897375.zip |
Merge branch 'linus' into perf/urgent, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c index 1ebf6e5a521d..fc281b738a98 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -908,14 +908,14 @@ int kernel_read_file(struct file *file, void **buf, loff_t *size, goto out; i_size = i_size_read(file_inode(file)); - if (max_size > 0 && i_size > max_size) { - ret = -EFBIG; - goto out; - } if (i_size <= 0) { ret = -EINVAL; goto out; } + if (i_size > SIZE_MAX || (max_size > 0 && i_size > max_size)) { + ret = -EFBIG; + goto out; + } if (id != READING_FIRMWARE_PREALLOC_BUFFER) *buf = vmalloc(i_size); |