All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Marc Kleine-Budde" <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org,
	"Oliver Hartkopp" <socketcan@hartkopp.net>,
	"Vincent Mailhol" <mailhol@kernel.org>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>
Subject: Re: [PATCH can-next v6 2/6] can: gs_usb: gs_can_start_xmit(): don't leak uninitialized memory over USB
Date: Fri, 13 Nov 2026 10:18:21 +0000	[thread overview]
Message-ID: <sashiko-outbox-212616@kernel.org> (raw)
In-Reply-To: <20261113-gs_usb-fixes-v6-2-0c039e1bfd74@pengutronix.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] can: gs_usb: inaccurate Fixes: trailer in commit message
--

commit ad35ba4588d5d85da58395d08e3738d74f314193
Author: Marc Kleine-Budde <mkl@pengutronix.de>

> can: gs_usb: gs_can_start_xmit(): don't leak uninitialized memory over USB
>
> The driver allocates the transmission buffer using kmalloc(), which means
> the memory remains uninitialized. Then various headers are filled and, but
> only the actual CAN frame data payload (of length cfd->len or cf->len) is
> copied into the buffer, leaving the remaining buffer uninitialized.
>
> Fix this information leak, allocate the buffer with kzalloc().
>
> Closes: https://sashiko.dev/#/bug/linux-0a8c0e8a-c623-426a-8db3-f55111f6cd84
> Fixes: 26949ac935e3 ("can: gs_usb: add CAN-FD support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

[Severity: Low]
Should the Fixes: tag point to d08e973a77d1 ("can: gs_usb: Added support
for the GS_USB CAN devices") instead of 26949ac935e3 ("can: gs_usb: add
CAN-FD support")?

Leaking uninitialized trailing bytes over USB when cf->len < 8 has been
present since d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN
devices"), which allocated hf via usb_alloc_coherent() without __GFP_ZERO
and copied only cf->can_dlc bytes into the 8-byte hf->data array.  The
kmalloc() call modified here was later introduced in 62f102c0d156 ("can:
gs_usb: remove dma allocations").

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-gs_usb-fixes-v6-0-0c039e1bfd74@pengutronix.de?part=2

  reply	other threads:[~2026-11-13 10:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:08 [PATCH can-next v6 0/6] gs_usb: fixes Marc Kleine-Budde
2026-11-13 10:08 ` [PATCH can-next v6 1/6] can: gs_usb: gs_make_candev(): check can_rx_offload_add_manual() return value Marc Kleine-Budde
2026-11-13 10:08 ` [PATCH can-next v6 2/6] can: gs_usb: gs_can_start_xmit(): don't leak uninitialized memory over USB Marc Kleine-Budde
2026-11-13 10:18   ` sashiko-bot [this message]
2026-11-13 10:08 ` [PATCH can-next v6 3/6] can: gs_usb: gs_usb_probe(): init netdev completely before register_candev() Marc Kleine-Budde
2026-11-13 10:08 ` [PATCH can-next v6 4/6] can: gs_usb: gs_usb_receive_bulk_callback(): check for overflow flag if SKB allocation fails Marc Kleine-Budde
2026-11-13 10:08 ` [PATCH can-next v6 5/6] can: gs_usb: gs_usb_receive_bulk_callback(): add missing call to can_rx_offload_irq_finish Marc Kleine-Budde
2026-11-13 10:08 ` [PATCH can-next v6 6/6] can: gs_usb: fix hardware timestamp state for mixed channels Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-212616@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.