brk: make sys_brk() honor COMPAT_BRK when computing lower bound
authorJiri Kosina <[email protected]>
Fri, 6 Jun 2008 05:46:05 +0000 (22:46 -0700)
committerLinus Torvalds <[email protected]>
Fri, 6 Jun 2008 18:29:09 +0000 (11:29 -0700)
commita5b4592cf77b973c29e7c9695873a26052b58951
tree9f2af3014d5d41ddc22d7aa2793b871ee15297d8
parent33dda515a1995dfb3b6b57d7ace9b3ee9d449c11
brk: make sys_brk() honor COMPAT_BRK when computing lower bound

Fix a regression introduced by

commit 4cc6028d4040f95cdb590a87db478b42b8be0508
Author: Jiri Kosina <[email protected]>
Date:   Wed Feb 6 22:39:44 2008 +0100

    brk: check the lower bound properly

The check in sys_brk() on minimum value the brk might have must take
CONFIG_COMPAT_BRK setting into account.  When this option is turned on
(i.e.  we support ancient legacy binaries, e.g.  libc5-linked stuff), the
lower bound on brk value is mm->end_code, otherwise the brk start is
allowed to be arbitrarily shifted.

Signed-off-by: Jiri Kosina <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/mmap.c