Netdev List
 help / color / mirror / Atom feed
From: Ilya Maximets <i.maximets@ovn.org>
To: Ilya Maximets <i.maximets@ovn.org>, Yuqi Xu <xuyuqiabc@gmail.com>,
	Aaron Conole <aconole@redhat.com>,
	Eelco Chaudron <echaudro@redhat.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Yi-Hung Wei <yihung.wei@gmail.com>,
	netdev@vger.kernel.org, dev@openvswitch.org,
	linux-kernel@vger.kernel.org, Vega <vega@nebusec.ai>,
	Nan Li <tonanli66@gmail.com>, Ren Wei <enjou1224z@gmail.com>
Subject: Re: [PATCH net v5 1/1] openvswitch: Fix CT limit teardown use-after-free
Date: Tue, 11 Aug 2026 22:46:02 +0200	[thread overview]
Message-ID: <d91a2ae3-2aac-4fab-b041-d3004ffad39b@ovn.org> (raw)
In-Reply-To: <d7471dde-43f6-4c31-a380-8a3f91b26d59@ovn.org>

On 8/11/26 4:02 PM, Ilya Maximets wrote:
> On 8/11/26 11:55 AM, Yuqi Xu wrote:
>> Packet processing uses CT limit state under RCU, while netns teardown
>> frees that state under ovs_mutex. The CT limit pointer was neither removed
>> from readers nor protected by a grace period, allowing packet processing to
>> dereference the freed state.
>>
>> An unprivileged user can trigger this bug from a user and network
>> namespace, causing a slab-use-after-free in ovs_ct_execute() when the
>> netns is torn down.
>>
>> Publish the CT limit pointer through RCU, remove it before teardown, and
>> wait for readers before freeing its contents. Keep ovs_mutex around
>> individual CT limit updates, and use the RCU read-side lock while GET
>> traverses the RCU-protected limit lists.
>>
>> Fixes: 11efd5cb04a1 ("openvswitch: Support conntrack zone limit")
>> Cc: stable@vger.kernel.org
>> Reported-by: Vega <vega@nebusec.ai>
>> Link: https://lore.kernel.org/all/cover.1784711445.git.xuyuqiabc@gmail.com
>> Assisted-by: Codex:GPT-5.4
>> Co-developed-by: Nan Li <tonanli66@gmail.com>
>> Signed-off-by: Nan Li <tonanli66@gmail.com>
>> Signed-off-by: Yuqi Xu <xuyuqiabc@gmail.com>
>> Reviewed-by: Ren Wei <enjou1224z@gmail.com>
>> ---
>> Changes in v5:
>>
>> - Remove unreachable command-path NULL handling because netlink sockets
>>   keep their network namespaces alive while requests are processed.
> 
> Please, add a note to the commit message on why the NULL checks are not
> necessary for the code invoked from netlink handlers.  Otherwise, LGTM.

May be also worth explicitly calling out the synchronization while holding
the mutex.  It can be avoided, but should likely be a separate change.

> 
> Best regards, Ilya Maximets.


      reply	other threads:[~2026-08-11 20:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  9:55 [PATCH net v5 0/1] openvswitch: Fix CT limit teardown use-after-free Yuqi Xu
2026-08-11  9:55 ` [PATCH net v5 1/1] " Yuqi Xu
2026-08-11 14:02   ` Ilya Maximets
2026-08-11 20:46     ` Ilya Maximets [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=d91a2ae3-2aac-4fab-b041-d3004ffad39b@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=enjou1224z@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tonanli66@gmail.com \
    --cc=vega@nebusec.ai \
    --cc=xuyuqiabc@gmail.com \
    --cc=yihung.wei@gmail.com \
    /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