As things stand, the permissions of initial reservations will be based on the prot flags of the first segment of the executable/interpreter. Since both RX and RW segments are typically present, the reservation should rather have RWX permissions. Add appropriate PROT_MAX() flags to obtain the right permissions.
Signed-off-by: Kevin Brodsky kevin.brodsky@arm.com --- fs/binfmt_elf.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 8617b5328197..e52b6adb14b9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -887,6 +887,8 @@ static inline int make_prot(u32 p_flags, struct arch_elf_state *arch_state, if (p_flags & PF_X) prot |= PROT_EXEC;
+ prot |= PROT_MAX(PROT_READ | PROT_WRITE | PROT_EXEC); + return arch_elf_adjust_prot(prot, arch_state, has_interp, is_interp); }