[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070902132847.5fc968b1.akpm@linux-foundation.org>
Date: Sun, 2 Sep 2007 13:28:47 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Franck Bui-Huu <vagabon.xyz@...il.com>
Cc: jkosina@...e.cz, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i386 and x86_64: randomize brk()
> On Sat, 01 Sep 2007 22:19:01 +0200 Franck Bui-Huu <vagabon.xyz@...il.com> wrote:
> Hello Andrew,
>
> Andrew Morton wrote:
> > On Thu, 30 Aug 2007 17:10:03 +0200 (CEST) Jiri Kosina <jkosina@...e.cz> wrote:
> >> Andrew, do you still strongly oppose to having ARCH_HAS_RANDOMIZE_BRK
> >> macro instead please?
> >>
> >
> > Not strongly, but the general opinion seems to be that ARCH_HAS_FOO is
> > sucky. It should at least be done in Kconfig rather than in .h, but even
> > better is just to implement the thing for all architectures.
> >
>
> Sorry for asking again but the initial poster haven't taken time to
> answer to my feedbacks...
>
> What about using a weak function in that case ? It actually gives a
> default implementation in _one_ place and can be changed easily from
> a nop to something more complex later.
Yeah, weak functions are by far the cleanest way of doing this - they're
most elegant. But they do add the overhead of an empty call/return, so
some thought needs to go into the tradeoff.
> Another point is that the current prototype of arch_randomize_brk()
> could be slightly improved IMHO.
>
> The proposed prototype is:
>
> void arch_randomize_brk(void)
>
> and I think it could be:
>
> unsigned long randomize_brk(unsigned long brk)
>
> Because the current code of exec syscall is rather.. hmm "tricky",
> _hiding_ "current" global usage inside this function is error prone:
> if this function is moved later, its use of "current->mm" could
> reference the old mm process and it's hard to notice/fix.
Could be..
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists