lkml.org 
[lkml]   [2006]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] x86: Don't randomize stack unless current->personality permits it
    From
    Date
    Al Boldi <a1426z@gawab.com> writes:

    > Frank van Maarseveen wrote:
    > >
    > > Do not randomize stack location unless current->personality permits it.
    > >
    > > Signed-off-by: Frank van Maarseveen <frankvm@frankvm.com>
    > > ---
    > >
    > > The problem seems also present in
    > >
    > > arch/um/kernel/process_kern.c
    > > arch/x86_64/kernel/process.c
    > >
    > > arch/i386/kernel/process.c | 3 ++-
    > > 1 files changed, 2 insertions(+), 1 deletion(-)
    > >
    > > diff -rup a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
    > > --- a/arch/i386/kernel/process.c 2006-06-23 16:08:13.000000000
    > > +0200 +++ b/arch/i386/kernel/process.c 2006-07-11
    > > 14:39:20.000000000 +0200 @@ -38,6 +38,7 @@
    > > #include <linux/kallsyms.h>
    > > #include <linux/ptrace.h>
    > > #include <linux/random.h>
    > > +#include <linux/personality.h>
    > >
    > > #include <asm/uaccess.h>
    > > #include <asm/pgtable.h>
    > > @@ -898,7 +899,7 @@ asmlinkage int sys_get_thread_area(struc
    > >
    > > unsigned long arch_align_stack(unsigned long sp)
    > > {
    > > - if (randomize_va_space)
    > > + if (!(current->personality & ADDR_NO_RANDOMIZE) &&
    > > randomize_va_space) sp -= get_random_int() % 8192;
    > > return sp & ~0xf;
    > > }
    >
    > It still blips on my system.
    >
    > echo 0 > /proc/sys/kernel/randomize_va_space makes the blips go away.
    >
    > ???

    fs/binfmt_elf.c:randomize_stack_top would need the same check
    -Andi
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-07-12 18:05    [W:0.032 / U:29.772 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site