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]
Message-ID: <8bd0f97a0804020807o21f69b7due910563b9dad03e8@mail.gmail.com>
Date:	Wed, 2 Apr 2008 11:07:11 -0400
From:	"Mike Frysinger" <vapier.adi@...il.com>
To:	"Bernd Schmidt" <bernds_cb1@...nline.de>
Cc:	"David Howells" <dhowells@...hat.com>,
	"Greg Ungerer" <gerg@...pgear.com>,
	"David McCullough" <David_Mccullough@...urecomputing.com>,
	LKML <linux-kernel@...r.kernel.org>,
	"Bryan Wu" <Bryan.Wu@...log.com>,
	"Robin Getz" <rgetz@...ckfin.uclinux.org>
Subject: Re: nommu: handling anonymous mmap clearing in userspace rather than kernel

On Wed, Apr 2, 2008 at 11:03 AM, Bernd Schmidt <bernds_cb1@...nline.de> wrote:
> Mike Frysinger wrote:
> > On Wed, Apr 2, 2008 at 10:20 AM, David Howells <dhowells@...hat.com>
> > > Mike Frysinger <vapier.adi@...il.com> wrote:
> > >  > a workaround: introduce a new no-mmu-only mmap flag MAP_UNINITIALIZE
> > >  > to signal to the kernel that it should skip the memset().  this way,
> > >  > userspace malloc() can do mmap(MAP_ANONYMOUS|MAP_UNINITIALIZE) to get
> > >  > large chunks of memory without affecting any other anonymous mmap()
> > >  > call.
> > >
> > >  I think that's reasonable for NOMMU.  It's not like the process
> accessing the
> > >  uninitialised memory is prevented from accessing anything it wants to
> anyway.
> > >
> > >  I would vote that the memset() should only be skipped if requested as
> there
> > >  may be programs that call mmap(MAP_ANONYMOUS) expecting the memory
> they're
> > >  given to be zeroed out.
> >
> > in the second proposal, the C library would be expected to do this, so
> > no programs would be broken.  but you're right that any program that
> > invokes the mmap() syscall directly would not get zeroed memory ...
> > but is anyone doing such a crazy thing, let alone on embedded ?
>
>  It's not a guarantee we should break.  What's wrong with just using the
> MAP_UNINITIALIZE code we have?

i outlined the benefits of doing it in userspace in my first e-mail.
i also expected MAP_UNINITIALIZE to be unacceptable to LKML.  and
afaik, there doesnt seem to be a way to distinguish in the kernel
whether the call is coming from userspace or kernel space, so the
memset() call will still be called for the kernel.  ideally the code
would read:
if (!kernel && !(flags & MAP_UNINITIALIZE))
    memset(base, 0, len);
-mike
--
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