mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux1394-devel@lists.sourceforge.net,
	bugme-daemon@bugzilla.kernel.org, linux-kernel@vger.kernel.org,
	Dan Dennedy <dan@dennedy.org>,
	Johannes Weiner <hannes@saeurebad.de>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [Bug 11824][PATCH] ieee1394: raw1394: fix possible deadlock in multithreaded clients
Date: Mon, 27 Oct 2008 14:53:04 +0100	[thread overview]
Message-ID: <4905C7C0.1060301@s5r6.in-berlin.de> (raw)
In-Reply-To: <4905C40F.8080809@s5r6.in-berlin.de>

I wrote:
> .write() and .mmap() were not serialized against each other and against
> .ioctl() at all in raw1394 before 2.6.28-rc1.

PS:  There is a need for serialization to some degree because the client
registers itself with a controller via .write() (among many other things
that are implemented through .write()), manages isochronous I/O contexts
on this controller via .ioctl() and maps DMA buffers for isochronous I/O
via .mmap().

The raw1394 driver tracks respective state by means of two state
variables and some other variables, and accesses of the state variables
is not reentrant within one opener of /dev/raw1394.  AFAICS the issue
exists between .write() and .write(), and independently of that between
.ioctl() and .ioctl() and between .ioctl() and .mmap().

Local mutex protection is the simplest way to fix that --- except that
there is this obscure issue of locking order between the driver's mutex
and the mmap semaphore outside the driver.
-- 
Stefan Richter
-=====-==--- =-=- ==-=-
http://arcgraph.de/sr/

      reply	other threads:[~2008-10-27 13:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-11824-4803@http.bugzilla.kernel.org/>
     [not found] ` <4902F41E.5070306@s5r6.in-berlin.de>
2008-10-26 11:02   ` Stefan Richter
2008-10-27 10:13     ` Ingo Molnar
2008-10-27 13:37       ` Stefan Richter
2008-10-27 13:53         ` Stefan Richter [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=4905C7C0.1060301@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=dan@dennedy.org \
    --cc=hannes@saeurebad.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=mingo@elte.hu \
    /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®