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=1796309448; b=EKSXA1CwAC1EFGyIX83xMD3K2kncX+y12HNpSDu1n3dwmJH8AfQjIkCNQgeGZ+sFe2ak cMUAUK29igf6hB40OiVbRyq384J+dRgkSISasuAVwY3FYSHTwwU1UWRJeGRJZKEtvcZA2 187afDn+1xw4SdUbOaiTpoL5xVvPbjvr52TakBYPEk1Y9OfWCnqNOjL/xu/qiw8HJVQKG vinVnkOhAWP/5QwaDGEBaHkZVFwwLN6V/Ja2rGPA8EY3E72DSdcVdgOo9N9kH+ThUsOdX qYfDf7g8Fe0eycyZWK6mWR9NGQu0AveAz9EJhXOvet5pY4nVJ8CtDIl7R2iG9DMrZAg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796309448; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=F4kTomVR59FzZ+6vIAvxRrEM1oAEMK9oXFDyENYCm8Q=; b=IigRQuAvH3lQX9sJYTrZwfQp5t2gbcleK+48s5G6rrjiav140Rw2XBK2aB7mUYslxUxN uG5AIdmADj2h7hnCF5Is8JVy002GNaFwGy/mqdyT7ymDebD30Mus9YJlZqx2BDR7GepEm VTV3s0yG2KUeo9GRUV6j5nm7WXa1j1E7ma0hlm0PB5qfJ9ypK0WntVMFPOVYdS0iktQiZ 3tiYUsQ+lI747uWiek8akcRgDaDfuqM1S+4ZlyWB/6Uh2PGsoRaEX5sf8EmEw9JEnGylt 0IGfZyAFaZcfXdbsbFF4yhRvipvy6jnAig6KCmWqe+WwIcx1gHO5ISHTyfFpq0XT38A== 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=iKiXYxSp; 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 D28AC606A68A for ; Thu, 3 Dec 2026 14:50:48 +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=iKiXYxSp Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF8801F00924; Thu, 3 Dec 2026 14:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796309448; bh=F4kTomVR59FzZ+6vIAvxRrEM1oAEMK9oXFDyENYCm8Q=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=iKiXYxSpqLuMJp9exk23LfGafRzQsxJA2esGr+ZkGvz10VBpcTMfA+ld4TwMq7Kla MD4b2xOzssUWloCt6iHdIePybs/zStFChs7jsjxnAEuCymBQnfeSSD0Z/TJIojqv+Y wzZgNOq/ra/6rPFykoSVsp6FkcGbf4c7fvitlHG6uIvdW5HzM/GEyJ62/7zRahzSaT 1VsXP+F0MlyEat0GmjDWsMxzfA8OaHxcG1TINzXVltg3P6Q37yfDKWJsv8UXCkhRNy HEikXTfkigB5L36W1W3Io2h0pTAD5qJ2WkdGpj77iF8Sl25CaIS/K1nUNXbkUBppym wII3nOdThYRUA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH can-next v5 10/24] can: isotp: check the CAN FD tx_flags in CAN_ISOTP_LL_OPTS Reply-To: sashiko-reviews@lists.linux.dev To: "Oliver Hartkopp" , linux-can@vger.kernel.org Cc: "Marc Kleine-Budde" , "Vincent Mailhol" , "Oleksij Rempel" In-Reply-To: <20261203-getsockopt-memcg-isotp-v5-10-bbe89b3d3b71@hartkopp.net> References: <20261203-getsockopt-memcg-isotp-v5-0-bbe89b3d3b71@hartkopp.net> <20261203-getsockopt-memcg-isotp-v5-10-bbe89b3d3b71@hartkopp.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:50:47 +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 1 potential issue to consider: - [Medium] can: isotp: forcing CANFD_FDF in tx_flags breaks getsockopt() UAPI -- commit e05fced7dfd2c0a7be0241e55fe44333f192d6d9 Author: Oliver Hartkopp can: isotp: check the CAN FD tx_flags in CAN_ISOTP_LL_OPTS This commit restricts tx_flags in CAN_ISOTP_LL_OPTS to CANFD_BRS and CANFD_FDF for CAN FD sockets, sets CANFD_FDF in the stored tx_flags, and updates the uAPI header and documentation. > diff --git a/net/can/isotp.c b/net/can/isotp.c > index d1f98c8d5c851..811cbe8dd7814 100644 > --- a/net/can/isotp.c > +++ b/net/can/isotp.c > @@ -1822,8 +1822,17 @@ static int isotp_setsockopt_locked(struct socket *= sock, int optname, > (ll->tx_dl > CAN_MAX_DLEN || ll->tx_flags !=3D 0)) > return -EINVAL; > =20 > + /* only CANFD_BRS (and the CANFD_FDF marker) for CAN FD frames */ > + if (ll->mtu =3D=3D CANFD_MTU && > + (ll->tx_flags & ~(CANFD_BRS | CANFD_FDF))) > + return -EINVAL; > + > memcpy(&so->ll, ll, sizeof(*ll)); > =20 > + /* CAN FD frames are always marked with CANFD_FDF */ > + if (so->ll.mtu =3D=3D CANFD_MTU) > + so->ll.tx_flags |=3D CANFD_FDF; [Severity: Medium] Does forcing CANFD_FDF into so->ll.tx_flags break getsockopt() uAPI compatibility for existing CAN FD callers? isotp_getsockopt() returns so->ll verbatim, so callers that configure CANFD_MTU with tx_flags =3D 0 or CANFD_BRS will now read back CANFD_FDF or CANFD_BRS | CANFD_FDF. This breaks callers that compare the returned struct against what they configured. It also breaks read-modify-write transitions back to CAN_MTU: a caller that reads CAN_ISOTP_LL_OPTS after setting tx_flags =3D 0 and only updates mtu and tx_dl will now fail with -EINVAL on the ll->tx_flags !=3D 0 check above. Since can_send() already sets CANFD_FDF on every transmitted CAN FD frame, leaving so->ll.tx_flags unmodified preserves getsockopt() compatibility without changing the frames on the wire. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-getsockopt= -memcg-isotp-v5-0-bbe89b3d3b71@hartkopp.net?part=3D10