brk: make sys_brk() honor COMPAT_BRK when computing lower bound
authorJiri Kosina <jkosina@suse.cz>
Fri, 6 Jun 2008 18:43:23 +0000 (18:43 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 9 Jun 2008 18:27:05 +0000 (11:27 -0700)
commit921b0dbeeecd12729b49c0e9db1b70f5da1b20d3
tree8a7432d0bafe3ab2069012bf316a2d580b39ad4e
parent3dac273cad59097a8ab335958a7c5904f0a99d65
brk: make sys_brk() honor COMPAT_BRK when computing lower bound

upstream commit: a5b4592cf77b973c29e7c9695873a26052b58951

Fix a regression introduced by

commit 4cc6028d4040f95cdb590a87db478b42b8be0508
Author: Jiri Kosina <jkosina@suse.cz>
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 <jkosina@suse.cz>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
mm/mmap.c