Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 353731 - paxctl cant recognize valid ELF file
Summary: paxctl cant recognize valid ELF file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-05 04:51 UTC by Anton Kochkov
Modified: 2011-02-26 13:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
elf executable (dream,38.38 KB, application/octet-stream)
2011-02-05 04:52 UTC, Anton Kochkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2011-02-05 04:51:32 UTC
paxctl can't recognize elf structure in valid elf file:

paxctl -v dream:
dream is not valid ELF executable file

paxctl -C dream:
dream is not valid ELF executable file

but chpax -v dream works ok!

file "dream" attached or can be downloaded from http://www.stripedgazelle.org/cgi-bin/wiki_joey/dream20101104.tar.gz (latest dev-lisp/dream in gentoo-lisp)
Comment 1 Anton Kochkov 2011-02-05 04:52:10 UTC
Created attachment 261555 [details]
elf executable
Comment 2 Francisco Blas Izquierdo Riera (RETIRED) gentoo-dev 2011-02-05 13:24:00 UTC
Just a few insights

gdb nor ldd will open it os i think the problem is either in the file itself or the elf handling libraries.
Comment 3 Anton Kochkov 2011-02-05 13:45:46 UTC
scanelf output:

 TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE 
ET_EXEC PeMRxS 0755 LE --- --- RWX    -      -   LAZY dream 

chpax -v dream output:

----[ chpax 0.7 : Current flags for dream (PeMRxS) ]---- 

 * Paging based PAGE_EXEC       : enabled (overridden) 
 * Trampolines                  : not emulated 
 * mprotect()                   : restricted 
 * mmap() base                  : randomized 
 * ET_EXEC base                 : not randomized 
 * Segmentation based PAGE_EXEC : enabled 
Comment 4 Francisco Blas Izquierdo Riera (RETIRED) gentoo-dev 2011-02-05 13:48:16 UTC
(In reply to comment #3)
> scanelf output:
> 
>  TYPE    PAX   PERM ENDIAN STK/REL/PTL TEXTREL RPATH BIND FILE 
> ET_EXEC PeMRxS 0755 LE --- --- RWX    -      -   LAZY dream 
> 
> chpax -v dream output:
> 
> ----[ chpax 0.7 : Current flags for dream (PeMRxS) ]---- 
> 
>  * Paging based PAGE_EXEC       : enabled (overridden) 
>  * Trampolines                  : not emulated 
>  * mprotect()                   : restricted 
>  * mmap() base                  : randomized 
>  * ET_EXEC base                 : not randomized 
>  * Segmentation based PAGE_EXEC : enabled 

Can you try with "objdump -T dream" for example?

As I'm telling you the problem  is that even recent binutils won't recongise it as a valid ELF file so paxctl won't let you play with ËLF headers (chpax markings work in other ways).
Comment 5 PaX Team 2011-02-05 15:13:17 UTC
the problem is not with paxctl but the ELF executable itself: its e_shoff is not 0 (indicating the presence of section headers) while it has no such headers (e_shnum is 0), this is invalid according to the ELF spec. looking at http://pastebin.com/43ii7J1g i think the correct solution is to simply get rid of section_table_start and related stuff.

PS: next time CC me on paxctl bugs ;)