Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1569481 > unrolled thread

Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

Started by"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
First post2017-01-30 10:10 +0100
Last post2017-01-30 10:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race  Condition when two USB class drivers try to call init_usb_class  simultaneously "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org> - 2017-01-30 10:10 +0100

#1569481 — Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

From"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Date2017-01-30 10:10 +0100
SubjectRe: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously
Message-ID<t5g8i-28g-7@gated-at.bofh.it>
On Mon, Jan 30, 2017 at 08:25:25AM +0000, Ajay Kaher wrote:
>  

First off, you are sending html email, which the mailing list keeps
rejecting, why are you ignoring that?



> 
> There is race condition when two USB class drivers try to call
> 
> init_usb_class at the same time and leads to crash.
> 
>  
> 
> The main reason for this is one of the Class drivers allocates memory
> for usb_class structure and initializes its member. In the meantime NULL
> check for usb_class structure fails and assumes that usb_class structure
> is properly initialized and crashed while trying to access its members.
> 
>  
> 
> To avoid this race condition locking required before calling
> init_usb_class from function usb_register_dev.
> 
>  
> 
>  
> 
> Signed-off-by: Ajay Kaher

Does this look correct?  Please work with some of the samsung kernel
developers for how to properly submit a patch.

And finally, how are two drivers calling init_usb_class() at the same
time?  What code path causes that?  Have you seen this happen, and if
so, what drivers caused it?

thanks,

greg k-h

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web