From: Ilya Maximets <i.maximets@ovn.org>
To: Zhiling Zou <zhilinz@nebusec.ai>,
netdev@vger.kernel.org, dev@openvswitch.org
Cc: aconole@redhat.com, echaudro@redhat.com, i.maximets@ovn.org,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
horms@kernel.org, vega@nebusec.ai
Subject: Re: [PATCH net 1/1] openvswitch: avoid reallocating confirmed conntrack labels
Date: Mon, 14 Sep 2026 23:44:49 +0200 [thread overview]
Message-ID: <2afb49a0-3eb9-4ec9-ae6c-05491ed55949@ovn.org> (raw)
In-Reply-To: <372fbb062b40ae6723684f55484be86ff0064f8e.1789218015.git.zhilinz@nebusec.ai>
On 9/12/26 3:22 PM, Zhiling Zou wrote:
> ovs_ct_get_conn_labels() adds the labels extension when a conntrack
> entry does not have one. Confirmed conntracks can be read locklessly,
> so adding an extension may reallocate and free the extension block
> while another CPU accesses it.
>
> Only add the extension for unconfirmed conntracks. A confirmed
> conntrack without labels now fails the caller's label operation instead
> of reallocating its extension storage.
>
> Fixes: c2ac66735870 ("openvswitch: Allow matching on conntrack label")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: LLM
> Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
> ---
> net/openvswitch/conntrack.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
> index 27115967e5d93..0f433688e17b9 100644
> --- a/net/openvswitch/conntrack.c
> +++ b/net/openvswitch/conntrack.c
> @@ -366,7 +366,7 @@ static struct nf_conn_labels *ovs_ct_get_conn_labels(struct nf_conn *ct)
> struct nf_conn_labels *cl;
>
> cl = nf_ct_labels_find(ct);
> - if (!cl) {
> + if (!cl && !nf_ct_is_confirmed(ct)) {
> nf_ct_labels_ext_add(ct);
> cl = nf_ct_labels_find(ct);
> }
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
next prev parent reply other threads:[~2026-09-14 21:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 13:22 [PATCH net 0/1] openvswitch: avoid reallocating confirmed conntrack labels Zhiling Zou
2026-09-12 13:22 ` [PATCH net 1/1] " Zhiling Zou
2026-09-14 21:44 ` Ilya Maximets [this message]
2026-09-15 12:05 ` Aaron Conole
2026-09-16 1:10 ` [PATCH net 0/1] " patchwork-bot+netdevbpf
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=2afb49a0-3eb9-4ec9-ae6c-05491ed55949@ovn.org \
--to=i.maximets@ovn.org \
--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=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vega@nebusec.ai \
--cc=zhilinz@nebusec.ai \
/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