From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 801F53C465; Tue, 30 Sep 2025 15:27:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759246072; cv=none; b=UT0sDussJnGNHm53/PMKr8L4AO9jjvEUiiZMz3hq1iu53O545j5vyZFRdzqIDVenMjSRk1n575BKeBgAad6mwzzOx5P/zDIzUsNIgkLtJJ0SDgxWDcX7y4q7NNE9odMSR0bk2ULU/zsGVOdmSdPW/NfacM42wobg6nkogI1BDGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759246072; c=relaxed/simple; bh=vIjWWBXgXl8bwPjI/dksCsAoy3G2yP6y2eJAx3d1TBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LHL1r1rv6OEfnZ0zNQsDqIhBOreleJ8NvUVCpk/IWDxcAO/nA/4GnxCphJ0KWjZUWhe6PKmjdvNmE+fNqL7eFAOJpfImyxAxusgngwifNHo8AeUUfiWlZq+gfxN2cFF6V93jxefNmlc7gDL8jZCZpQdgFc29FqTZ8F00nAa9ugw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=brEYr9qF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="brEYr9qF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00A53C113D0; Tue, 30 Sep 2025 15:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759246072; bh=vIjWWBXgXl8bwPjI/dksCsAoy3G2yP6y2eJAx3d1TBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=brEYr9qFAdQRK6g0P4meuQvfzFyAaVhHZtuH2/tRI3AFxBeSgL7uBh0uqgMIJtxxD 5Aufg67WliH/Kjdj/YT6pzB2pl8NDaLEGRbJUJL+eNu3syAg/u0jCZBePsVOk1fo// wZrl7F40b10359jULbu0N1p/fwqsX/pbRM4Ym3LU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?St=C3=A9phane=20Grosjean?= , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 6.12 44/89] can: peak_usb: fix shift-out-of-bounds issue Date: Tue, 30 Sep 2025 16:47:58 +0200 Message-ID: <20250930143823.744998581@linuxfoundation.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250930143821.852512002@linuxfoundation.org> References: <20250930143821.852512002@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stéphane Grosjean [ Upstream commit c443be70aaee42c2d1d251e0329e0a69dd96ae54 ] Explicitly uses a 64-bit constant when the number of bits used for its shifting is 32 (which is the case for PC CAN FD interfaces supported by this driver). Signed-off-by: Stéphane Grosjean Link: https://patch.msgid.link/20250918132413.30071-1-stephane.grosjean@free.fr Reported-by: Marc Kleine-Budde Closes: https://lore.kernel.org/20250917-aboriginal-refined-honeybee-82b1aa-mkl@pengutronix.de Fixes: bb4785551f64 ("can: usb: PEAK-System Technik USB adapters driver core") [mkl: update subject, apply manually] Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index 59f7cd8ceb397..69c44f675ff1c 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -111,7 +111,7 @@ void peak_usb_update_ts_now(struct peak_time_ref *time_ref, u32 ts_now) u32 delta_ts = time_ref->ts_dev_2 - time_ref->ts_dev_1; if (time_ref->ts_dev_2 < time_ref->ts_dev_1) - delta_ts &= (1 << time_ref->adapter->ts_used_bits) - 1; + delta_ts &= (1ULL << time_ref->adapter->ts_used_bits) - 1; time_ref->ts_total += delta_ts; } -- 2.51.0