[PATCH 2/2] Make the EF_AS_NO_RANDOM e_flag bit disable PF_RANDOMIZE

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Samium Gromoff
Date: Tuesday, January 23, 2007 - 1:31 pm

Author: Samium Gromoff <deepfire@betelheise.deep.net>
Date:   Tue Jan 23 23:12:16 2007 +0300

    load_elf_binary: do not set PF_RANDOMIZE if the ELF file has EF_AS_NO_RANDOM s
et

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 7cb2872..007dedd 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -780,7 +780,8 @@ static int load_elf_binary(struct linux_binprm *bprm, struct p
t_regs *regs)
        if (elf_read_implies_exec(loc->elf_ex, executable_stack))
                current->personality |= READ_IMPLIES_EXEC;
 
-       if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
+       if (!(current->personality & ADDR_NO_RANDOMIZE) &&
+           !(loc->elf_ex.e_flags & EF_AS_NO_RANDOM) && randomize_va_space)
                current->flags |= PF_RANDOMIZE;
        arch_pick_mmap_layout(current->mm);
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Undo some of the pseudo-security madness, Samium Gromoff, (Sun Jan 21, 4:23 pm)
Re: [PATCH] Undo some of the pseudo-security madness, Valdis.Kletnieks, (Mon Jan 22, 8:20 am)
Re: [PATCH] Undo some of the pseudo-security madness, Samium Gromoff, (Mon Jan 22, 10:39 am)
Re: [PATCH] Undo some of the pseudo-security madness, Pavel Machek, (Tue Jan 23, 1:48 am)
Re: [PATCH] Undo some of the pseudo-security madness, Samium Gromoff, (Tue Jan 23, 7:03 am)
[PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Samium Gromoff, (Tue Jan 23, 1:28 pm)
[PATCH 2/2] Make the EF_AS_NO_RANDOM e_flag bit disable PF ..., Samium Gromoff, (Tue Jan 23, 1:31 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Jakub Jelinek, (Tue Jan 23, 1:50 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Samium Gromoff, (Tue Jan 23, 2:06 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Jakub Jelinek, (Tue Jan 23, 2:16 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Samium Gromoff, (Tue Jan 23, 2:54 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Samium Gromoff, (Tue Jan 23, 4:21 pm)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Pavel Machek, (Wed Jan 24, 10:08 am)
Re: [PATCH 1/2] Define the EF_AS_NO_RANDOM e_flag bit, Arjan van de Ven, (Sun Jan 28, 6:18 pm)
Re: [PATCH] Undo some of the pseudo-security madness, Arjan van de Ven, (Wed Jan 31, 2:59 am)
Re: [PATCH] Undo some of the pseudo-security madness, Florian Weimer, (Thu Feb 1, 1:05 am)
Re: [PATCH] Undo some of the pseudo-security madness, Florian Weimer, (Sat Feb 24, 2:51 am)
Re: [PATCH] Undo some of the pseudo-security madness, Samium Gromoff, (Sat Feb 24, 6:36 am)