From: Stéphane Grosjean <s.gr…@peak-system.fr> pcan_usb_get_can_channel_id() takes the CAN channel ID of a PCAN-USB from the args[] array, which pcan_usb_wait_rsp() fills with the response of the device. However, args[] is not initialized, and pcan_usb_wait_rsp() returns success without touching it once the device is no longer connected. peak_usb_disconnect() clears PCAN_USB_STATE_CONNECTED before it unregisters the netdevs. An ETHTOOL_GEEPROM request handled in this window makes peak_usb_get_eeprom() copy an uninitialized stack byte to userspace, and cache it in dev->can_channel_id. Initialize args[], so that a null ID is returned in that case. Found by Sashiko AI review. Fixes: 36d007c6fc79 ("can: peak_usb: add ethtool interface to user-configurable CAN channel identifier") Cc: stab…@vger.kernel.org Signed-off-by: Stéphane Grosjean <s.gr…@peak-system.fr> Link: https://patch.msgid.link/2026…@peak-system.fr Signed-off-by: Marc Kleine-Budde <m…@pengutronix.de> --- drivers/net/can/usb/peak_usb/pcan_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c index ff1921779065..83cf6fe7d258 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c @@ -386,7 +386,7 @@ static int pcan_usb_get_serial(struct peak_usb_device *dev, u32 *serial_number) */ static int pcan_usb_get_can_channel_id(struct peak_usb_device *dev, u32 *can_ch_id) { - u8 args[PCAN_USB_CMD_ARGS_LEN]; + u8 args[PCAN_USB_CMD_ARGS_LEN] = {}; int err; err = pcan_usb_wait_rsp(dev, PCAN_USB_CMD_DEVID, PCAN_USB_GET, args);
-- 2.53.0