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=1796183339; b=dtl2AJb3RJG9b3QdE3ieG7BM+QbIQja6JSTmD2MZi5OpstJJ0LD8scsYZhREvgS7rkg5 h/MiLZf77uqIWX+FLlPyboMPDNWSkrSRzR1LXxjY4yALXK9PWHmqJlr4xzeIz7jbiXu9f wRJf6/fe0RNMO1RglMLQ6bU6Jc5aM8QukzkejaBque6GNWeKS4N/nXtjHOtG2CR7qFNxf UIBwT674FlG7lj3/aNR7J9uzHg0zDyQVLCxXwFhyOV9iLGvfmd/NJY1qoNZ17CagVH+DX HYWD2vL4H+AVej5vff1pS1zqSZZLkdlsez3I3X8fWnORxmd10jSbcV5pahw+YlvZCag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796183339; 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=U5apnqnpysRItYMfbQnsgTxg17rn13H4/W60f72Xij8=; b=UNp0t2aXfK/mYLK3zYQpJCML3YR/WTgbwB0+c05moHRpJqbPMT+34YxMNKYRNsgKLbxw a3+3XubjqXBgP4PRzvAV6HUOlCo27KbsYyE3xz6nDXw8It3VjMllsaulPG+mUtM890SWb ynf5+NivXsYnntTqaGj8Xolu+CruwyMQfVH9FUXm9U0cNVNRuIClh2VJfnhhliaIaFJuk bjVcrAU+XST0/JIe8iRgVeAGoO2+GaygPV2W6ukBiRQcCHOkAGKXvlZ5uog/Xf+U8/bRY 8KOzJ0cIQDDcToGQ29b//r2DwphiLd96A9fwe8dROCnGlAVYojLIWRHFiorpWG3e+ag== 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=ENyj+DtR; 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 39C69606A31A for ; Wed, 2 Dec 2026 03:48:59 +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=ENyj+DtR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44FBD1F000C1; Wed, 2 Dec 2026 03:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796183338; bh=U5apnqnpysRItYMfbQnsgTxg17rn13H4/W60f72Xij8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=ENyj+DtRCvtbGT7ZNY7seVYcjUZRTwQFfUKBs+RIgqeBEFhZd/P1QNcgTypxBvMIa 840GZ6BdH62bcwwpkdXa/Ozf57LpFqZMI8zPR9yVtOTnPAKinopbP3fk2nVM2GzNVx wXgApSQo95BIKenWBVGfuPBWvpRE2gilQ16kcBCzbpPtriznxFApGHqcB0SSmyzNY1 MlcOSrB5X+hzlq/NHEmyHFobVSW+utQWpvuFMMxaR47/jEiKWlnnhlBhRHmWZyZiAy Wf/aJneQT4gkS8EC2H2gC4ptaTCx4RDSCT5Gaz4jWug0/Rtibr1SXuzVEefjZ/HNQJ CvPyw+HK0pRDw== Subject: Re: [PATCH can-next v3 14/23] can: isotp: check the minimum FF_DL From: netdev-bot+sashiko@kernel.org To: socketcan@hartkopp.net Cc: linux-can@vger.kernel.org, mkl@pengutronix.de, kuba@kernel.org Date: Wed, 02 Dec 2026 03:48:57 +0000 Message-ID: <179618333779.3142.2308186571518228389@kernel.org> In-Reply-To: <20261130-getsockopt-memcg-isotp-v3-14-21d72c15ad1d@hartkopp.net> References: <20261130-getsockopt-memcg-isotp-v3-14-21d72c15ad1d@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] The commit message gets the old receive behaviour wrong for one of the two FF_DL cases it describes, and it does not mention an… -- can: isotp: check the minimum FF_DL This commit changes the FF_DL check in isotp_rcv_ff() so that a First Frame is ignored when its FF_DL would fit into a Single Frame at the sender's LL_DL, as ISO 15765-2 requires. FF_DL is now compared against the maximum SF_DL, the same way isotp_sendmsg() does on the tx path. > The rx check in isotp_rcv_ff() added a SF_DL escape offset for LL_DL > 8 > on the wrong side and only rejected FF_DL < LL_DL - ae - off - ff_pci_sz. > So it did not even ensure that a CF is needed. It accepted FFs whose > FF_DL fits into the FF itself (e.g. FF_DL 6 for LL_DL 8, FF_DL 61 and 62 > for LL_DL 64) and FFs whose FF_DL fits into a SF (e.g. FF_DL 7 for > LL_DL 8). In both cases the receiver sent a FC and waited for a CF that > a compliant sender never sends. [Severity: Low] Is "in both cases" accurate for the second case? Take classic CAN (LL_DL 8) with FF_DL = 7 - ae. That is FF_DL 7 with normal addressing, or FF_DL 6 with extended or mixed addressing. The FF carries only 6 - ae payload bytes, so one more byte is still needed. A lenient sender that segments such a PDU does send that CF. The old check in isotp_rcv_ff() accepted this FF: if (so->rx.len + ae + off + ff_pci_sz < so->rx.ll_dl) return 1; The 1-byte last CF then passed the short-CF check in isotp_rcv_cf(), and the PDU was delivered to the socket: if (cf->len < so->rx.ll_dl) { /* this is only allowed for the last CF */ if (so->rx.len - so->rx.idx > so->rx.ll_dl - ae - N_PCI_SZ) return 1; } With this patch, sf_max is 8 - SF_PCI_SZ4 - ae = 7 - ae, so the FF is now ignored: if (so->rx.len <= sf_max) return 1; rx.state stays ISOTP_IDLE. isotp_rcv_cf() then silently drops the CF that follows: if (READ_ONCE(so->rx.state) != ISOTP_WAIT_DATA) return 0; Ignoring these FFs is correct under ISO 15765-2, since FF_DL is below FF_DLmin. But this case did not hang before the patch. After the patch, Linux no longer receives 7 - ae byte PDUs from such senders, which it received before. The hang described in the message only applies to FF_DLs that fit entirely into the FF. That is 6 - ae on LL_DL 8, and ll_dl - 3 - ae to ll_dl - 2 - ae on LL_DL > 8. For LL_DL > 8, sf_max equals the 12-bit FF payload capacity, so the case that used to work only exists on LL_DL 8. This stays true at the end of the series. The later commit "can: isotp: introduce CAN_ISOTP_MIN_TX_DL" only replaces CAN_MAX_DLEN with CAN_ISOTP_MIN_TX_DL (both are 8) in this check. Could the commit message describe the FF_DL = 7 - ae case on LL_DL 8 as a deliberate tightening that changes interoperability, instead of a transfer that used to hang? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130-getsockopt-memcg-isotp-v3-0-21d72c15ad1d%40hartkopp.net