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=1796434039; b=XDL+1k7L3I6r5VUydZZFKJZj73cH4G67oXI1sf/wd78/wCBdMPk9lZqX8KLN18tAk/UC tLtLTclHRgTtVFetJ1UMARKaaIbH5/zEmiFnMYcJsB6tp1iT1bYABTMUucy1T/G6oueua eX5j+TpKGTl5XwM+Axmo6APFGAAobwFd6WI+ex4p+tgTOk2uEq0u+u/E7/6cwz+lreJ2z GbPrME845OWgW6ie8c3J67ust451ykITYca0DGQuOi85i2EHnxWtDu7GB65ztYZjeaP+P tBC8oTUt9prYYZh36kN1nGraIwF9A257ll0SEcKTh6siW0zbX+QOb52qJLZWZTyd2Lw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796434039; 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=Bb8bKAa5YEBMuMTq5UA2UlJ6myvJRLeqAsfMmJnjOcE=; b=pPvGLPx/GerC/2WogqLa10ngT9gLjqc9IAePz1oI6VkpGV65Yqz5CZ+eQH1D4E6NNvwS U1DM02vN/RVVhsjIK8xHyj59WfpwncPeQZiUPoQSsstzPlo5L6E9rsLkKkueDgPaumuYb nnl+iM5i/zDdICi58DnyD8NONfcKqa/a8fgyEz52GPjXo5YOnOQVqF2K7iYy/wVIl8J3L BaW0g1eUUspGt89nkWmpkw4exOQssX21cl4zZM0AHORIMr23YShNjWMyFnW3cULyMYIsF pmnHr9dOYwpWrbDRusqLpq+JwtcaMnYY1btbcf6VQRMh9kpFtVKB5F/gwqxEgfIWT7A== 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="Bz2/U/Ll"; 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 9F0B3606A322 for ; Sat, 5 Dec 2026 01:27:19 +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=Bz2/U/Ll Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45B471F0092B; Sat, 5 Dec 2026 01:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796434039; bh=Bb8bKAa5YEBMuMTq5UA2UlJ6myvJRLeqAsfMmJnjOcE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=Bz2/U/LlNVltw6RXwmJU0KDwDIIcVAW59n8cbZmx8foIJPLAhZn4nZF9AlesTJYCu q+8nM16BWqUd7KuxSJmVdm9zSmEaFt9PagbH/JSuvXCe7lkIcrqc3cDqRolmxLeTmq wFJVjotF50meHEWGMX3bTm1pQGAEmMezB0HAruH/uquRERAbVb2Se4TcVoZm++Ou7m q9inGIsNWnObk4UHGKZedXdFi0ab8dk0mH3smrnozkTGNCAHzxDCuxUPI+Y7uhXsE/ zfEDwqX2pUYC4wHIbUTtBYSvggAAHeFQ8JDkuuHTnjo2Pp1M+V1e+w9/VEazkuYM8F q+qCD8F6Rf4Mw== Subject: Re: [PATCH can-next v5 05/24] can: isotp: check the CAN_ISOTP_OPTS values before applying them From: netdev-bot+sashiko@kernel.org To: socketcan@hartkopp.net Cc: linux-can@vger.kernel.org, mkl@pengutronix.de, kuba@kernel.org Date: Sat, 05 Dec 2026 01:27:18 +0000 Message-ID: <179643403883.3142.4950991542041862335@kernel.org> In-Reply-To: <20261203-getsockopt-memcg-isotp-v5-5-bbe89b3d3b71@hartkopp.net> References: <20261203-getsockopt-memcg-isotp-v5-5-bbe89b3d3b71@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 of "can: isotp: check the CAN_ISOTP_OPTS values before applying them" says neither whether this is a fix nor… -- can: isotp: check the CAN_ISOTP_OPTS values before applying them This patch makes isotp_setsockopt_locked() check the broadcast flags in the local copy of the CAN_ISOTP_OPTS values before they are copied into so->opt. A setsockopt() call with more than one broadcast flag set is now rejected with -EINVAL and leaves all socket options unchanged. hweight32() is used so that more flags can later be added to ISOTP_ALL_BC_FLAGS. > isotp_setsockopt_locked() copies the CAN_ISOTP_OPTS values into so->opt > before it checks them. When CAN_ISOTP_SF_BROADCAST and > CAN_ISOTP_CF_BROADCAST are set together, CAN_ISOTP_CF_BROADCAST is > removed and the remaining options are applied, although -EINVAL is > returned to give user feedback on the wrong configuration. [ ... ] > Signed-off-by: Oliver Hartkopp [Severity: Low] Should this patch have a Fixes: tag and say whether it is meant for stable? Before this patch, setsockopt(CAN_ISOTP_OPTS) with both CAN_ISOTP_SF_BROADCAST and CAN_ISOTP_CF_BROADCAST set returned -EINVAL. By then isotp_setsockopt_locked() had already overwritten so->opt. It had removed CF_BROADCAST and applied ext_address/rx_ext_address and frame_txtime. A later bind() still sees SF_BROADCAST in so->opt: net/can/isotp.c:isotp_register_rxid() { /* no broadcast modes => register rx_id for FC frame reception */ return (isotp_bc_flags(so) == 0); } So the rx_id registration is skipped, and getsockopt() returns the partly applied options. Any unprivileged user can reach this. The apply-then-fail block came from 9f39d36530e5 ("can: isotp: add support for transmission without flow control"). That looks like the right target: Fixes: 9f39d36530e5 ("can: isotp: add support for transmission without flow control") The other patches in this series say how they are classified. For example, "can: isotp: do not send FC.OVFLW in listen mode" has Fixes: and Cc: stable. "can: isotp: read socket options under conf_lock in isotp_getsockopt()" states "so this is no fix". The new check also relies on the option values being copied into a local buffer before conf_lock is taken. That copy came with 43c973a0887d ("can: raw, isotp: copy socket options outside of lock_sock()"). The conf_lock itself came from "can: isotp: use a private mutex instead of lock_sock()". If this is meant for stable, could that dependency be noted for backporters? If it is meant only as a uAPI tightening, could the commit message say so? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203-getsockopt-memcg-isotp-v5-0-bbe89b3d3b71%40hartkopp.net