lkml.org 
[lkml]   [2011]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: brk() should check randomize_va_space rather then CONFIG_COMPAT_BRK
From
Jiri Kosina wrote:

> On Mon, 28 Feb 2011, Jiri Kosina wrote:
>
> > how do you avoid race here?
> >
> > More precisely -- randomize_va_space can be changed in runtime, when
> > already running processess have been started with different
> > randomize_va_space value (and thus the shifting of mm->brk already
> > happened in arch_randomize_brk())

I see. So would it help setting mm->brk = mm->start_brk =
mm->end_code if randomize_va_space < 2 in load_elf_binary() (and
elsewhere if needed -- not sure if other binformats are affected)?

> Oh, and also see the commit
>
> commit 5520e89485252c759ee60d313e9422447659947b
> Author: Jiri Kosina <jkosina@suse.cz>
> Date: Thu Jan 13 15:47:23 2011 -0800
>
> brk: fix min_brk lower bound computation for COMPAT_BRK
>
> which is quite relevant here as well

AFAICS, this patch only changes the CONFIG_COMPAT_BRK case. I'm more
interested in the !CONFIG_COMPAT_BRK case (since my old binaries
work with CONFIG_COMPAT_BRK as is). Since e.g., Debian's default
kernel doesn't set CONFIG_COMPAT_BRK, I had hoped I could get them
to run by setting randomize_va_space to 0 or 1.

> (and you seem to be sending patch
> against code that doesn't have this patch applied).

Well, I used the last stable release; I hadn't noticed there was a
more recent change, sorry.

Frank


\
 
 \ /
  Last update: 2011-03-01 06:35    [W:0.159 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site