Netdev List
 help / color / mirror / Atom feed
* [PATCH net v4 0/2] net: openvswitch: fix a feature leak on a failed change
@ 2026-11-15 16:31 Minxi Hou
  2026-11-15 16:31 ` [PATCH net v4 1/2] net: openvswitch: do not record user features when the change fails Minxi Hou
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Minxi Hou @ 2026-11-15 16:31 UTC (permalink / raw)
  To: netdev
  Cc: Aaron Conole, Eelco Chaudron, Ilya Maximets, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan,
	linux-kselftest, Minxi Hou

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-15 20:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 16:31 [PATCH net v4 0/2] net: openvswitch: fix a feature leak on a failed change Minxi Hou
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox