linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible case of Race in kobject_get_path()
@ 2022-03-30 10:11 Mukesh Ojha
  2022-03-30 10:16 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Mukesh Ojha @ 2022-03-30 10:11 UTC (permalink / raw)
  To: Rafael J. Wysocki, gregkh, linux-remoteproc

Hi All,

We are facing one issue where one driver (p1) is trying to register its 
device from driver probe
and from another path (p2) dev_set_name(new name) done from driver probe 
of the added device whose
new name length can be more than earlier done in (p1 path) which could 
result in redzone overwritten issue.

Can we get your suggestion here ? is this case of a race here ?

             p1                                                   p2

  device_register()
     kobject_get_path()
             =>  get_kobj_path_length
             (length is calculated from this path)

                                                  dev_set_name()

             => fill_kobj_path
               (path is copied here)


Thanks,
-Mukesh


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Possible case of Race in kobject_get_path()
  2022-03-30 10:11 Possible case of Race in kobject_get_path() Mukesh Ojha
@ 2022-03-30 10:16 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-03-30 10:16 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: Rafael J. Wysocki, linux-remoteproc

On Wed, Mar 30, 2022 at 03:41:04PM +0530, Mukesh Ojha wrote:
> Hi All,
> 
> We are facing one issue where one driver (p1) is trying to register its
> device from driver probe
> and from another path (p2) dev_set_name(new name) done from driver probe of
> the added device whose
> new name length can be more than earlier done in (p1 path) which could
> result in redzone overwritten issue.

I do not understand, what specific driver is doing this so that we can
see an example of this problem?

> Can we get your suggestion here ? is this case of a race here ?
> 
>             p1                                                   p2
> 
>  device_register()
>     kobject_get_path()
>             =>  get_kobj_path_length
>             (length is calculated from this path)
> 
>                                                  dev_set_name()
> 
>             => fill_kobj_path
>               (path is copied here)
> 

I can not understand this example, any specific code you can point me
at?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-30 10:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-30 10:11 Possible case of Race in kobject_get_path() Mukesh Ojha
2022-03-30 10:16 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).