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]
Date:   Thu, 2 Feb 2023 16:16:22 +0100
From:   Marc Kleine-Budde <mkl@...gutronix.de>
To:     Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc:     linux-can@...r.kernel.org, linux-kernel@...r.kernel.org,
        netdev@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] can: etas_es58x: do not send disable channel command if
 device is unplugged

On 28.01.2023 22:38:15, Vincent Mailhol wrote:
> When turning the network interface down, es58x_stop() is called and
> will send a command to the ES58x device to disable the channel
> c.f. es58x_ops::disable_channel().
> 
> However, if the device gets unplugged while the network interface is
> still up, es58x_ops::disable_channel() will obviously fail to send the
> URB command and the driver emits below error message:
> 
>   es58x_submit_urb: USB send urb failure: -ENODEV
> 
> Check the usb device state before sending the disable channel command
> in order to silence above error message.
> 
> Update the documentation of es58x_stop() accordingly.
> 
> The check being added in es58x_stop() is:
> 
>   	if (es58x_dev->udev->state >= USB_STATE_UNAUTHENTICATED)
> 
> This is just the negation of the check done in usb_submit_urb()[1].
> 
> [1] usb_submit_urb(), verify usb device's state.
> Link: https://elixir.bootlin.com/linux/v6.1/source/drivers/usb/core/urb.c#L384
> 
> Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
> Signed-off-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>
> ---
> As far as I know, there doesn't seem to be an helper function to check
> udev->state values. If anyone is aware of such helper function, let me
> know..

The constant USB_STATE_UNAUTHENTICATED is not used very often in the
kernel. Maybe Greg can point out what is best to do here.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ