From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.73 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793669242; b=Yr4M7BgFfYStl/kvdq3xOERmMjTTarUXSZ4/a0i6Ktwj3Enm5dxW5SY3ETuIMQGGean7 ++VoG2w3+2Ugh5cP8izh3fWcsESU85mPfyj7nrZb1e0Ovk2MQoV5MqMJDEq7HsJeEaKuT due3yYIVThabf0Jqo5XAO2zaKG20beV/In+JFZF5Dd8zQLfYc9y7shv9jk4Sz60vi+KRT qdye5TUpFwIMuIAgsAiVsMw9/mpdDjTzO5SzUMEaS7gFHs3A7o8NQYy9m4c2VS20Mzcib 44Cgn3Dyd7UglxrNW8L9FUYa6Hs2OQu/vzBkVRAIq7IKGaXo7F96t3tfk9148Hfuc9Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793669242; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=xwrigN4hHrfQ0pdJAvaDQuroSa/OQ6XUSfC/4kh1PgE=; b=Sj7fETkdbmmvJIHRkpTvio2/rUUWKyD16/i0RL9jIHguT2OOakTiqj8ZqC0+J2BwC/TZ r+QiXFSUkSP2pBOW1ldaIbn0MSdeucVA/W4HSjblHPMFr0auzckt/1r8hO416rjoGVpzn Dy8k7vIb4ogm5MxqDkCzPf9INWYH6Di6HmEay3phYIY/SjFUblxDU4a/2SkdLHXDReOGK rW7LExXSDIIvwTnlfybwI2RdykPSalrXeRH6kWqB4r6L6NMp0Kwy6ImhPgRt0APo6kVJ0 LiY4KKaOb+4v1Cw8wI3lOUXcUynY25V42fqQPdImIxiChqHwPE7CV2a3ORq3i+/rZsA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=PB7soUHQ; arc=none smtp.remote-ip=91.218.175.73 Received: from mta0.migadu.com (out-73.mta0.migadu.com [91.218.175.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8965606A331 for ; Tue, 3 Nov 2026 01:27:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A8965606A331 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=PB7soUHQ X-Envelope-To: netdev@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=D+/gw0Ztw4cZkf3WTT5E7vaQ4EK3jAqSPRQxFCWd8ok=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793669238; v=1; x=1794274038; b=PB7soUHQZzgbmZjXh/fH9csK3Ied1/V+gZxo/SFEdSc1Zj3L2pmU2rSYLsgY2FEKuXAAHXcD ZM+yjE7osqIRQ6zEkD9hs1ySTqGPIroojC92NhjBfhUne0f36ayjAAXujQ0g87JjcHBf9wZK5Gl Mb8KKgNNX9fRjWUiCl/eteBI= X-Envelope-To: netdev@vger.kernel.org Received: by mta11.migadu.com with ESMTPS id 53184aca2c7ad085; Tue, 03 Nov 2026 01:27:18 +0000 X-Mizu-Trace-ID: 53184aca2c7ad085 X-Migadu-Flow: FLOW_OUT Date: Tue, 3 Nov 2026 09:27:03 +0800 From: Hangbin Liu To: Andrea Mayer Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , Ido Schimmel , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, David Lebrun , Daniel Borkmann , Mathieu Xhonneux , David Lebrun , Stefano Salsano , Andrea Mayer Subject: Re: [PATCH net 2/6] seg6: update skb checksum when ipv6_srh_rcv() decrements the Hop Limit Message-ID: References: <20261031225033.64-1-andrea.mayer@uniroma2.it> <20261031225033.64-3-andrea.mayer@uniroma2.it> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261031225033.64-3-andrea.mayer@uniroma2.it> On Sat, Oct 31, 2026 at 11:50:29PM +0100, Andrea Mayer wrote: > When the next segment is a local address, ipv6_srh_rcv() processes it > directly and also decrements the Hop Limit. With CHECKSUM_COMPLETE, > skb->csum is not updated for this change. If the packet is then delivered > on the same node and skb->csum was computed in software, for instance by > conntrack, UDP can drop the packet as a checksum error. With skb->csum > computed by the device, TCP can instead log a "hw csum failure", as if the > device had computed a wrong skb->csum. > > Update skb->csum for the Hop Limit decrement with update_csum_diff4(). > > Depends on patch "seg6: fix skb checksum update helpers". > > Found by manual code inspection, and reproduced in a VM without kernel > changes or error injection. A following commit adds a selftest that > reproduces the problem with a tc ct action. With this patch, the selftest > passes for the path with local SRH segments. Also tested against the srv6 > selftests, and with a ConnectX-6 Lx NIC (mlx5) that provides > CHECKSUM_COMPLETE. > > Fixes: 1ababeba4a21 ("ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)") > Signed-off-by: Andrea Mayer > --- > net/ipv6/exthdrs.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c > index 96c8402a27a5..9d3ba310065a 100644 > --- a/net/ipv6/exthdrs.c > +++ b/net/ipv6/exthdrs.c > @@ -460,6 +460,10 @@ static int ipv6_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev) > } > > if (skb_dst_dev(skb)->flags & IFF_LOOPBACK) { > + /* payload_len, nexthdr and hop_limit */ > + __be32 *hlim_word = (__be32 *)ipv6_hdr(skb) + 1; > + __be32 old; > + > if (ipv6_hdr(skb)->hop_limit <= 1) { > __IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS); > icmpv6_send(skb, ICMPV6_TIME_EXCEED, > @@ -467,8 +471,12 @@ static int ipv6_srh_rcv(struct sk_buff *skb, struct inet6_dev *idev) > kfree_skb_reason(skb, SKB_DROP_REASON_IP_TTL_EXCEEDED); > return -1; > } > + old = *hlim_word; > ipv6_hdr(skb)->hop_limit--; > > + if (skb->ip_summed == CHECKSUM_COMPLETE) > + update_csum_diff4(skb, old, *hlim_word); > + > skb_pull(skb, skb_transport_offset(skb)); > goto looped_back; > } > -- > 2.43.0 > Reviewed-by: Hangbin Liu