From: Vincent Mailhol <mailhol@kernel.org>
To: Ziyi Guo <n7l8m4@u.northwestern.edu>
Cc: socketcan@esd.eu, "David S . Miller" <davem@davemloft.net>,
Wolfgang Grandegger <wg@grandegger.com>,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
Frank Jungclaus <frank.jungclaus@esd.eu>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: [PATCH v2] can: esd_usb: add endpoint type validation
Date: Sun, 22 Feb 2026 14:05:39 +0100 [thread overview]
Message-ID: <f487df33-03f9-43ae-961b-a8a3a7d6cd24@kernel.org> (raw)
In-Reply-To: <20260213203927.599163-1-n7l8m4@u.northwestern.edu>
On 13/02/2026 at 21:39, Ziyi Guo wrote:
> esd_usb_probe() constructs bulk pipes for two endpoints without
> verifying their transfer types:
>
> - usb_rcvbulkpipe(dev->udev, 1) for RX (version reply, async RX data)
> - usb_sndbulkpipe(dev->udev, 2) for TX (version query, CAN frames)
>
> A malformed USB device can present these endpoints with transfer types
> that differ from what the driver assumes, triggering the WARNING in
> usb_submit_urb().
>
> Use usb_find_common_endpoints() to discover and validate the first
> bulk IN and bulk OUT endpoints at probe time, before any allocation.
> Found pipes are saved to struct esd_usb and code uses them directly
> instead of making pipes in place.
>
> Similar to
> - commit 136bed0bfd3b ("can: mcba_usb: properly check endpoint type")
> which established the usb_find_common_endpoints() + stored pipes
> pattern for CAN USB drivers.
>
> Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device")
> Suggested-by: Vincent Mailhol <mailhol@kernel.org>
> Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Thanks for this v2.
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Yours sincerely,
Vincent Mailhol
next prev parent reply other threads:[~2026-02-22 13:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 20:39 Ziyi Guo
2026-02-22 13:05 ` Vincent Mailhol [this message]
2026-03-02 10:09 ` 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=f487df33-03f9-43ae-961b-a8a3a7d6cd24@kernel.org \
--to=mailhol@kernel.org \
--cc=davem@davemloft.net \
--cc=frank.jungclaus@esd.eu \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=n7l8m4@u.northwestern.edu \
--cc=socketcan@esd.eu \
--cc=wg@grandegger.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®