RE: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

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

Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-03-01 Thread Jiri Slaby
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_AT

Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-03-01 Thread channing
On Thu, 2013-02-28 at 10:53 +0100, Jiri Slaby wrote: > On 02/28/2013 06:31 AM, channing wrote: > > > > when gsm Net is enabled, data on dlci is transferrd by > > gsm_mux_net_start_xmit(), while userspace may trigger > > ioctrl to call gsm_destroy_network() during data was > > transferring, because

Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-02-28 Thread Jiri Slaby
On 02/28/2013 06:31 AM, channing wrote: > > when gsm Net is enabled, data on dlci is transferrd by > gsm_mux_net_start_xmit(), while userspace may trigger > ioctrl to call gsm_destroy_network() during data was > transferring, because there is no mutex protection between > the two functions, follow

[PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-02-27 Thread channing
when gsm Net is enabled, data on dlci is transferrd by gsm_mux_net_start_xmit(), while userspace may trigger ioctrl to call gsm_destroy_network() during data was transferring, because there is no mutex protection between the two functions, following scenario may happen: 1) gsm_mux_net_start_xmit(