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: <CAPBYUsAnuyLwek39GJiwin_Pit0waH-2fhQv-G21OYkjoz051w@mail.gmail.com>
Date: Tue, 20 Feb 2024 16:20:50 +0800
From: Ray Chi <raychi@...gle.com>
To: Thinh.Nguyen@...opsys.com, gregkh@...uxfoundation.org, 
	quic_uaggarwa@...cinc.com
Cc: albertccwang@...gle.com, linux-usb@...r.kernel.org, 
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] usb: dwc3: gadget: remove warning during kernel boot

On Tue, Feb 20, 2024 at 4:12 PM Ray Chi <raychi@...gle.com> wrote:
>
> The dwc3->gadget_driver is not initialized during the dwc3 probe
> process. This leads to a warning when the runtime power management (PM)
> attempts to suspend the gadget using dwc3_gadget_suspend().
>
> This patch adds a check to prevent the warning.
>
> Cc: stable@...r.kernel.org
> Fixes: 61a348857e86 ("usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend")
> Signed-off-by: Ray Chi <raychi@...gle.com>
> ---
>  drivers/usb/dwc3/gadget.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 28f49400f3e8..de987cffe1ec 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -4708,6 +4708,9 @@ int dwc3_gadget_suspend(struct dwc3 *dwc)
>         unsigned long flags;
>         int ret;
>
> +       if (!dwc->gadget_driver)
> +               return 0;
> +
>         ret = dwc3_gadget_soft_disconnect(dwc);
>         if (ret)
>                 goto err;
> --
> 2.44.0.rc0.258.g7320e95886-goog
>

Attached the warning message.

02-20 06:01:24.227725  root    86    86 W Call trace:
02-20 06:01:24.227730  root    86    86 W         :
dwc3_ep0_out_start+0xec/0x22c
02-20 06:01:24.227738  root    86    86 W         :
dwc3_ep0_stall_and_restart+0xb8/0xd4
02-20 06:01:24.227747  root    86    86 W         :
dwc3_gadget_soft_disconnect+0x1a8/0x284
02-20 06:01:24.227756  root    86    86 W         :
dwc3_gadget_suspend+0x18/0xe4
02-20 06:01:24.227764  root    86    86 W         :
dwc3_suspend_common+0x5c/0x320
02-20 06:01:24.227774  root    86    86 W         :
dwc3_runtime_suspend+0x30/0x4c
02-20 06:01:24.227783  root    86    86 W         :
pm_generic_runtime_suspend+0x3c/0x54
02-20 06:01:24.227793  root    86    86 W         : __rpm_callback+0xfc/0x76c
02-20 06:01:24.227802  root    86    86 W         : rpm_suspend+0x534/0xd78
02-20 06:01:24.227811  root    86    86 W         : dwc3_runtime_idle+0xcc/0x104
02-20 06:01:24.227819  root    86    86 W         : rpm_idle+0x228/0x4e0
02-20 06:01:24.227827  root    86    86 W         : update_autosuspend+0x50/0xb8
02-20 06:01:24.227836  root    86    86 W         :
__pm_runtime_use_autosuspend+0x50/0x6c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ