linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Mariusz Gorski <marius.gorski@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: panel: Fix single-open policy race condition
Date: Tue, 11 Nov 2014 08:37:12 +0100	[thread overview]
Message-ID: <20141111073712.GD1626@1wt.eu> (raw)
In-Reply-To: <20141105115121.GA2592@firebird>

On Wed, Nov 05, 2014 at 12:51:22PM +0100, Mariusz Gorski wrote:
> On Wed, Nov 05, 2014 at 01:19:10PM +0300, Dan Carpenter wrote:
> > On Tue, Nov 04, 2014 at 10:47:19PM +0100, Mariusz Gorski wrote:
> > > Fix the implementation of a single-open policy for both
> > > devices (lcd and keypad) by using atomic_t instead of plain ints.
> > > 
> > 
> > This seems like it might be a real life bug that you have experienced?
> 
> No, I don't think it might really happen in real life. I found it just
> by reading the code. A similar solution is used in Chapter 6 of the LDD3
> book, so I thought it might be a good idea to fix is here.


BTW, it should be kept in mind that I first wrote this driver on 2.0 or
2.2 and it used to run on an i386. So it's extremely likely that a lot of
locking was missing by then and that until it gets discovered by code
review as Mariusz did, issues may still be present. Note that I'm currently
using this driver on production systems where this issue cannot happen
since a few scripts are allowed to send data to the LCD (which might most
always be the case by design given that nobody wants to build a system
where many scripts send unreadable crap at the same time on the display).

Thanks Mariusz for fixing this.

Willy


      reply	other threads:[~2014-11-11  7:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04 21:47 [PATCH] staging: panel: Fix single-open policy race condition Mariusz Gorski
2014-11-05 10:19 ` Dan Carpenter
2014-11-05 11:51   ` Mariusz Gorski
2014-11-11  7:37     ` Willy Tarreau [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=20141111073712.GD1626@1wt.eu \
    --to=w@1wt.eu \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marius.gorski@gmail.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;
as well as URLs for NNTP newsgroup(s).