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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <253F3AA5ECB4EC43A2CA0147545F67F2102E4FB4@SHSMSX102.ccr.corp.intel.com>
Date:	Fri, 1 Mar 2013 11:04:03 +0000
From:	"Bi, Chao" <chao.bi@...el.com>
To:	Jiri Slaby <jslaby@...e.cz>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	ML netdev <netdev@...r.kernel.org>,
	"Pillet, VincentX" <vincentx.pillet@...el.com>
Subject: RE: [PATCH] n_gsm: Add Mutex to avoid race when net destroy


-----Original Message-----
From: Jiri Slaby [mailto:jirislaby@...il.com] On Behalf Of Jiri Slaby
Sent: Friday, March 01, 2013 5:10 PM
To: Bi, Chao
Cc: Greg Kroah-Hartman; linux-kernel@...r.kernel.org; ML netdev; Pillet, VincentX
Subject: Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

On 03/01/2013 09:51 AM, channing wrote:
>> It should stop the queue and schedule a workqueue to lock the mutex, 
>> unregister the hetdev and reset dlci->net. (Or maybe just call 
>> muxnet_put with the lock held.)
> 
> Thanks, Jiri, you're right, I didn't notice that in validation because 
> DEBUG_ATOMIC_SLEEP is not enabled in my platform :( Now I'm trying to 
> work out the workqueue solution, when it finished I'll re-submit for 
> review. What do you mean by "call muxnet_put with lock held"? do you 
> mean to use spin lock instead of mutex?

No, I mean, in the newly added scheduled work, to lock the mutex and simply call muxnet_put. That should fix it, right?

[chao] Yes, that's to only move muxnet_put to scheduled work with mutex protected, and the rest of gsm_mux_net_start_xmit()
Is kept unchanged, and they are not in mutex lock. It could avoid race of net_free().
I'm not sure if it's safe enough, I mean if dlci->net is released before STATS(net) in gsm_mux_net_start_xmit(), will STATS(net) access unreliable data?

--
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ