mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
Date: Mon, 29 Nov 2004 23:43:53 -0800	[thread overview]
Message-ID: <20041129234353.378586a9.akpm@osdl.org> (raw)
In-Reply-To: <1101800060.2640.21.camel@laptop.fenrus.org>

Arjan van de Ven <arjan@infradead.org> wrote:
>
> On Mon, 2004-11-29 at 21:38 +0000, Linux Kernel Mailing List wrote:
> > ChangeSet 1.2251, 2004/11/29 13:38:43-08:00, mtk-lkml@gmx.net
> >  
> > -	spin_lock(&shmlock_user_lock);
> > -	locked = size >> PAGE_SHIFT;
> > +	locked = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
> >  	lock_limit = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur;
> >  	lock_limit >>= PAGE_SHIFT;
> > +	spin_lock(&shmlock_user_lock);
> 
> after this change... isn't the use to the
> current->signal->rlim[RLIMIT_MEMLOCK] entirely unlocked and thus racey ?

It always was - we don't modify rlimits under shmlock_user_lock.

If some other thread goes and changes RLIMIT_MEMLOCK under your feet then
this test will use either the old value or the new one, which is to be
expected.

(I get the feeling that I'm missing your point here)


  reply	other threads:[~2004-11-30  7:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200411292204.iATM4o4C005049@hera.kernel.org>
2004-11-30  7:34 ` Arjan van de Ven
2004-11-30  7:43   ` Andrew Morton [this message]
2004-11-30  7:50     ` Arjan van de Ven

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=20041129234353.378586a9.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --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®