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=1796516588; b=o80/MxwRXMBhWqydS0YIp3omARD8lUANsv00sbzMpgFjoO92IlJDRFAgwGLJ9hGz62fF MIWq9Ve6iKp+l1IKW3hYnb3N2FNualeefiXUJH+Ra33sh0q2WnCsD4iEpyaBoXTo92CR/ Hj1GoXfhAvOe+gs9m8nEmu7O9jUyHuO+p29rRMRgHRFJkw0pUyJh50q952uoIWZYGsgqO 9qIgJRJ+v07M+ObY7hQi0a/8hakS614lKJyIcYySX/DExD9jfLYOGKEaLhOsu1lRCdIqp B0SNMHFNaZh2AFph5N5PFSoxcwZQfWTc56F7AV7gZMCYANZRBCMvrncCNem6xFJyJuQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796516588; 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=tRx3qwj5dMwwOlwErHi2YOwXnel30Vw7siietJUl+rE=; b=WsJUFF5R9tlaChLBmYwIRPmtkxTx7F56wTxRxHeYF2cd8Q0heRODzbduZCzyyuF5dbJX wk4M2g18mDr4tDdtiKwq1WtGt7s2cQ+DhzIyQ68B1yTRq2UBKA1mTr6NVviNmjVX+6wZp Fi917c8GxMX8lj4RdX20tbAH4YHT0VHeZPSiVFl8U8kJGQlfavA2k2EePZeN9cqaAmyzx Gs13FCvXEZsJDMnTg4r0wClmFEa7PWcmLBXiGtwNwRYzvQlV+oRJpcllZOSZCqWeGxYsr BBV8XvYaERGzTNbYtmRWLzgIbtrk93UvhfwkbMCEIg5HhdnmLA43vwtRKfhTxU0+r7w== 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=QQUVJv3E; 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 40762606A338; Sun, 6 Dec 2026 00:23:08 +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=QQUVJv3E Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43E091F0093B; Sun, 6 Dec 2026 00:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796516587; bh=tRx3qwj5dMwwOlwErHi2YOwXnel30Vw7siietJUl+rE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=QQUVJv3EimnS+6ZhPQ9KDhkrR7cmBQgfnKQx5ElDfWjt2Uk97AD/dkuvwh0dymkgE w0thBKmTx3rOpy5yWZqAAGoJh76oUR3jpBrmhWrclR/VXzRxU0F6D9p2RRGtuuNiIZ 9DzuR4WiRw3PVqDUR/K4KQXvXkk+dKMII9LtGpH+SKCHMmEaP7J2tBnKWwhkTxU5H8 sHe7SM18uthKOLrR71C0BwRViNKegnNyJFiFw8E3QLTzmzrSaDnpPNEVI9usjrKbd0 bCQb92HZd5tLXX+/xE8pDajrEmhK7ZLZFIyCUvnx1VZBXOBjugmYiLU6PqXMpTHFMb fhO5j0zCZs82g== Subject: Re: [PATCH net v3 4/9] tls: device: remove the dead start marker bypass in TX fallback From: netdev-bot+sashiko@kernel.org To: rjethwani@purestorage.com Cc: netdev@vger.kernel.org, stable@vger.kernel.org, john.fastabend@gmail.com, kuba@kernel.org, sd@queasysnail.net, davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, alice.kernel@fastmail.im, tariqt@nvidia.com Date: Sun, 06 Dec 2026 00:23:06 +0000 Message-ID: <179651658685.3148.5418160875152343674@kernel.org> In-Reply-To: <20261204235642.36653-5-rjethwani@purestorage.com> References: <20261204235642.36653-5-rjethwani@purestorage.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@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 comment this patch adds in tls_sw_fallback() (net/tls/tls_device_fallback.c:393), "Its record was acked and freed:… - [Low] This patch edits the '*sync_size < 0' branch of fill_sg_in() (net/tls/tls_device_fallback.c:239-252) and removes the… -- tls: device: remove the dead start marker bypass in TX fallback This removes the start marker bypass in tls_sw_fallback() and its special case in fill_sg_in(). The reasoning is that pre-offload skbs now return early from tls_sw_fallback() before record lookup, and TCP will not merge them with decrypted data across the start marker. The commit message says there is no functional change. > diff --git a/net/tls/tls_device_fallback.c b/net/tls/tls_device_fallback.c > index 42afbe7e60b56..da875fdf5b546 100644 > --- a/net/tls/tls_device_fallback.c > +++ b/net/tls/tls_device_fallback.c > @@ -237,8 +237,6 @@ static int fill_sg_in(struct scatterlist *sg_in, > > *sync_size = tcp_seq - tls_record_start_seq(record); > if (*sync_size < 0) { > - int is_start_marker = tls_record_is_start_marker(record); > - > spin_unlock_irqrestore(&ctx->lock, flags); > /* This should only occur if the relevant record was > * already acked. In that case it should be ok [ ... ] > @@ -250,8 +248,6 @@ static int fill_sg_in(struct scatterlist *sg_in, > * on TCP to retransmit a packet that doesn't contain > * already acked payload. > */ > - if (!is_start_marker) > - *sync_size = 0; > return -EINVAL; > } [Severity: Low] This isn't a bug, but should the comment above be updated along with this change? As far as I can tell, tls_get_record() can only produce a negative sync_size by returning the start marker record. The marker has len == 0, so it skips the between() range check: net/tls/tls_device.c:tls_get_record() { ... /* send the start_marker record if seq number is before the * tls offload start marker sequence number. This record is * required to handle TCP packets which are before TLS offload * started. ... } Records are contiguous, because tls_push_record() sets each end_seq to tp->write_seq + record->len. A seq inside a record that was already acked and removed by tls_tcp_clean_acked() fails the between() check, so tls_get_record() returns NULL. The earlier !record branch handles that case. Before this patch, the is_start_marker check showed in the code that this branch covered the pre-offload case. With the check gone, the branch can only be reached through the start marker, but the comment still says it is the "already acked" case. Would it be clearer to rewrite the comment to describe the start marker invariant, or to replace it with something like DEBUG_NET_WARN_ON_ONCE()? [ ... ] > @@ -394,12 +390,9 @@ static struct sk_buff *tls_sw_fallback(struct sock *sk, struct sk_buff *skb) > sg_init_table(sg_in, sg_in_max_elements); > sg_init_table(sg_out, ARRAY_SIZE(sg_out)); > > - if (fill_sg_in(sg_in, skb, ctx, &rcd_sn, &sync_size, &resync_sgs)) { > - /* bypass packets before kernel TLS socket option was set */ > - if (sync_size < 0 && payload_len <= -sync_size) > - nskb = skb_get(skb); > + /* Its record was acked and freed: drop it */ > + if (fill_sg_in(sg_in, skb, ctx, &rcd_sn, &sync_size, &resync_sgs)) > goto put_sg; [Severity: Low] This isn't a bug, but is this new comment accurate for every way fill_sg_in() can fail? fill_sg_in() returns -EINVAL from three places. Only the !record case from tls_get_record() matches "acked and freed". The *sync_size < 0 case can only be reached through the start marker record. That record is live, not acked and freed. The last case happens after a live record has been found and its frags referenced with netmem_inc_ref(): fill_sg_in() { ... if (skb_to_sgvec(skb, &sg_in[i], tcp_payload_offset, payload_len) < 0) return -EINVAL; ... } __skb_to_sgvec() can return -EMSGSIZE when the sg table runs out or the recursion is too deep, or -EINVAL when the length is short. In that case the packet of a live record is dropped because the scatterlist conversion failed, not because of an ACK. The drop and the put_sg cleanup are fine for all three paths. Could the comment say something like "drop the skb on lookup or sg setup failure" instead? > > nskb = tls_enc_skb(tls_ctx, sg_out, sg_in, skb, sync_size, rcd_sn); -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204235642.36653-1-rjethwani%40purestorage.com