diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 7bb0deb5bf3b..59013f319f54 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -999,7 +999,7 @@ static int load_elf_binary(struct linux_binprm *bprm) } } k = elf_ppnt->p_vaddr; - if (k < start_code) + if ((elf_ppnt->p_flags & PF_X) && k < start_code) start_code = k; if (start_data < k) start_data = k;