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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Sep 2012 21:42:56 +0400
From:	Cyrill Gorcunov <gorcunov@...nvz.org>
To:	Mark Salter <msalter@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Russell King <rmk@....linux.org.uk>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Kees Cook <keescook@...omium.org>,
	linux-kernel@...r.kernel.org,
	Linux-Arch <linux-arch@...r.kernel.org>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Pavel Emelyanov <xemul@...allels.com>
Subject: Re: sys_kcmp (was: Re: [PATCH 1/2] ARM: add finit_module syscall to
 ARM)

On Mon, Sep 24, 2012 at 08:49:42PM +0400, Cyrill Gorcunov wrote:
> > I got past that with:
> > 
> > diff --git a/include/linux/security.h b/include/linux/security.h
> > index 01ef030..14e394d 100644
> > --- a/include/linux/security.h
> > +++ b/include/linux/security.h
> > @@ -118,6 +118,7 @@ void reset_security_ops(void);
> >  extern unsigned long mmap_min_addr;
> >  extern unsigned long dac_mmap_min_addr;
> >  #else
> > +#define mmap_min_addr          0UL
> >  #define dac_mmap_min_addr      0UL
> >  #endif
> > 

I think better to add CONFIG_MMU test here.
---
From: Cyrill Gorcunov <gorcunov@...nvz.org>
Subject: prctl: prctl_set_mm -- Don't test for mmap_min_addr on non-MMU config

In case if CONFIG_MMU is not set the @mmap_min_addr
is undefined leading to build error. Thus test for
it iif CONFIG_MMU is present.

Note this code snippet depends on CONFIG_CHECKPOINT_RESTORE=y.

Reported-by: Mark Salter <msalter@...hat.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@...nvz.org>
---
 kernel/sys.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: linux-2.6.git/kernel/sys.c
===================================================================
--- linux-2.6.git.orig/kernel/sys.c
+++ linux-2.6.git/kernel/sys.c
@@ -1865,7 +1865,11 @@ static int prctl_set_mm(int opt, unsigne
 	if (opt == PR_SET_MM_EXE_FILE)
 		return prctl_set_mm_exe_file(mm, (unsigned int)addr);
 
+#ifdef CONFIG_MMU
 	if (addr >= TASK_SIZE || addr < mmap_min_addr)
+#else
+	if (addr >= TASK_SIZE)
+#endif
 		return -EINVAL;
 
 	error = -EINVAL;
--
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