Re: [BUG] get_unmapped_area() change -> non booting machine

From: Linus Torvalds
Date: Thu Feb 12 2004 - 12:23:46 EST




On Thu, 12 Feb 2004, Dave McCracken wrote:
>
> So what's a reasonable value for 'not just above' and 'not just below'? We
> could skip the entire hole, which would give us reasonable behavior for the
> brk area, but it wouldn't work so well for the area below the stack. I'm
> sure if we define a 'reasonable' value to skip someone somewhere will
> collide with it.

Well, we have had _exactly_ this issue before, which is why I mentioned
it.

See the HP-PA support code (for "CONFIG_STACK_GROWSUP") for setting up the
stack in such a way that it leaves some empty space above it in fs/exec.c,
for example. There it does

...
/* Limit stack size to 1GB */
stack_base = current->rlim[RLIMIT_STACK].rlim_max;
if (stack_base > (1 << 30))
stack_base = 1 << 30;
stack_base = PAGE_ALIGN(STACK_TOP - stack_base);
...

it it uses RLIMIT_STACK plus a maximum limit (although it's a _big_
maximum limit, much bigger than we'd use for BSS). So we could do
something similar for the BSS, with obviously a smaller hard limit (on a
64-bit architecture a gigabyte is fine, but ..)

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/