lkml.org 
[lkml]   [2004]   [Jan]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 10 Jan 2004 23:38:38 +0100 (CET)
FromMaciej Zenczykowski <>
SubjectRe: [PATCH][RFC] invalid ELF binaries can execute - better sanity checking
> Do you need smaller than this?  :
...
> That's a 100% valid ELF executable, and the entire program is 91 bytes..
> Sure, it doesn't do much useful, and the ELF header and program header
> table is huge overhead compared to the actual program, but that overhead
> is minimal in any program that does any actual work.
> 
> Also, I'm not planning to add anything that disallows anything the ELF
> spec allows, so you can still pull funny tricks like have sections overlap
> and in the above program put _start inside the unused padding bytes in
> e_ident[EI_PAD] if you want.. still a valid program, and not something
> that the checks I'm adding will prevent.
> 
> It you want *really* tiny files then, as some have suggested, anothe
> format could be used.
> In my oppinion, if you claim to be an ELF executable, then you should be a
> *valid* ELF executable.. If you are not a valid elf file but claim to be
> so, then either something corrupted you or the tools that generated you
> are buggy - and you should not be allowed to even attempt to execute - for
> all the reasons I gave in my original mail.

OK, if that 91 is OK, then no problem, I was thinking the minimum would be 
around 1-2 KB (now that I think about it, not really sure why I assumed 
that).  I'm not mad enough to require/want shrinking from 90 to 45 
bytes :) especially since most useful programs have a little more meat to 
them than the 80 bytes worth of header :)

Cheers,
MaZe


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008