From: Mike Frysinger <vapier.adi@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: truncate on MAP_SHARED files in ramfs filesystems on no-mmu
Date: Thu, 9 Jul 2009 04:04:31 -0400 [thread overview]
Message-ID: <8bd0f97a0907090104h5d4984dfkbeb82616a01128c8@mail.gmail.com> (raw)
reviewing LTP tests shows mmap09 failing. this test creates a file of
a certain length, opens it and creates a shared mapping, and then
tries various truncate tests:
truncate to a smaller size
truncate to a larger size
truncate to size 0
the first and last fail on no-mmu due to
file-nommu.c:ramfs_nommu_resize() rejecting attempts to shrink on a
shared mapping:
/* check that a decrease in size doesn't cut off any shared mappings */
if (newsize < size) {
ret = ramfs_nommu_check_mappings(inode, newsize, size);
if (ret < 0)
return ret;
}
my question is why ? if an application maps a fd with MAP_SHARED,
truncates it, and then it or someone else who has that fd mapped tries
to access the now-invalid tail end, that is a bug in the application.
i dont see why we should be protecting users here from their own buggy
code ?
-mike
next reply other threads:[~2009-07-09 8:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-09 8:04 Mike Frysinger [this message]
2009-07-09 10:06 ` David Howells
2009-07-09 15:22 ` Mike Frysinger
2009-07-09 16:07 ` David Howells
2009-07-10 16:56 ` Robin Getz
2009-07-10 19:29 ` 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=8bd0f97a0907090104h5d4984dfkbeb82616a01128c8@mail.gmail.com \
--to=vapier.adi@gmail.com \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.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®