public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Stefani Seibold <stefani@seibold.net>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Johan Hovold <jhovold@gmail.com>,
	Pete Zaitcev <zaitcev@redhat.com>
Subject: Re: [tip:urgent] fix kfifo_out_locked race bug
Date: Fri, 8 Jan 2010 15:18:47 -0800	[thread overview]
Message-ID: <20100108151847.7fdf0fd8.akpm@linux-foundation.org> (raw)
In-Reply-To: <1262698715.4532.7.camel@wall-e>

On Tue, 05 Jan 2010 14:38:35 +0100
Stefani Seibold <stefani@seibold.net> wrote:

> This patch fix a wrong optimization in include/linux/kfifo.h which could
> cause a race in kfifo_out_locked.
> 
> Please apply it to the 2.6.33-rc* tree.
> 
> Signed-off-by: Stefani Seibold <stefani@seibold.net>
> ---
>  kfifo.h |    7 -------
>  1 file changed, 7 deletions(-)
> 
> --- linux-2.6.33-rc2.orig/include/linux/kfifo.h	2009-12-27
> 23:37:04.921185257 +0100
> +++ kfifo.h	2010-01-05 14:32:31.414316321 +0100
> @@ -228,13 +228,6 @@ static inline __must_check unsigned int 
>  
>  	ret = kfifo_out(fifo, to, n);
>  
> -	/*
> -	 * optimization: if the FIFO is empty, set the indices to 0
> -	 * so we don't wrap the next time
> -	 */
> -	if (kfifo_is_empty(fifo))
> -		kfifo_reset(fifo);
> -
>  	spin_unlock_irqrestore(lock, flags);
>  
>  	return ret;
> 

Thanks.  Some nits:

- the patch is wordwrapped.  I fixed that up.

- you removed the cc's of the particpants in the earlier dicsussion. 
  I restored them here.

- the changelog didn't describe the bug - what was the race??

- I added "Reported-by: Johan Hovold <jhovold@gmail.com>" to the changelog

- the "[tip:urgent]" tag in the Subject: line is something which
  Ingo's patch tools add to outgoing email notifications and wasn't
  appropriate here.  Plain old "[patch]" would be typical.


  reply	other threads:[~2010-01-08 23:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 17:43 USB: serial: kfifo_len locking Johan Hovold
2010-01-04 19:20 ` Stefani Seibold
2010-01-05  7:43   ` Pete Zaitcev
2010-01-05  7:51     ` Stefani Seibold
2010-01-05 11:04     ` Johan Hovold
2010-01-05 11:09       ` Stefani Seibold
2010-01-05 11:14         ` Johan Hovold
2010-01-05 11:25           ` Stefani Seibold
2010-01-05 11:35             ` Johan Hovold
2010-01-05 12:01               ` Stefani Seibold
2010-01-05 12:10                 ` Johan Hovold
2010-01-05 13:30                 ` [tip:urgent] fix USB serial fix " Stefani Seibold
2010-01-05 14:32                   ` Greg KH
2010-01-05 13:38                 ` [tip:urgent] fix kfifo_out_locked race bug Stefani Seibold
2010-01-08 23:18                   ` Andrew Morton [this message]
2010-01-05 17:00         ` USB: serial: kfifo_len locking Pete Zaitcev

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=20100108151847.7fdf0fd8.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jhovold@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefani@seibold.net \
    --cc=zaitcev@redhat.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