mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Manfred Spraul <manfred@colorfullife.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Yuriy Yevtukhov <yuriy@ucoz.com>, Harald Laabs <kernelml@dasr.de>
Subject: Re: [PATCH] [ipc/sem.c] fix race with concurrent semtimedop() timeouts and IPC_RMID
Date: Thu, 21 Jul 2011 10:12:11 +0200	[thread overview]
Message-ID: <1311235931.2422.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <20110720235836.c40ec351.akpm@linux-foundation.org>

Le mercredi 20 juillet 2011 à 23:58 -0700, Andrew Morton a écrit :
> On Thu, 21 Jul 2011 08:42:53 +0200 Manfred Spraul <manfred@colorfullife.com> wrote:
> 
> > If a semaphore array is removed and in parallel a sleeping task is woken up
> > (signal or timeout, does not matter), then the woken up task does not wait
> > until wake_up_sem_queue_do() is completed. This will cause crashes, because
> > wake_up_sem_queue_do() will read from a stale pointer.
> > 
> > The fix is simple: Regardless of anything, always call get_queue_result().
> > This function waits until wake_up_sem_queue_do() has finished it's task.
> > 
> > Andrew, could you please take care of merging the patch?
> 
> yup, thanks for this.  It's good to hear from you, and that you've
> still got what it takes :)
> 
> Do you know how long this bug has been around for?  Somewhere between
> 2.6.32 and 2.6.36, but that a large interval!

As I said, bug was introduced in commit
0a2b9d4c79671b05956806ede5d054e03ae56280
(ipc/sem.c: move wake_up_process out of the spinlock section)

(so first faulty kernel version is 2.6.35)

Please also add this bugzilla reference :

 https://bugzilla.kernel.org/show_bug.cgi?id=27142

Reported-by: Harald Laabs <kernelml@dasr.de>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>




      reply	other threads:[~2011-07-21  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21  6:42 Manfred Spraul
2011-07-21  6:58 ` Andrew Morton
2011-07-21  8:12   ` Eric Dumazet [this message]

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=1311235931.2422.5.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernelml@dasr.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=yuriy@ucoz.com \
    /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®