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=1796434038; b=mtOJx0Uu3pdpmraMQCM16aOqVCP5QFIk0DlNGynuTG3YBmUJcJwkz/z72JizPW4QLyP3 /IT6GN7yR2Y9f1b40djv/AJDrkMGqW6sfTVNh9Wy3Ms1uzEF78Uy4s7fPIye5Ev+LLgQF nM3R9BUDu6RfdFoExJaTboSvS9SRbqTGgRDMtVMOTpz85ooABsV3d2XpO/XuCmmFaJfCd No7ne9PUdSEn00zrqXMzXPzbJaAhL8R+mKu3HOyIy2wi0IORMMMfBjkQ8FidJm3/u3ZPZ 5MFatMq1hV6/sF4VRwLh38JIumHzW/9WAjWfLmIi4uv8VCnMcVw991Do9I8SCQLSWFg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796434038; 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=7HdhwpZX7aVsHRbb7+6kME0t7f5+iHfSMrZ4LxSJZsM=; b=wYqWDU/y2GavzxdF1Z8OGJo0NT8hWwLm7xHN2Jv8+mopZtPKd0DuOcAln33j/9g9SNj3 +gnw3IIlmMtQSp+mMj/JOQMauGZk6Sbl+7YGEBB58NXuo8VFu8fqFGtJhvI0AzYrIzM0H JTNaUVAA0m+QG1PaHRklEjxIK7h7EjfyOjYyltihx9FTld4D4r6ryC2WaaN+1v2fhEuJM Dz+I0NBbP5Sao8tpxBcVEhTR4fYPqtoWWHhy3N1Ri/FBdJHTMKJAv4g94NKCqIR0TGwUZ pf8bbuFQF/b8St8P75MLNmURq+1FF47RDzOAgNQC1+47kjow6FMG4AO7dw6PN1BZm0g== 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=O2Jcpv03; 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 C5A3A606A322 for ; Sat, 5 Dec 2026 01:27:18 +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=O2Jcpv03 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 734F01F0092B; Sat, 5 Dec 2026 01:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796434038; bh=7HdhwpZX7aVsHRbb7+6kME0t7f5+iHfSMrZ4LxSJZsM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=O2Jcpv03zaIEyb8WjwaLCEew+BkrrqPP2436gluVGE9Ny9wWd02gw3Y3uykxOLxA6 FYAnm2luPk/b+wvtYrSLspjCNCOMH8pzCheTkJmva8RxOOQeWh/vEIM4XSeJrF/OrV Mj1A4368yoYFbDXlKTsybvS79E6ZLFVU7/HRpNaspFSCMJ7W4Pn5z5vnkloBNoCoXR BOTVsqgm/zLKTkyATUdyRZdp4luOageRAaG/QdxqOu7ECvd2rbruxA5Bab4ikQw5xI /mJZbg8gVdkTuPlr1OWD3cuuniCCfek7MGuDsObojya2SHHtDkTr0yXqKk+bVFkdph hjcYoHtfEH6vQ== Subject: Re: [PATCH can-next v5 04/24] can: isotp: do not send FC.OVFLW in listen mode 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: <179643403805.3142.6130284252643886346@kernel.org> In-Reply-To: <20261203-getsockopt-memcg-isotp-v5-4-bbe89b3d3b71@hartkopp.net> References: <20261203-getsockopt-memcg-isotp-v5-4-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] This patch moves the CAN_ISOTP_LISTEN_MODE check out of isotp_rcv_ff() and isotp_rcv_cf() and into the top of isotp_send_fc(). -- can: isotp: do not send FC.OVFLW in listen mode A socket in CAN_ISOTP_LISTEN_MODE could send a FC.OVFLW frame on the bus from isotp_rcv_ff() when FF_DL exceeded its receive buffer, because the listen mode check was only done before the FC.CTS sends. This patch moves the listen mode check into isotp_send_fc() so that no flow control frame of any kind is sent in listen mode. > diff --git a/net/can/isotp.c b/net/can/isotp.c > index 3b83507a8c21b..650d93e84c8eb 100644 > --- a/net/can/isotp.c > +++ b/net/can/isotp.c > @@ -294,6 +294,10 @@ static int isotp_send_fc(struct sock *sk, int ae, u8 flowstatus) > struct isotp_sock *so = isotp_sk(sk); > int can_send_ret; > > + /* no creation of flow control frames in listen mode */ > + if (so->opt.flags & CAN_ISOTP_LISTEN_MODE) > + return 0; > + > nskb = alloc_skb(so->ll.mtu, gfp_any()); > if (!nskb) > return 1; > @@ -643,10 +647,6 @@ static int isotp_rcv_ff(struct sock *sk, struct canfd_frame *cf, int ae) > hrtimer_start(&so->rxtimer, ktime_set(ISOTP_FC_TIMEOUT, 0), > HRTIMER_MODE_REL_SOFT); > > - /* no creation of flow control frames */ > - if (so->opt.flags & CAN_ISOTP_LISTEN_MODE) > - return 0; > - > /* send our first FC frame */ > isotp_send_fc(sk, ae, ISOTP_FC_CTS); > return 0; [Severity: Low] This isn't a bug, but the comment just above this hrtimer_start() in isotp_rcv_ff() is now misleading in listen mode: /* start rx timeout, isotp_send_fc() restarts it */ hrtimer_start(&so->rxtimer, ktime_set(ISOTP_FC_TIMEOUT, 0), HRTIMER_MODE_REL_SOFT); /* send our first FC frame */ isotp_send_fc(sk, ae, ISOTP_FC_CTS); The new early return at the top of isotp_send_fc() happens before the so->rx.bs reset, the so->lastrxcf_tstamp reset and the hrtimer_start(&so->rxtimer, ...) at the end of that function. In listen mode isotp_send_fc() never restarts the rx timer. Before this patch the explicit CAN_ISOTP_LISTEN_MODE return sat between the comment and the call, so the skip was visible. Now the call site reads as if the restart always happens. isotp_rcv_cf() has the same comment above its hrtimer_start(), followed by the same isotp_send_fc() call once the blocksize is reached. The runtime behaviour doesn't change, since the timer the caller just armed is still the one that applies in listen mode. Could the comments in both functions mention that the restart is skipped in listen mode? The later N_Ar monitoring patch in this series changes the timer value to ISOTP_TIMEOUT, but it keeps the same comment and the same early return, so the mismatch is still there at the end of the series. [ ... ] -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203-getsockopt-memcg-isotp-v5-0-bbe89b3d3b71%40hartkopp.net