lkml.org 
[lkml]   [2021]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fs/binfmt_elf.c: disallow zero entry point address
On Sun, Dec 12, 2021 at 11:35:56AM -0800, Linus Torvalds wrote:
> [ Crossed emails ]
>
> On Sun, Dec 12, 2021 at 11:30 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > On Linux, the start of the first PT_LOAD segment is the ELF
> > header and the address 0 points to the ELF magic bytes which
> > isn't a valid code sequence.
>
> Yeah, then I think a much more valid argument (and patch) is _that_ argument.
>
> So that kind of explanation, along with a patch more along the line of that
>
> if (elf_ex->e_entry < header_sizes)
> goto out;
>
> I suggested, and not talking about paper standards that may or may not
> be relevant.
>
> That would be much more palatable to me - it's a _technical_ argument,
> not a "some paper standard that we clearly have never followed"
> argument.
>
> Linus

I sent out the v2 patch with

if (elf_ex->e_entry < sizeof(*elf_ex))
goto out;


H.J.

\
 
 \ /
  Last update: 2021-12-12 21:44    [W:0.037 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site