🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21886

Re: [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change

#21886
From: Minxi Hou
Date: Tue, 24 Nov 2026 15:08
46 lines
12927 bytes
Both answers, per patch.

1/3, the single read of dp->user_features:

Found by manual code inspection of how the datapath features are read:
queue_userspace_packet() decides from OVS_DP_F_UNALIGNED whether to copy
with skb_zerocopy(), and pad_packet() reads the same field again after
the copy.  The second read comes from aea0bb4f8ee5.

Not triggered.  The window needs an OVS_DP_CMD_SET to land between the
head room decision and the padding of the same upcall, which is a race I
could not turn into a deterministic test, so there is no trace to show.
What the code gives is the order of the two reads and the assert itself:
skb_put() asserts the skb is linear, and skb_zerocopy() leaves it
nonlinear when the bit is cleared between them.

2/3, the features recorded on a failed change:

Found the same way, by reading ovs_dp_change() against
ovs_dp_set_upcall_portids(), and then triggered from user space with no
privileges on the host: the datapath lives in a network namespace owned
by a user namespace, which is all CAP_NET_ADMIN there needs.

The recorded-features half has a running symptom.  On 2a324a58a084, the
parent of this series, the selftest added in 3/3 reports:

  # the rejected set changed the features
  TEST: ovsdp: failed set keeps bits                        [FAIL]

ovs-dpctl set-dp with an empty per-cpu-pids asks for the dispatch bit
along with a pids list the kernel rejects with -EINVAL, and the datapath
still reports the features that the failed request asked for.  With this
series the same command leaves the features as they were and the test
passes.

The reference half is not triggered.  A datapath that holds
TC_RECIRC_SHARING without the tc skb extension reference, then cleared,
drops a reference that was never taken, and a disable on a count of zero
warns from static_key_dec_not_one().  I did not build the sequence that
reaches it, so that part rests on the code and not on a trace.

Neither patch comes from syzbot or from a static analysis tool.  The
review that found them was done with an LLM assistant, and the
recorded-features half was then confirmed by running the new selftest
against the unfixed parent.
Technical Details
Message-ID: <20261124150825.1001973-1-houminxi@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370492-linux-kernel-netdev=dewy.ru
References: <179553193708.3294.13977466604609033873@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370492-linux-kernel-netdev=dewy.ru
From: houminxi@gmail.com (Minxi Hou)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change
Date: Tue, 24 Nov 2026 10:08:25 -0500
Organization: Usenet Network
Message-ID: <20261124150825.1001973-1-houminxi@gmail.com>
References: <179553193708.3294.13977466604609033873@kernel.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4165434"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:4FiLdFiIpgW9x8GIFZRCd0QV1vQ= sha256:xvk8JwbSwCO93Qk3j5RkSm8yRrO4HbVlet2/yjUeITo=
	sha1:bRrJa/IRsjRPHzhVK/ldUOTyeyg= sha256:kxj8u08XsrpKWkfp1kubtseHSiy8wDy7cZMTndN8Vbk=
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 5A10B125E1D; Tue, 24 Nov 2026 18:09:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
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 mS-xPMixE_lE;
	Tue, 24 Nov 2026 18:08:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370492-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id BF2C9125E18; Tue, 24 Nov 2026 18:08:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 6D5D936713; Tue, 24 Nov 2026 15:08:43 +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=1795532923;
	b=KxaHMe/pklW7cHD3ZfsnKjtgb6ZuOo8dws5qBOAUOzQK6HfNGtX7/ervHCWaLXbyBP8f
	 CYaK3woRlLqX+/8edCove77wRRp9UrjBFD91xZkyobR61a3f6HLtWyh1xNjDyKOBrfxEN
	 TjFCPwXlO9oXUMiscYVH2edYB5MVLDGBfmlS6NOLsV+IL/t5qK9SQIUtosmBmzBQ55toV
	 u/n1KpqcF8zjjXY30iNsrONIV6az+VFSAwZe7N9/zfc99m2/F7gHEn3yunKVQVhJlEwd0
	 1Bvc7h1gS1778AOwghbIft7KxEu/BfmNltm7MlMplwYZz55bWhfaxJxAIa+tVFlklqg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795532923;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=reEA74XZwlnOotKR58gA6rmFKPKX5xL4fy8QD9BPNy4=;
	b=h3MGHe4Z1XCjUST8ilakgDz9ojRSQtKwKfc6xnAh9s0Ng1d4jVTSpaGQOaxTPmW03FbC
	 y9fdxjX/TkInfDxvqzHmtxCibuZRiPjPLtM7vsOUyeSVHcjFGjkl1SBHZw1gqHADxzO12
	 flNG+ZXcQADHHY65npgu6igLzYJ5yXyOY913rquI+09SoucgW0NquonwaQ3v0eCmdhqYz
	 d9rrrofWqjTMxRm7BkIW2UTO6reXBRIEOXtHAgKPaQwMNSPn8AeCtj+FkpTTBYZKls3ED
	 oWQy4hMokP0jZ7rORBLBwz0s6ujFQ9+s5g0PcQP/vAOaLdZxsyBtQ7fDgELImbh47Sg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YuEQ6pEw;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 26732606A32D;
	Tue, 24 Nov 2026 15:08:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YuEQ6pEw
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795532922;
	b=oV4+69vmxY1ncRd15erPs71VRXW6aGyTeMEl/CXHkrfXibzn0DgVGdCj7JFt5ef7pdu6
	 B0HV//7kfnTXaZj59NxWWvxf6lreSnKegPZO5kzBLf2vElAcSXhG9yPBeO4VktFztcLWM
	 NKkR8pTbNJmKeMCjP+CKvg6nnjnjr7jqdJV4iPVSpK3d2MF0FwTfTUlhpEW7VIBPXdFQE
	 kKYt9KstV738UPmstpCG9I74maFTzLrXsq3frK0X7zht1cIg1OXQZEp3YDTp8GR8w4YpX
	 2Q1yCpXBRXuw7DO02sVYYwUYdY9si5ZpB8+FKlIsPxXvl05uOpDh76BMwPFhXWWCMyg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795532922;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=reEA74XZwlnOotKR58gA6rmFKPKX5xL4fy8QD9BPNy4=;
	b=K8riJP8PmPFIKectwKRRV0bqbKt9YJRoBk+JGUA6+u1s6VFQLbPWOweeNidvwkjAXGPm
	 aGdO6/3AMLQMV1PXol3ix6LeaqAjvyAasYlQfvyoIoJnvHRn4zhA9zJRT2vqsi9o54riA
	 /7pkn7ol/3U6WPRXnGwlL9MSB9a3wQpcilBTYQODUwMsez+oGCwC39iSQd9z2eJaUrgDJ
	 p873zpHiO3SCn6kj+i7EgmEo8wW0XtubbSEAedY9/rvOHj0y/MH01ywkvxeZCxhCLUu2F
	 2hXJ3M4ApW0TKn2bDBOjYrbQ5Zz1WmKz9O6UpROIr+rLGl0/Axi/wu5S4SBlMwVHdkg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=YuEQ6pEw;
	arc=none smtp.remote-ip=74.125.82.170
X-Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170])
	(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 E5B16606A327
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 15:08:41 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E5B16606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-3863db981d4so6375508eec.0
        for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 07:08:41 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795532921; x=1796137721; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=reEA74XZwlnOotKR58gA6rmFKPKX5xL4fy8QD9BPNy4=;
        b=YuEQ6pEwoRuqaFxdKJIp6/MdJx2ZXKUzM0MNo8iEk0Teg17Gh7n4kb1tMUptOFiREA
         9oeeQHwujEMxH0TPai1mD1U7HIVzkbn48d3QDKd4sK1Ef0/TzT3RBnM3tfg2awUSFoM+
         IRB8HBBuIE8PYZVWZdiJ7JrVT6MSXrXhb9r4tnp3ObK+jvEG0Iq1C1tZGhL44MO/av/e
         V+KcxuwDwgsrTkJG/z5TfBhDgOl4FOwQiRD82CeDRFYC4fB60vXyr+SF20kbI23zV/QW
         ds3DnIEq2TC9nzOC4mSDu9K0B9Md0wdoB7ya0s9Y/QRGhhiI7byauyG/+xVks8EkcTOB
         NylA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795532921; x=1796137721;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=reEA74XZwlnOotKR58gA6rmFKPKX5xL4fy8QD9BPNy4=;
        b=d8kZ9zNJPd6eNYxs2QZsHbuKpPbB3BXBwhtlOjO1bOHH2ZJCtojdj9z8FTRbX190X/
         T7xrw96rA41tY8cLK1GFcitNiLtU/LamXaEXUg51iwM2FqaaRv/4NlTQkP3Pa+cfRxcm
         E3w5nOoov/c8xqzWeb3c0Ol7yT9OTs7qcf0lBIEVeSQ5iYgsBPrCou2BE40LTpT5aTn5
         DgRXaAf48zoIdvwnScZbiW4tYqlz45w+WTr+dV8vI8BMG+r0E/YsRViNY93t88swe/qA
         7rLkiobPmLuHHc9AExvoDnPNvOSEk6WTvrarBPPq3njeHM3ekmskezPutQakad2VSpTd
         nYgA==
X-Gm-Message-State: APuU4Z+JQ91ngeNB8+/u/Cgl5MgE85TfwJw4PB4ONzOkP68hMenKN/Hm
	Tj5CcOfJBtjE8BSHKuZI/x+E5X4kzsXhcx1ayc6O3SMKLvOujJFnmJxnVjAVh8no+Xo=
X-Gm-Gg: AZFdTZdEudI/bAG+An5KqMyN9m43Rr/YOMymL3sNNf36vdLRA8zehe/P7ti3+tFOcmW
	cw+B3tTTYRqInqk3+P0n27BZGh1/BjkbJQZQSVjCzfc9r8K2IP+SsokzrOUg1DlinsuS6sVrCRb
	e5bp/s4Dl/Im5uoKYkQnrzITlc5KzBgz+PVUNPG2Fhv3HLd5WlQV9N1D0E1Ilk4k92FiXRYVMyX
	rOC/NM/UE6AKEXITCAa41RRjE31h2OyMyqz6aLZSNuvzw9yTb9uCtH6l4sVXEqpqBA8Fd/HPYq3
	R+q7Vw+kMnA4anBY9G5RBrJhgn0Jr0xpNZkFk9KyjZPYfPLkdBHahF1DO/zZNuS4UYjqPoHRU3D
	FpE9H19w2Asfch7Ul58EBmi+40hgTtq4V8mN9Q3Kiqy6eY5d4PWtlU0Us33fkzV9+Y/4Rs8i+Pt
	zNpWmTZsmbgfrueTxeCFK/webLla/PijnXoSKC0rBy70CtB1+11GS4jIZrBYzOKWYV9C7oq7UDH
	FRbfwIPciVbsVzZ+be0rIrsOuLwHt+aPCiBkUy5eNPU2S2eLCZ1oJDS2ZcQyuVt6NzT8x273F7O
	8sVEeXWSHfs5gmRJmObe2NQSvcVcI51GP5/3FSmU1o5VYTCc3UbFxjEufQrO
X-Received: by 2002:a05:7301:6408:b0:36a:270:ce76 with SMTP id 5a478bee46e88-38570f2b27dmr15845090eec.33.1795532920671;
        Tue, 24 Nov 2026 07:08:40 -0800 (PST)
X-Received: from houminxi ([61.170.225.237])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-386c7c62a91sm3964123eec.17.2026.11.24.07.08.36
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 24 Nov 2026 07:08:40 -0800 (PST)
X-Cc: dev@openvswitch.org,
	aconole@redhat.com,
	echaudro@redhat.com,
	i.maximets@ovn.org,
	davem@davemloft.net,
	edumazet@google.com,
	kuba@kernel.org,
	pabeni@redhat.com,
	horms@kernel.org,
	matttbe@kernel.org,
	shuah@kernel.org,
	netdev-bot+sinfo@kernel.org
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <179553193708.3294.13977466604609033873@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