summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2020-01-31 07:17:07 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-31 19:30:41 +0100
commit28f46656ad18534f4488590b5447ec48b954420d (patch)
treef4c01e8fafd47e2ba3bfee45c3b905cc79127da8 /fs/binfmt_elf.c
parentfs/binfmt_elf.c: coredump: allocate core ELF header on stack (diff)
downloadlinux-28f46656ad18534f4488590b5447ec48b954420d.tar.xz
linux-28f46656ad18534f4488590b5447ec48b954420d.zip
fs/binfmt_elf.c: coredump: delete duplicated overflow check
array_size() macro will do overflow check anyway. Link: http://lkml.kernel.org/r/20191222144009.GB24341@avx2 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 6bf11c1d3b0f..abd10707826a 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -2257,8 +2257,6 @@ static int elf_core_dump(struct coredump_params *cprm)
dataoff = offset = roundup(offset, ELF_EXEC_PAGESIZE);
- if (segs - 1 > ULONG_MAX / sizeof(*vma_filesz))
- goto end_coredump;
vma_filesz = kvmalloc(array_size(sizeof(*vma_filesz), (segs - 1)),
GFP_KERNEL);
if (ZERO_OR_NULL_PTR(vma_filesz))