Re: [PATCH v2 2/2] USB: make to_usb_device_driver() use container_of_const()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Nov 13, 2024 at 6:04 AM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxx>
> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> Cc: Grant Grundler <grundler@xxxxxxxxxxxx>
> Cc: Yajun Deng <yajun.deng@xxxxxxxxx>
> Cc: Oliver Neukum <oneukum@xxxxxxxx>
> Cc: Douglas Anderson <dianders@xxxxxxxxxxxx>
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxx>





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux