[lkml]   [2007]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] i386 and x86_64: randomize brk()
Hello Andrew,

Andrew Morton wrote:
> On Thu, 30 Aug 2007 17:10:03 +0200 (CEST) Jiri Kosina <> 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.

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.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-09-01 22:23    [W:0.083 / U:2.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site