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=1796116822; b=L106V1fSsm70Tup3cKoptdDe5oaOdzSHVCzem8VUhAk+mODXBm8Yj0Qu9lf0eY0oGoFz O9ZTMpwL/XQCl/WzY8nZaGi/ajacgatyg276/oJ6Kul95LoqM7HEImZzbvpASu8aHn4Z+ Xw+BP4XjGEvglOou5fzS37FJ1rWSbEgO3vvWbXIy4j9ziysER4w8rYfpdPw3YyXcm3Qhj le3sSyN9P4xC66CVOQhdjg7sDM9L5ois9LZFe/e+UK28RGj9U2MjICGK6Av53TnUEB4+L I36RHqYdrKRG59pqkmac5PFc2QqKmFzgPpEJEIWBcKT9jP/iRpGDss1OzfV/oDae3BQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796116822; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=r8hwL0OaTSrGwldBiQpZd0kGkZC2Ljw4Qs4y+TH4Jag=; b=H2aAgQW02EyHBJJWYfXsgrxiK/nRaoxV7kcdQQmJD+9mDaXhR2V7vTSG08AHY+U9x0Lk 88qIwMh8OsJkLFz0dsaWXGk7SuC67OqCxCYkGF9qBFpVJcnV6/KGzLVAoGTjxT6/WmszX 7o+UtitC0XP8UqfjKt+QvPtsO3gBBxNqxeZDhvVjyqOxCecxQeX/0nYXRkqL4+Pd/ciro anESZsS5VeMC2meOjt8a66I0cjWBTUAdyGEYI6E0dKGOIWDIUi09c1i3sFecJNKDSaCBp r7IGopuAF3uuooGwL+yCtRaWks2wCuCWHcGGMqP6n96dk+FtFRsSJobTqraQzaek+NQ== 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=iqCmCtXz; 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 6348E606A31A for ; Tue, 1 Dec 2026 09:20:22 +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=iqCmCtXz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6ACAE1F000C1; Tue, 1 Dec 2026 09:20:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796116822; bh=r8hwL0OaTSrGwldBiQpZd0kGkZC2Ljw4Qs4y+TH4Jag=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=iqCmCtXz+RUcm4ygG7uWGfGd5GvU3g2W9J+yBfXw1ud+JRElie1E0Y2IbJ625ouQU CDTvzfC2ElUKguO0lD1DKfS1KdihlQKuU1y3JJFAcOqGA4ONQZehC2aSZY8a6/HU0m 0EelEmYw+4/VFNsWSanmvnZIN6Uck1QwFoWoIhYh01PnmFMYq3t5hZ2QCnpH9Y6J1b BIz1kssiY8NXHfqvbzkCX1RLCiSLx7nLNohS8gD3IuMkNQWqpTws85WPZHrHV9bOJh a8rPBpaq74OJurcYUzKPY7/jkTRLOX9juYoNWR6mk/yOfFmfDk/QGyAZpBHHCGnIXh DfgL5BgUbvfrg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next 4/9] can: gs_usb: gs_usb_receive_bulk_callback(): add missing call to can_rx_offload_irq_finish Reply-To: sashiko-reviews@lists.linux.dev To: "Marc Kleine-Budde" Cc: linux-can@vger.kernel.org, "Oliver Hartkopp" , "Vincent Mailhol" , "Oleksij Rempel" In-Reply-To: <20261130092003.1946901-5-mkl@pengutronix.de> References: <20261130092003.1946901-1-mkl@pengutronix.de> <20261130092003.1946901-5-mkl@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 09:20:20 +0000 X-Mailing-List: linux-can@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [Critical] can: gs_usb: use-after-free in gs_usb_receive_bulk_callback() [1] -- commit b6e91c21a113db9db4c7640d5fe163393fdf9284 Author: Marc Kleine-Budde can: gs_usb: gs_usb_receive_bulk_callback(): add missing call to can_rx_off= load_irq_finish This commit ensures can_rx_offload_irq_finish() is called in gs_usb_receive_bulk_callback() when allocating an overflow error SKB fails, so any SKB already queued to rx-offload is still processed before resubmitting the URB. Link: https://patch.msgid.link/20261130-gs_usb-fixes-v12-4-9ba1f84c179a@pen= gutronix.de > diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c > index 6571ee0dd90f0..890389a1fa312 100644 > --- a/drivers/net/can/usb/gs_usb.c > +++ b/drivers/net/can/usb/gs_usb.c > @@ -742,7 +742,7 @@ static void gs_usb_receive_bulk_callback(struct urb *= urb) > =20 > skb =3D alloc_can_err_skb(netdev, &cf); > if (!skb) > - goto resubmit_urb; > + goto can_rx_offload_irq_finish; > =20 > cf->can_id |=3D CAN_ERR_CRTL; > cf->len =3D CAN_ERR_DLC; > @@ -751,6 +751,7 @@ static void gs_usb_receive_bulk_callback(struct urb *= urb) > gs_usb_rx_offload(dev, skb, hf); > } > =20 > +can_rx_offload_irq_finish: > can_rx_offload_irq_finish(&dev->offload); > =20 > resubmit_urb: [Severity: Critical] This problem wasn't introduced by this patch, but can a race between gs_usb_receive_bulk_callback() and gs_usb_xmit_callback() cause a use-after-free on echo_skb [1]? CPU0 CPU1 gs_usb_receive_bulk_callback() gs_usb_xmit_callback() skb =3D dev->can.echo_skb[hf->echo_id]; if (urb->status) can_free_echo_skb(...) gs_usb_get_echo_skb(dev, skb, hf) gs_usb_set_timestamp(dev, skb, hf) gs_usb_skb_set_timestamp(...) <-- use-after-free When a TX URB completes with an error while an incoming echo frame with the matching echo_id is processed concurrently, gs_usb_receive_bulk_callback() can read dev->can.echo_skb[hf->echo_id] just before gs_usb_xmit_callback() frees it via can_free_echo_skb(), and then pass the freed skb to gs_usb_skb_set_timestamp(). [1] https://sashiko.dev/#/bug/linux-2052c20c-4b79-4ed7-851e-59c436d18021 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130092003.1946= 901-1-mkl@pengutronix.de?part=3D4