From: Minxi Hou <houminxi@gmail.com>
To: netdev@vger.kernel.org
Cc: Aaron Conole <aconole@redhat.com>,
Eelco Chaudron <echaudro@redhat.com>,
Ilya Maximets <i.maximets@ovn.org>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Paul Blakey <paulb@nvidia.com>,
dev@openvswitch.org, linux-kselftest@vger.kernel.org
Subject: [PATCH net v2 0/2] net: openvswitch: fix a feature leak on a failed change
Date: Sun, 8 Nov 2026 07:34:22 -0500 [thread overview]
Message-ID: <20261108123424.2825403-1-houminxi@gmail.com> (raw)
Changes in v2:
- Patch 1 limits its closing claim to OVS_DP_CMD_SET, and says that a
failed OVS_DP_CMD_NEW and the reset that follows it still leave the
key one enable ahead.
- Patch 1 names the reachability and the effect: only CAP_NET_ADMIN is
needed, datapath_policy does not validate the per-cpu-pids attribute,
and a disable on a count of zero warns in static_key_dec_not_one().
- Patch 2 treats only EOPNOTSUPP as the missing key and skips with the
kselftest skip code; any other failure fails the test.
- Patch 2 selects CONFIG_NET_CLS_ACT and CONFIG_NET_TC_SKB_EXT in the
selftest config fragment, so the recirc round runs in CI.
- Patch 2 sends the features the datapath reports when --features is
left out, instead of clearing them.
v1: https://lore.kernel.org/netdev/20261107113403.797779-1-houminxi@gmail.com/
ovs_dp_change() records the requested user features before it calls the
update that can fail, so a request rejected for an empty per-cpu-pids
leaves the datapath claiming a feature it never enabled. The tc skb
extension key is a reference count shared with cls_flower, and the code
that would keep it in step is skipped on that path.
Patch 1 fixes the ordering. Patch 2 adds a set-dp command to the
openvswitch selftest tool, and a test that sends such a request and
checks the features the datapath reports afterwards. It fails without
the fix and passes with it.
The problem turned up while the YNL spec for this family was being
written: describing the ovs_datapath set command meant reading
ovs_dp_change(), where the ordering stands out.
Signed-off-by: Minxi Hou <houminxi@gmail.com>
Minxi Hou (2):
Minxi Hou (2):
net: openvswitch: do not record user features when the change fails
selftests/net/openvswitch: check that a failed set keeps the features
net/openvswitch/datapath.c | 10 +--
.../testing/selftests/net/openvswitch/config | 2 +
.../selftests/net/openvswitch/openvswitch.sh | 67 +++++++++++++++++++
.../selftests/net/openvswitch/ovs-dpctl.py | 53 +++++++++++++++
4 files changed, 127 insertions(+), 5 deletions(-)
base-commit: 30c71476d842b094651bd7712f6c8ee8716147d0
--
2.56.0
next reply other threads:[~2026-11-08 12:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 12:34 Minxi Hou [this message]
2026-11-08 12:34 ` [PATCH net v2 1/2] net: openvswitch: do not record user features when the change fails Minxi Hou
2026-11-09 13:22 ` netdev-bot+sashiko
2026-11-10 17:51 ` Minxi Hou
2026-11-08 12:34 ` [PATCH net v2 2/2] selftests/net/openvswitch: check that a failed set keeps the features Minxi Hou
2026-11-09 13:23 ` netdev-bot+sashiko
2026-11-10 17:51 ` Minxi Hou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261108123424.2825403-1-houminxi@gmail.com \
--to=houminxi@gmail.com \
--cc=aconole@redhat.com \
--cc=davem@davemloft.net \
--cc=dev@openvswitch.org \
--cc=echaudro@redhat.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=jhs@mojatatu.com \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paulb@nvidia.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox