Article View: linux.kernel.netdev
Article #10899Re: [PATCH net] ipv6: ioam6: do not modify shared tuninfo eh.nexthdr
From: Hangbin Liu
Date: Wed, 04 Nov 2026 09:33
Date: Wed, 04 Nov 2026 09:33
22 lines
8949 bytes
8949 bytes
On Wed, Nov 04, 2026 at 05:27:23PM +0800, Hangbin Liu wrote:
> From: Hangbin Liu <liuhangbin@kylinos.cn>
>
> ioam6_do_inline() and ioam6_do_encap() stored the next header into
> the shared ilwt->tuninfo template and then memcpy()ed it into the
> skb. The lwtstate is used from multiple CPUs without locking, so
> another packet can overwrite eh.nexthdr between the store and the
> memcpy.
>
> The packet can then leave with an HBH nexthdr that does not match its
> payload (e.g. TCP labelled as UDP, or a local packet labelled
> IPPROTO_IPV6). Set nexthdr on the per-packet Hop-by-Hop copy after
> memcpy instead, leave the shared template read-only.
>
> Fixes: 3edede08ff37 ("ipv6: ioam: Support for IOAM injection with lwtunnels")
This patch should also
Fixes: 8cb3bf8bff3c ("ipv6: ioam: Add support for the ip6ip6 encapsulation")
Hangbin
Technical Details
Message-ID:
<aur73BdyLKNrZAUZ@fedora>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356340-linux-kernel-netdev=dewy.ruReferences:
<20261104-ipv6_ioam_lock-v1-1-4f24c41b261b@kylinos.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356340-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net] ipv6: ioam6: do not modify shared tuninfo eh.nexthdr Date: Wed, 4 Nov 2026 17:33:16 +0800 Organization: Usenet Network Message-ID: <aur73BdyLKNrZAUZ@fedora> References: <20261104-ipv6_ioam_lock-v1-1-4f24c41b261b@kylinos.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3364007"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:cRMpG9rnA2ZSJi9pAeniQoKa9mw= sha256:UL5fES/7La0VZF2WYlQh97hMhgV8wLY8O6RlVxm4Qrw= sha1:OwnOn2QfsHmIca9HrrH53SKSLuo= sha256:MUZB/P2kKzCNCVdpwS4cRyn94l/M3vccFsicjaTzHgo= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 8FC03112B70; Wed, 4 Nov 2026 12:46:24 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s5_BGcnrqe8H; Wed, 4 Nov 2026 12:46:19 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-356340-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 3AC0D112B5D; Wed, 4 Nov 2026 12:46:07 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 7BEBC28B7F; Wed, 4 Nov 2026 09:33:49 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793784826; b=OcLZaLoFQZjxornLh29e0/Yv1MzjYTZOjlEQ9ihe0Qtn2qPbYHIiCYeL7Jftfmz4gas2 472dZIxfJBi+1UGLQSoQcoEvKfSnH4nnKfLdVQnbf468GlVgui82FeDJOjtEiRu+rc508 VbV7LqvTNAj2qhlk7J3m/q1Vn9bNC40WYu3+8UfUR/jt49zn3TyEjvqoC5FcNBQGnze9r QfgG7qXLsPsMRkqB8saVRDn7YIlakr95AMUMRadlWI6EzI/Wweg6TAWgVAS/sWtSSWGOd r1Q1mf0Sh1/0ChhbzXmiQpcey4y3G1LIMb5b04FqNB67ZYPVsVFz8Oh7tZfXroy9jFg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793784826; h=X-Original-To:Received: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:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=PUV7VlMf0EvvLzp+y5o1NyE7TTufq1+bMSMSc6a2SOE=; b=O6FeYQ6ppKAfFpAi8JJfq/fUJR7CqmWiGHwdoA0tUlf93DfJ8yvutKqPtURtpXPA28oK bc7fym08utyGqQ2zkFp9NdnlOubRF3j5tgXfXueu22kcvVGZJhjEkj+OzJ7JNFtUuWl0/ eCFqcl36aTYTd7xLPcUer35K3YLC13G0t5bcVgbnK5MI7ZoeYW41LhM1yo4IfQL6YkvTd 6rojD4/uS+aabigpxPSTgLdc2UJhySb0wyFYnfGtTSh8MrntjIfcF6tS0VIqKzttYLAeW bYNnkDuVZALp0fNBV1gQjkztQdnmiPhwXu2EmD4rZFakho54bA8kqJ7Kr8vRNBOoKMg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=j7HCUZ3X; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A20E606A33A; Wed, 4 Nov 2026 09:33:46 +0000 (UTC) X-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=j7HCUZ3X X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.93 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793784820; b=NeEw8Jkp6kcEGSrunxTpAjVZ3D5MKDN6jW8QJlbHrxrK3bLx+bkSMA5kCiYlbOtzDmGR goEO5vaK/diC6EJD0/zlH3eFic6MuX9Zf4D8g36onh7H/hnRV7wMZm51ZXVlNzY3nGF3J pFK22jttI5kZZ2SFFb8z5AOWPcmX0s0/ZxPa8DeiKNq6Jpb6KOY4c8sT5ETjLyEAxq94l XO9KpTC2EJhgevDSx7JZNKbE4drfk/Uu/55GVAks2MeGkJVgDleepGEA2V85pAyAs99u0 04cGLaKlgy3bbHv+mRjwREOGQnS4Y4BTz0gkSUf46vrNj44eJU2KNDkkZ9XSSxSTN2A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793784820; 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=PUV7VlMf0EvvLzp+y5o1NyE7TTufq1+bMSMSc6a2SOE=; b=4v7jSeFreAYjn9t3gGshLllufwe4Fzm88yubM2RK8DLL3xJfDmpcNy2KmyaA5SkXbtxJ FvDBvsDPAF2k1c1pVxQmYwQ3SDSdo+k8JBggxjTMAAkzAKVWM8LKIC8zgeK+hinzzWkcK s92f1JOoGTR7Wf021ubmeWsyjF2p6NQZ+XOrwhoZh/VWPPZvJ0I1Pye7m37lAc0WoiPeR Cz2FjEzSzDPiDcdybPf/x8czFBhbLHrI5dgc6JFmvq4gsq82O4Gyh9iSHy/iR4+m1p0yZ X/Ld5Gj7qE0mt+oT/yD3UeR8nJPd3TIY2ZLDeEYJkfhsLSA9paVJ/Tm1lG9xJHT17EQ== X-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=j7HCUZ3X; arc=none smtp.remote-ip=91.218.175.93 X-Received: from mta0.migadu.com (out-93.mta0.migadu.com [91.218.175.93]) (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 9C077606A330 for <netdev@vger.kernel.org>; Wed, 4 Nov 2026 09:33:39 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9C077606A330 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=8dK0Lo7DM1WJ0OGxApcuKa8B214rVf6nLR5cxtZwcuc=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793784817; v=1; x=1794389617; b=j7HCUZ3XEX9RzkQzuaBsIvF+yJySl9qKAMKcK6gL1KSgkapo9XW5KlnO2KVE0+3NzQjJx9Vv hM/+NDR6x5uRVN6nTr7lF88oFSom8RZdc+kRCGptJV5SZP8sMymD/Xvhj/41ubIyEKvqSuWXENN gbzx1l+rk+a1H6zAqAw4+6BA= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id 5b91f46f81561111; Wed, 04 Nov 2026 09:33:37 +0000 X-Mizu-Trace-ID: 5b91f46f81561111 X-Migadu-Flow: FLOW_OUT X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Hangbin Liu <liuhangbin@kylinos.cn>, Sashiko <netdev-bot+sashiko@kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261104-ipv6_ioam_lock-v1-1-4f24c41b261b@kylinos.cn>