linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
       [not found] <200411292204.iATM4o4C005049@hera.kernel.org>
@ 2004-11-30  7:34 ` Arjan van de Ven
  2004-11-30  7:43   ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Arjan van de Ven @ 2004-11-30  7:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: akpm

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 ?
-- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
  2004-11-30  7:34 ` [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken Arjan van de Ven
@ 2004-11-30  7:43   ` Andrew Morton
  2004-11-30  7:50     ` Arjan van de Ven
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2004-11-30  7:43 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel

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)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken
  2004-11-30  7:43   ` Andrew Morton
@ 2004-11-30  7:50     ` Arjan van de Ven
  0 siblings, 0 replies; 3+ messages in thread
From: Arjan van de Ven @ 2004-11-30  7:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Mon, 2004-11-29 at 23:43 -0800, Andrew Morton wrote:

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

it's more that I'm missing my own point due to lack of caffeine at 9am

-- 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-30  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200411292204.iATM4o4C005049@hera.kernel.org>
2004-11-30  7:34 ` [PATCH] RLIMIT_MEMLOCK accounting of shmctl() SHM_LOCK is broken Arjan van de Ven
2004-11-30  7:43   ` Andrew Morton
2004-11-30  7:50     ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).