All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bernds_cb1@t-online.de>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: David Howells <dhowells@redhat.com>,
	Greg Ungerer <gerg@snapgear.com>,
	David McCullough <David_Mccullough@securecomputing.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Bryan Wu <Bryan.Wu@analog.com>,
	Robin Getz <rgetz@blackfin.uclinux.org>
Subject: Re: nommu: handling anonymous mmap clearing in userspace rather than kernel
Date: Wed, 02 Apr 2008 17:03:07 +0200	[thread overview]
Message-ID: <47F3A02B.5070302@t-online.de> (raw)
In-Reply-To: <8bd0f97a0804020747r2d7c2802pa18cf08eced3821b@mail.gmail.com>

Mike Frysinger wrote:
> On Wed, Apr 2, 2008 at 10:20 AM, David Howells <dhowells@redhat.com> wrote:
>> Mike Frysinger <vapier.adi@gmail.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?


Bernd
-- 
This footer brought to you by insane German lawmakers.
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft Muenchen, Registergericht Muenchen HRB 40368
Geschaeftsfuehrer Thomas Wessel, William A. Martin, Margaret Seif

  reply	other threads:[~2008-04-02 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-01 21:34 nommu: handling anonymous mmap clearing in userspace rather than kernel Mike Frysinger
2008-04-02 14:20 ` David Howells
2008-04-02 14:47   ` Mike Frysinger
2008-04-02 15:03     ` Bernd Schmidt [this message]
2008-04-02 15:07       ` Mike Frysinger
2008-04-03 11:06         ` Bernd Schmidt
2008-04-03 13:14           ` David Howells
2008-04-03 14:46           ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47F3A02B.5070302@t-online.de \
    --to=bernds_cb1@t-online.de \
    --cc=Bryan.Wu@analog.com \
    --cc=David_Mccullough@securecomputing.com \
    --cc=dhowells@redhat.com \
    --cc=gerg@snapgear.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgetz@blackfin.uclinux.org \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.