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, 07 May 2013 17:41:06 +0200
From:	Jiri Slaby <jslaby@...e.cz>
To:	Arnd Bergmann <arnd@...db.de>
CC:	jirislaby@...il.com, linux-kernel@...r.kernel.org,
	"salina@...ibm.com" <salina@...ibm.com>, okir@...e.de,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH 01/15] Char: lp, protect LPGETSTATUS with port_mutex

On 05/07/2013 04:48 PM, Arnd Bergmann wrote:
> On Tuesday 07 May 2013, Jiri Slaby wrote:
>> From: "salina@...ibm.com" <salina@...ibm.com>
>>
>> The patch fixes a problem in the lp driver that can cause oopses as
>> follows:
>> process A:      calls lp_write, which in turn calls
>>                 parport_ieee1284_write_compat, and that invokes
>>                 parport_wait_peripheral
>> process B:      meanwhile does an ioctl(LPGETSTATUS), which call
>>                 lp_release_parport when done. This function will set
>>                 physport->cad = NULL.
>> process A:      parport_wait_peripheral tries to dereference
>>                 physport->cad and dies
>>
>> So, protect that code with the port_mutex in order to protect against
>> simultaneous calls to lp_read/lp_write.
>>
>> Similar protection is probably required for ioctl(LPRESET)...
>>
>> This patch was done by IBM a while back and we (at suse) have that
>> since at least 2004 in our repos. Let's make it upstream.
> 
> Hmm,  it seems the driver has changed a bit since 2004, at least when
> I added the lp_mutex to lp_open()/lp_ioctl(). It's probably worth
> taking a look at the bigger picture now, to combine lp_mutex with
> lp_table[minor].port_mutex. I don't see any reason why we can't always
> use the per-device mutex.

Yeah, it looks sensible to me too to get rid of the lp_mutex, another
BKL left-over. However I don't have the hardware, the patch I attached
was taken from our tree and tested, at least some time ago. Patches to
clean that mess up welcome.

thanks,
-- 
js
suse labs
--
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