[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=XjK_vYnNiWfXXMBJq8Nkt-4e5bHN6NCu23S0EumAAdbw@mail.gmail.com>
Date: Thu, 14 Nov 2024 14:37:17 -0800
From: Doug Anderson <dianders@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-usb@...r.kernel.org, stern@...land.harvard.edu,
linux-kernel@...r.kernel.org, Johan Hovold <johan@...nel.org>,
Grant Grundler <grundler@...omium.org>, Yajun Deng <yajun.deng@...ux.dev>,
Oliver Neukum <oneukum@...e.com>
Subject: Re: [PATCH v2 2/2] USB: make to_usb_device_driver() use container_of_const()
Hi,
On Wed, Nov 13, 2024 at 6:04 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> Turns out that we have some const pointers being passed to
> to_usb_device_driver() but were not catching this. Change the macro to
> properly propagate the const-ness of the pointer so that we will notice
> when we try to write to memory that we shouldn't be writing to.
>
> This requires fixing up the usb_driver_applicable() function as well,
> because it can handle a const * to struct usb_driver.
>
> Cc: Johan Hovold <johan@...nel.org>
> Cc: Alan Stern <stern@...land.harvard.edu>
> Cc: Grant Grundler <grundler@...omium.org>
> Cc: Yajun Deng <yajun.deng@...ux.dev>
> Cc: Oliver Neukum <oneukum@...e.com>
> Cc: Douglas Anderson <dianders@...omium.org>
> Cc: linux-usb@...r.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
> v2: reordered patches, goes on top of series submitted at https://lore.kernel.org/r/2024111322-kindly-finalist-d247@gregkh
>
> drivers/usb/core/driver.c | 4 ++--
> drivers/usb/core/usb.h | 2 +-
> include/linux/usb.h | 3 +--
> 3 files changed, 4 insertions(+), 5 deletions(-)
This looks reasonable to me. Assuming that there are no compiler
errors reported:
Reviewed-by: Douglas Anderson <dianders@...omium.org>
Powered by blists - more mailing lists