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=1796278529; b=qZZGxnqz3At7J+zO/Grn94G1HCHJ2U7tpBfGAAWYSQPDw1I639Xhlmqey7OJUOv9VozW BW9yzs4HZmO8kqKppBBgaB2GCXhFkkyRTaEYoMCJt/ySoB4X1W5YFlV8A5BTDzbfjBHbb Ip+PWUQEgM/9Fmqmfhi1Rdfske0S/DHbURaTper2RPc1gVPlf98aRtCvCj7kUIxJsPyWF Tfsw7FBvBpo/atl/HP3bwAxkfbbXDtUhwQu9GschF7me2G3G72V7G75gDyD3zxyxc7sVP 0GGEiJSET59iLoCmoBp1Tn6F3C847/9/QrUPk/RGTJhU5cQ3c4GtlJAEWhv5CvgJPHQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796278529; 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=Rd4KNaCVoUE1C7hETTUtRlSAuPalllj6hr1JIoCilYM=; b=5fK8w7XshSByXzDeCPzU1H1zhp4eLr49Pjhvz9rUOQfKLpo7VqWMQUb16fTWtSRy+AR1 nn3xGyu5KEc5Pz/KaaDerWxrGaxPcXtatIT+PbeGAb9jy13iqqgYSSkNF5myNl6r10WZ4 ryNvunSuCvqmY4aZh1fvhSlwcTbCchI4MOySAR+Cep0Yq9ZZXTpqlnGpqTfl0EFT6rnvm eE96TMxtLtHCl/S7E3b9FB71A8ZrdWioBW8vdx0xH+SuH5aKU3x1uUzuomw/VZkK2QLc2 hZxKLeH9S9Ol9Ns2ge71d0FS739YEFUYIun0FLXlkNCYxjGdbJenJd90reuMagHS6Kg== 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=Ba62yR85; 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 D4479606A322 for ; Thu, 3 Dec 2026 06:15:29 +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=Ba62yR85 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 099E01F00893; Thu, 3 Dec 2026 06:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796278529; bh=Rd4KNaCVoUE1C7hETTUtRlSAuPalllj6hr1JIoCilYM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Ba62yR85sxEZTrxlAhnhyeZUKXEk6ffxWPJqP74KDjCmZOalHDaMIjr1aShv7xbCy B7ATNon5dlX+zXYVHzxZYgPMoDduLoTtFo5k0KuQ8ggPn21irKJwGDn4RIEyjPY5uo /OR5eajtpNCszbLtXhdwS0uWWoVaj9fNijkcZwjUjqgrKIqH/tHp4i7w14Guv1lNvA 4wMBR/RpfOuLdUZxJuV01SThK5vHODYruQCMXGtKWuxUUQJGlz/EO5lFosXrmGBakX REWY1R1PtfJyJ0bJbongs/N2qsgBgr1fc+oM+kroI4bVapGLMnpMNDZDiZRt6p+QMz AQgBiR5d9hyrA== Subject: Re: [PATCH can-next v4 07/23] can: isotp: add the frame transmission time to the protocol timeouts From: netdev-bot+sashiko@kernel.org To: socketcan@hartkopp.net Cc: linux-can@vger.kernel.org, mkl@pengutronix.de, sashiko-bot@kernel.org, zihanx@nebusec.ai, o.rempel@pengutronix.de, yewentian395@gmail.com, kuba@kernel.org Date: Thu, 03 Dec 2026 06:15:28 +0000 Message-ID: <179627852862.3142.8395066602250179143@kernel.org> In-Reply-To: <20261201-getsockopt-memcg-isotp-v4-7-97261be8e38e@hartkopp.net> References: <20261201-getsockopt-memcg-isotp-v4-7-97261be8e38e@hartkopp.net> 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] setsockopt(CAN_ISOTP_OPTS) in isotp_setsockopt_locked() (net/can/isotp.c) now rejects any frame_txtime between 1000000001 and… -- can: isotp: add the frame transmission time to the protocol timeouts This patch adds so->frame_txtime (N_As/N_Ar) to the rx, flow control and local echo timeouts that start when a CAN frame is transmitted. It also makes setsockopt(CAN_ISOTP_OPTS) reject frame_txtime values above 1 s with -EINVAL, and documents the new limit in isotp.h and iso15765-2.rst. Closes: https://lore.kernel.org/linux-can/eb5e9618-3dbf-42cb-a635-752ff9fbcb99@hartkopp.net/ > diff --git a/net/can/isotp.c b/net/can/isotp.c > index 7b88b3ace919e..18b1e815db4de 100644 > --- a/net/can/isotp.c > +++ b/net/can/isotp.c [ ... ] > @@ -1747,6 +1752,11 @@ static int isotp_setsockopt_locked(struct socket *sock, int optname, > if (hweight32(opt->flags & ISOTP_ALL_BC_FLAGS) > 1) > return -EINVAL; > > + /* frame_txtime must not exceed the N_As/N_Ar timeout */ > + if (opt->frame_txtime != CAN_ISOTP_FRAME_TXTIME_ZERO && > + opt->frame_txtime > ISOTP_MAX_FRAME_TXTIME_NS) > + return -EINVAL; > + > memcpy(&so->opt, opt, sizeof(*opt)); [Severity: Low] Can this break existing users of CAN_ISOTP_OPTS? Before this patch, every frame_txtime value except 0 and CAN_ISOTP_FRAME_TXTIME_ZERO was accepted and stored in so->frame_txtime. Now, values from 1000000001 to 0xFFFFFFFE ns return -EINVAL. The check runs before memcpy(&so->opt, ...), so the whole struct is rejected. None of the other options get applied either: - flags such as CAN_ISOTP_EXTEND_ADDR, and the padding and broadcast modes - ext_address - txpad_content and rxpad_content - rx_ext_address An application that used to pass a frame_txtime above 1 s can no longer configure the socket at all. Does the timeout fix itself need this limit? ktime_set() works for any u32 nsecs: include/linux/ktime.h:ktime_set() { ... return secs * NSEC_PER_SEC + (s64)nsecs; } So the new hrtimer_start(..., ktime_set(..., so->frame_txtime), ...) calls look correct for the full u32 range. The limit also does not cap the real gap between consecutive frames. CAN_ISOTP_TX_STMIN with CAN_ISOTP_FORCE_TXSTMIN can still add more time on top of it. The commit message does describe the restriction, and it names CAN_ISOTP_TX_STMIN as the replacement. Would it make sense to move the narrowing of what userspace can set into its own patch? Clamping the value instead of rejecting it would be another option. Either way, a backport of the timeout fix would not carry the ABI change with it. The check is still there at the end of the series. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-getsockopt-memcg-isotp-v4-0-97261be8e38e%40hartkopp.net