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] [thread-next>] [day] [month] [year] [list]
Message-ID: <2024081450-triage-glorious-cba5@gregkh>
Date: Wed, 14 Aug 2024 06:49:36 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Amit Sunil Dhamne <amitsd@...gle.com>
Cc: heikki.krogerus@...ux.intel.com, badhri@...gle.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	kyletso@...gle.com, rdbabiera@...gle.com
Subject: Re: [PATCH v1] usb: roles: add lockdep class key to struct
 usb_role_switch

On Tue, Aug 13, 2024 at 03:42:11PM -0700, Amit Sunil Dhamne wrote:
> There can be multiple role switch devices running on a platform. Given
> that lockdep is not capable of differentiating between locks of
> different instances, false positive warnings for circular locking are
> reported. To prevent this, register unique lockdep key for each of the
> individual instances.
> 
> Signed-off-by: Amit Sunil Dhamne <amitsd@...gle.com>
> ---
>  drivers/usb/roles/class.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/usb/roles/class.c b/drivers/usb/roles/class.c
> index d7aa913ceb8a..807a8f18ec20 100644
> --- a/drivers/usb/roles/class.c
> +++ b/drivers/usb/roles/class.c
> @@ -11,6 +11,7 @@
>  #include <linux/usb/role.h>
>  #include <linux/property.h>
>  #include <linux/device.h>
> +#include <linux/lockdep.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/slab.h>
> @@ -33,6 +34,10 @@ struct usb_role_switch {
>  	usb_role_switch_set_t set;
>  	usb_role_switch_get_t get;
>  	bool allow_userspace_control;
> +
> +#ifdef CONFIG_LOCKDEP
> +	struct lock_class_key key;
> +#endif

Please do not put #ifdef lines in .c files, they are not needed for this
change to work properly, right?

checkpatch should have complained about this...

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ