lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 27 May 2008 00:19:32 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Geert Uytterhoeven <geert@...ux-m68k.org>
cc:	Ingo Molnar <mingo@...e.hu>,
	Linux/m68k <linux-m68k@...r.kernel.org>,
	Linux Kernel Development <linux-kernel@...r.kernel.org>
Subject: Re: m68k libc5 regression

On Mon, 26 May 2008, Geert Uytterhoeven wrote:

> Recently I noticed a regression when running an old libc5 binary
> (amiga-lilo) on m68k. It fails with the error message:

Hmm, libc5 is known to make broken assumptions about brk location, that's 
why we introduced CONFIG_COMPAT_BRK, do you have that option turned on?

> So I bisected it to:
> commit 4cc6028d4040f95cdb590a87db478b42b8be0508
> Author: Jiri Kosina <jkosina@...e.cz>
> Date:   Wed Feb 6 22:39:44 2008 +0100
>     brk: check the lower bound properly

Indeed, this should take CONFIG_COMPAT_BRK into account. Does the patch 
below fix it? (assuming that you have CONFIG_COMPAT_BRK=y):



From: Jiri Kosina <jkosina@...e.cz>

brk: check 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@...e.cz>

diff --git a/mm/mmap.c b/mm/mmap.c
index fac6633..834118b 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -245,10 +245,16 @@ asmlinkage unsigned long sys_brk(unsigned long brk)
 	unsigned long rlim, retval;
 	unsigned long newbrk, oldbrk;
 	struct mm_struct *mm = current->mm;
+	unsigned long min_brk;
 
 	down_write(&mm->mmap_sem);
 
-	if (brk < mm->start_brk)
+#ifdef CONFIG_COMPAT_BRK
+	min_brk = mm->end_code;
+#else
+	min_brk = mm->start_brk;
+#endif
+	if (brk < min_brk)
 		goto out;
 
 	/*
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ