RE: [PATCH] Bug fix to ELF Loader which rejects valid ELFs

2020-08-11 Thread Burrow, Ryan - 0553 - MITLL
> -Original Message- > From: Matthew Wilcox > Sent: Tuesday, August 11, 2020 11:05 AM > To: Burrow, Ryan - 0553 - MITLL > Cc: linux-fsde...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] Bug fix to ELF Loader which rejects valid ELFs > > On

Re: [PATCH] Bug fix to ELF Loader which rejects valid ELFs

2020-08-11 Thread Matthew Wilcox
On Tue, Aug 11, 2020 at 02:44:08PM +, Burrow, Ryan - 0553 - MITLL wrote: > /* Sanity check the number of program headers... */ > - /* ...and their total size. */ > - size = sizeof(struct elf_phdr) * elf_ex->e_phnum; > - if (size == 0 || size > 65536 || size > ELF_MIN_ALIGN) >

[PATCH] Bug fix to ELF Loader which rejects valid ELFs

2020-08-11 Thread Burrow, Ryan - 0553 - MITLL
Check was incorrectly being applied to size of elf phdrs, instead of the number. The ELF standard allows for up to 65535 headers, but the check was being compared to the number of headers multiplied by the size of a program header. --- fs/binfmt_elf.c | 6 +++--- 1 file changed, 3 insertions(+),