lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 9 Mar 2010 22:20:15 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
Cc:	Arnd Bergmann <arnd@...db.de>, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org, John Kacur <jkacur@...il.com>
Subject: Re: [PATCH 2/3] input: use input_mutex instead of BKL when opening
 input device

On Tue, Mar 09, 2010 at 05:59:48PM -0300, Thadeu Lima de Souza Cascardo wrote:
> On Tue, Mar 09, 2010 at 09:12:13PM +0100, Arnd Bergmann wrote:
> > On Tuesday 09 March 2010, Thadeu Lima de Souza Cascardo wrote:
> > >  MODULE_AUTHOR("Vojtech Pavlik <vojtech@...e.cz>");
> > > @@ -1881,7 +1880,7 @@ static int input_open_file(struct inode *inode, struct file *file)
> > >         const struct file_operations *old_fops, *new_fops = NULL;
> > >         int err;
> > >  
> > > -       lock_kernel();
> > > +       mutex_lock(&input_mutex);
> > >         /* No load-on-demand here? */
> > >         handler = input_table[iminor(inode) >> 5];
> > >         if (!handler || !(new_fops = fops_get(handler->fops))) {
> > > @@ -1909,7 +1908,7 @@ static int input_open_file(struct inode *inode, struct file *file)
> > >         }
> > >         fops_put(old_fops);
> > >  out:
> > > -       unlock_kernel();
> > > +       mutex_unlock(&input_mutex);
> > >         return err;
> > >  }
> > >  
> > > -- 
> > 
> > Well, actually please have a look at
> > http://git.kernel.org/?p=linux/kernel/git/arnd/playground.git;a=commitdiff;h=c06fd0234357618a5741ce958d58901ae4cb7ac1
> > 
> > * use mutex_lock_interruptible() where possible
> > * you probably don't want to hold input_mutex when calling into the lower
> >   device's open function
> > 
> > 	Arnd
> 
> Yeah. I was just looking at your appointed branch. And I've noticed your
> change was better.
> 
> I was willing to let the open call go unprotected. But ended up checking
> that the three callees were fine (they do not call any of the other
> functions that take the mutex).
> 
> Since the fops_put/fops_get do protect that section from the handler
> removal and I can't think of any other race right now, I think your
> version is really better.
> 
> Acked-by: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
> 

OK, applied 2 Thadeu's patches and one Arnd's.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ