From: "Michael Kerrisk" <michael.kerrisk@gmx.net>
To: Andrew Morton <akpm@osdl.org>
Cc: mtk-lkml@gmx.net, torvalds@osdl.org,
linux-kernel@vger.kernel.org, manfred@colorfullife.com,
hugh@veritas.com
Subject: Re: [PATCH 2.6.10-rc2] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
Date: Tue, 23 Nov 2004 18:55:22 +0100 (MET) [thread overview]
Message-ID: <14793.1101232522@www8.gmx.net> (raw)
In-Reply-To: <20041123090449.1672494f.akpm@osdl.org>
> "Michael Kerrisk" <mtk-lkml@gmx.net> wrote:
> >
> > The accounting of shmctl() SHM_LOCK memory locks against the
> > user structure is broken. The problem is that the check
> > of the size of the to-be-locked region is based on
> > the size of the segment as specified when it was created
> > by shmget() (this size is *not* rounded up to a page
> > boundary). This size is then rounded down (>> PAGE_SHIFT)
> > to PAGE_SIZE during the check in
> > mm/mlock.c::user_shm_lock().
>
> True. We should make the same change to user_shm_unlock(), and we may as
> well tweak the excessive spinlock coverage in there too.
Thanks for the confirmation Andrew.
[...]
> and then ask Hugh and Manfred to double-check.
>
> Looking at the callers, we do:
>
> user_shm_lock(inode->i_size, ...);
>
> then, later:
>
> user_shm_unlock(inode->i_size, ...);
>
> which does make one wonder "what happens if the file got larger while it
> was locked"?
Not sure if I'm missing your point, but, just considering it from
the point of view of System V shared memory, the segment can't
change in size after it has been created.
Cheers,
Michael
--
Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD
++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++
next prev parent reply other threads:[~2004-11-23 18:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 16:36 Michael Kerrisk
2004-11-23 17:04 ` Andrew Morton
2004-11-23 17:55 ` Michael Kerrisk [this message]
2004-11-23 18:31 ` Hugh Dickins
2004-11-24 20:14 ` Further shmctl() SHM_LOCK strangeness Michael Kerrisk
2004-11-24 21:41 ` Hugh Dickins
2004-11-25 3:17 ` Rik van Riel
2004-11-25 8:50 ` Michael Kerrisk
2004-11-25 11:40 ` Rik van Riel
2004-11-25 12:45 ` Michael Kerrisk
2004-11-25 14:42 ` Rik van Riel
2004-11-25 16:30 ` Michael Kerrisk
2004-11-25 8:45 ` Michael Kerrisk
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=14793.1101232522@www8.gmx.net \
--to=michael.kerrisk@gmx.net \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=mtk-lkml@gmx.net \
--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®