From: Minxi Hou <houminxi@gmail.com>
To: netdev@vger.kernel.org
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
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 [thread overview]
Message-ID: <20261124150825.1001973-1-houminxi@gmail.com> (raw)
In-Reply-To: <179553193708.3294.13977466604609033873@kernel.org>
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.
prev parent reply other threads:[~2026-11-24 15:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 14:50 [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change Minxi Hou
2026-11-24 14:50 ` [PATCH net v6 1/3] net: openvswitch: read the datapath features once when sending an upcall Minxi Hou
2026-11-24 14:50 ` [PATCH net v6 2/3] net: openvswitch: do not record user features when the change fails Minxi Hou
2026-11-24 14:50 ` [PATCH net v6 3/3] selftests/net/openvswitch: check that a failed set keeps the features Minxi Hou
2026-11-24 14:52 ` [PATCH net v6 0/3] net: openvswitch: fix a feature leak on a failed change netdev-bot+sinfo
2026-11-24 15:08 ` Minxi Hou [this message]
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=20261124150825.1001973-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@google.com \
--cc=horms@kernel.org \
--cc=i.maximets@ovn.org \
--cc=kuba@kernel.org \
--cc=matttbe@kernel.org \
--cc=netdev-bot+sinfo@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