lkml.org 
[lkml]   [2008]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] parport/ppdev: fix registration of sysctl entries
On Sat, Jul 05, 2008 at 03:21:06PM +0200, Marcin Slusarz wrote:
> ppdev (which provides support for user-space parallel port device drivers)
> is slightly different from other parallel port drivers. It allows to open
> the device by more than one process, but locks the device on ioctl (PPCLAIM).
> Unfortunately registration of sysctl entries were done before locking
> the device, so 2 processes could open it and try to register sysctl
> (it ignored error on registration, so it didn't block access to port).
>
> So move registration of sysctl after locking (parport_claim_or_block).

I don't believe that it's right. Note that if you *do* race there, you
are fucked regardless of sysctls - ppdev.c::register_device() racing
with itself will do tons of fun things all by itself (starting with two
threads allocating different pdev and both setting pp->pdev).

IOW, *if* that's what we are hitting here, you've only papered over the
visible symptom.


\
 
 \ /
  Last update: 2008-07-06 01:55    [W:0.068 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site