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>,
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>,
linux-kselftest@vger.kernel.org, Minxi Hou <houminxi@gmail.com>
Subject: [PATCH net v4 0/2] net: openvswitch: fix a feature leak on a failed change
Date: Sun, 15 Nov 2026 11:31:32 -0500 [thread overview]
Message-ID: <20261115163134.3202677-1-houminxi@gmail.com> (raw)
The datapath records the user features before it applies the change, so
a request that fails leaves it claiming a bit whose reference count was
never taken. The first patch records the features last. The second adds a
selftest that drives the failing request and reads back what the datapath
reports.
v4:
- Rebased onto current main.
- The skip message is one printf again. Splitting it made shellcheck
report SC2182 and dropped a word and the newline from the output.
- The new tests say why they failed on stdout. info() writes debug.log
and a failing run deletes that file, so CI showed a FAIL with no reason.
- A datapath that cannot be read is reported as that instead of as a
feature mismatch.
- The outdated add-dp request is checked instead of discarded.
- The errno numbers come from python rather than from a literal, and a
lookup that cannot answer says so rather than comparing against an
empty string.
v3: https://lore.kernel.org/netdev/20261110174651.972936-1-houminxi@gmail.com/
- Cover the recirc bit as well as the dispatch bit.
v2: https://lore.kernel.org/netdev/20261108123424.2825403-1-houminxi@gmail.com/
- Name the two paths that leaked a reference and fix both.
v1: https://lore.kernel.org/netdev/20261107113403.797779-1-houminxi@gmail.com/
Neither leak has a test of its own. The reference count behind the bit is
not visible from user space, so the tests read back the features a
datapath reports: the reset drops them to zero where a test can see it,
and a datapath freed after a failed creation leaves no state to check.
One thing this series leaves alone: ovs_add_dp() returns the status of the
last command in its body rather than of the add, so the `|| return 1` that
follows its calls cannot fail. That predates this series and every OVS
test shares it. The two tests here do not depend on it.
Signed-off-by: Minxi Hou <houminxi@gmail.com>
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 | 34 ++--
net/openvswitch/datapath.h | 5 +-
.../testing/selftests/net/openvswitch/config | 3 +
.../selftests/net/openvswitch/openvswitch.sh | 173 ++++++++++++++++++
.../selftests/net/openvswitch/ovs-dpctl.py | 61 ++++++
5 files changed, 262 insertions(+), 14 deletions(-)
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
--
2.56.1
next reply other threads:[~2026-11-15 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 16:31 Minxi Hou [this message]
2026-11-15 16:31 ` [PATCH net v4 1/2] net: openvswitch: do not record user features when the change fails Minxi Hou
2026-11-15 16:31 ` [PATCH net v4 2/2] selftests/net/openvswitch: check that a failed set keeps the features Minxi Hou
2026-11-15 20:12 ` [PATCH net v4 0/2] net: openvswitch: fix a feature leak on a failed change netdev-bot+sinfo
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=20261115163134.3202677-1-houminxi@gmail.com \
--to=houminxi@gmail.com \
--cc=aconole@redhat.com \
--cc=echaudro@redhat.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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