Re: [PATCH v2] fs: binfmt_elf: Add ELF header consistency checks

2013-11-22 Thread Geyslan Gregório Bem
2013/11/21 Geyslan Gregório Bem : > 2013/11/20 Al Viro : >> On Wed, Nov 20, 2013 at 09:34:31PM -0300, Geyslan G. Bem wrote: >>> The member 'e_ehsize' that holds the ELF header size is compared >>> with the elfhdr struct size. If not equal, goes out. >>> If 'e_phoff' holds 0 the object has no progra

Re: [PATCH v2] fs: binfmt_elf: Add ELF header consistency checks

2013-11-21 Thread Geyslan Gregório Bem
2013/11/20 Al Viro : > On Wed, Nov 20, 2013 at 09:34:31PM -0300, Geyslan G. Bem wrote: >> The member 'e_ehsize' that holds the ELF header size is compared >> with the elfhdr struct size. If not equal, goes out. >> If 'e_phoff' holds 0 the object has no program header table, so >> goes out. >> Ensur

Re: [PATCH v2] fs: binfmt_elf: Add ELF header consistency checks

2013-11-20 Thread Al Viro
On Wed, Nov 20, 2013 at 09:34:31PM -0300, Geyslan G. Bem wrote: > The member 'e_ehsize' that holds the ELF header size is compared > with the elfhdr struct size. If not equal, goes out. > If 'e_phoff' holds 0 the object has no program header table, so > goes out. > Ensures the file being loaded has

[PATCH v2] fs: binfmt_elf: Add ELF header consistency checks

2013-11-20 Thread Geyslan G. Bem
The member 'e_ehsize' that holds the ELF header size is compared with the elfhdr struct size. If not equal, goes out. If 'e_phoff' holds 0 the object has no program header table, so goes out. Ensures the file being loaded has the correct data encoding, checking 'e_ident[EI_DATA]' against 'ELF_DATA'