On 8/7/21 11:42 AM, Warner Losh wrote:
@@ -367,9 +383,7 @@ static abi_ulong load_elf_interp(struct elfhdr 
*interp_elf_ex,
      last_bss = 0;
      error = 0;
-#ifdef BSWAP_NEEDED
      bswap_ehdr(interp_elf_ex);
-#endif
      /* First of all, some simple consistency checks */
      if ((interp_elf_ex->e_type != ET_EXEC &&
           interp_elf_ex->e_type != ET_DYN) ||

Existing bug here: You should be checking, at minimum, EI_CLASS and EI_DATA before bswap. Otherwise you don't even know you're swapping the correct structure.

I noticed this much later in the series.

r~

Reply via email to