From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796158407; b=qsWY3CYY7Yxu7zYuBoQ8sGIRlJ1P4RCEB1Lf0JDL0nYgu20dnN8mS69RYcaVsxFEHkHV uS1wJMi+SgmKgkjQg0qUOVw8UGrBbLorbMunZh3iPQqS78gm1n2uqR3PGX6oqz29poiJR EFKsEiadXAJUwPeksKnZhjOmF4lGRyI0+W7ZQTAx7UJUX5g54BbdVlP4xPcHqE7SQk2+B YA7Txeorre7obd7sKJ2+8wIxCD5UdKDVrI5WToN74CdK1SeYOwNusr9jEECR075iNGZQk rM4mLqoaIY490mQE+t2ZSwayk+ipn92JiFP4oTxi4uNLt+a/LQQTuJ1R4EZqOxC1Rtw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796158407; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=b7cwyFnqQqynY9n9NaIHq6/J6ITh6LI3g7FZG084yvI=; b=losH+3f8f5ORVJOfNUC8scuiaUcXKDlThGsLPMx1OjbpqqBtbsUE6OV7REhz1G1wrlRt at+j0FQsm6wv7TLuLZCOA06hLjVWMoXAWA+xNsr1r44ZHHupJwJhbGWCavwbE37QAoHtQ jUSdzRv5pE7/YgL7kQk58NkBx0TjmCCsckih76wpmUC4WnS/59NtZKmNdFbqjfBxMqymQ a3RtoxreereHYlWDhINnsY2Ixtwsc/8JLv03ku3FFnzK36wrOqHrTf/V2Tzcv6al73BfW Uvn3j/0SSLY5i87ETsYiNwNiPfGD93z90gr8Zm4lr3TfgUY9e5W+1aYHX3fp6XzN9gQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eQzyqh78; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ACBE606A322; Tue, 1 Dec 2026 20:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=eQzyqh78 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8B651F000C1; Tue, 1 Dec 2026 20:53:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796158407; bh=b7cwyFnqQqynY9n9NaIHq6/J6ITh6LI3g7FZG084yvI=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=eQzyqh787h8qTXbQyo6Ao7dk2bl7pza4amvJtOjvxKxbMaVz+rZCTTbIYHi3Oalpu OJEzAf8/+MDzTzGXwNRGmeCXn5tL2V3L/3YRr8knDUpAmsN4hnWcAfaGeCUvXBNIrn ZrJe0f8CdQp5mJhexltRxyt1z0TRQU+BBEn4nJDwNdnWKtYwhb+OcZFUFi/m3i0GJR ilzhHCQsWMC7TJv2aBWLs5H0O79L4Bvy3hvboDE0Et/1yl/CD3AHjYhRvAfiXszcgd A1Vzb/wp1HVaoANQ5xdcpyEwzfd5ZOEwgNf5ADWzarMzbouK/bnSn2z4eCVbfvU4lT fCLhsOAM+3e0g== Subject: Re: [PATCH can-next v11 9/9] can: gs_usb: gs_usb_receive_bulk_callback(): emit error message on invalid channel instead of disconnecting interfaces From: netdev-bot+sashiko@kernel.org To: mkl@pengutronix.de Cc: mailhol@kernel.org, pfink@christ-es.de, eric@evenchick.com, max@schneidersoft.net, wg@grandegger.com, kernel@pengutronix.de, linux-can@vger.kernel.org, stable@vger.kernel.org, kuba@kernel.org Date: Tue, 01 Dec 2026 20:53:26 +0000 Message-ID: <179615840643.3142.8725437906556473875@kernel.org> In-Reply-To: <20261130-gs_usb-fixes-v11-9-3f052bb620d4@pengutronix.de> References: <20261130-gs_usb-fixes-v11-9-3f052bb620d4@pengutronix.de> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-can@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] In gs_usb_receive_bulk_callback() (drivers/net/can/usb/gs_usb.c), this patch quietly undoes a deliberate, stable-tagged hardening… -- can: gs_usb: gs_usb_receive_bulk_callback(): emit error message on invalid channel instead of disconnecting interfaces This commit changes how gs_usb_receive_bulk_callback() handles a frame whose channel number is out of range. The driver used to detach every network interface of the USB device. It now logs a rate-limited error and resubmits the URB. > diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c > index 7cd34395f0529..e6632b5f87f58 100644 > --- a/drivers/net/can/usb/gs_usb.c > +++ b/drivers/net/can/usb/gs_usb.c > @@ -665,8 +665,13 @@ static void gs_usb_receive_bulk_callback(struct urb *urb) > } > > /* device reports out of range channel id */ > - if (hf->channel >= parent->channel_cnt) > - goto device_detach; > + if (hf->channel >= parent->channel_cnt) { > + dev_err_ratelimited(&parent->udev->dev, > + "channel number out of range (channel=%u, channel_cnt=%u)\n", > + hf->channel, parent->channel_cnt); > + > + goto resubmit_urb; > + } [Severity: Low] This change reverses commit 4a8737ff0687 ("can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data"). That commit was tagged for stable and deliberately switched this path from goto resubmit_urb to goto device_detach. Its commit message says: If the channel number is bigger than the actual number of channels assume broken or malicious USB device and shut it down. The commit message here calls the event a "firmware glitch" and says the old code detached the interfaces "silently". It doesn't mention 4a8737ff0687, and it doesn't say why that earlier reasoning no longer holds. Could the commit message reference 4a8737ff0687 and explain the change in policy? With this patch, a device that keeps sending invalid channel numbers is no longer shut down. Its URBs are resubmitted indefinitely, with only rate-limited logging. Jumping to resubmit_urb without a valid dev or netdev looks safe in this tree, because the resubmit block only touches parent fields: resubmit_urb: usb_fill_bulk_urb(urb, parent->udev, parent->pipe_in, hf, parent->hf_size_rx, gs_usb_receive_bulk_callback, parent); However, 4a8737ff0687 removed this same jump because, at that time, the resubmit path dereferenced an uninitialized dev (dev->gs_hf_size). The safety now depends on earlier refactors, including the preceding change that switched the resubmit failure message to dev_info_ratelimited(). It might be worth recording that dependency in the commit message. That way, a backport to an older tree whose resubmit_urb still uses dev won't bring back the uninitialized pointer use. > > dev = parent->canch[hf->channel]; > [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-gs_usb-fixes-v11-0-3f052bb620d4%40pengutronix.de