mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Hugh Dickins <hugh@veritas.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: mremap() use is racy
Date: Tue, 23 Aug 2005 15:08:05 -0700	[thread overview]
Message-ID: <430B9E45.3080107@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0508231425330.3317@g5.osdl.org>

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

Linus Torvalds wrote:
> Actually, it should be pretty much as valid as using mremap - ie it works 
> on Linux. 
> 
> Especially if you use MAP_SHARED, you don't even need to mprotect 
> anything: you'll get a nice SIGBUS if you ever try to access past the last 
> page that maps the file.

If you guarantee this (and test for this) it's fine with me.  The POSIX
spec explicitly leaves this undefined and requiring to use mremap()
would be a nice way to work around this without allowing the
introduction of undefined behavior into programs.  I probably would
prefer to use mremap() since this makes it clear what should happen but
I can live with using the too-large mapping.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

  reply	other threads:[~2005-08-23 22:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-23 19:53 Ulrich Drepper
2005-08-23 20:45 ` Hugh Dickins
2005-08-23 20:56   ` Ulrich Drepper
2005-08-23 21:28     ` Linus Torvalds
2005-08-23 22:08       ` Ulrich Drepper [this message]
2005-08-23 23:46         ` Hugh Dickins
2005-08-24  0:08         ` Linus Torvalds
2005-08-24 12:00           ` Hugh Dickins

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=430B9E45.3080107@redhat.com \
    --to=drepper@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®