Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Seungwon Bae <qotmddnjs@ajou.ac.kr>
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org,
	shuah@kernel.org, horms@kernel.org, netdev@vger.kernel.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3] vxlan: reject dynamic fdb entries that reference a nexthop id
Date: Wed, 2 Sep 2026 22:04:06 +0300	[thread overview]
Message-ID: <20260902190406.GA4127474@shredder> (raw)
In-Reply-To: <20260902155956.296699-1-qotmddnjs@ajou.ac.kr>

On Thu, Sep 03, 2026 at 12:59:56AM +0900, Seungwon Bae wrote:
> The commit cited in the Fixes tag allowed VXLAN FDB entries to point to
> FDB nexthops so that overlay traffic could be load balanced across
> multiple VTEPs. Such entries can only be configured from user space,
> cannot be learned and cannot roam. They only make sense with a user space
> control plane such as E-VPN where data plane learning is disabled.
> 
> Despite that, the VXLAN driver does not currently prevent such entries
> from being configured with the "dynamic" flag. The per-nexthop FDB list
> is only protected by the per-device hash lock, which is not sufficient
> when two VXLAN devices point to the same FDB nexthop and therefore share
> the list. Aging runs in softirq context without RTNL, so an entry deleted
> by one device can race with an addition or deletion from the other,
> leading to list corruption:
> 
>   list_del corruption. next->prev should be ffff8881069d9548, but was
>   dead000000000122. (next=ffff8881069d9448)
>   WARNING: CPU: 0 PID: 90 at lib/list_debug.c:65
>   __list_del_entry_valid_or_report+0x1aa/0x210
>   ...
>    vxlan_fdb_destroy+0x5b8/0xad0
>    vxlan_cleanup+0x328/0x450
>    call_timer_fn+0x2a/0x1c0
>    run_timer_softirq+0x18c/0x210
>   BUG: KASAN: slab-use-after-free in vxlan_fdb_destroy
> 
> Fix this by rejecting the bogus configuration of dynamic FDB entries that
> point to FDB nexthops, both when created and when an existing entry is
> updated. As such, the per-nexthop FDB list is only ever mutated under the
> RTNL lock. Add test cases to make sure that this does not regress in the
> future.
> 
> Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries")
> Suggested-by: Ido Schimmel <idosch@nvidia.com>
> Signed-off-by: Seungwon Bae <qotmddnjs@ajou.ac.kr>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

      reply	other threads:[~2026-09-02 19:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 15:59 [PATCH net v3] vxlan: reject dynamic fdb entries that reference a nexthop id Seungwon Bae
2026-09-02 19:04 ` Ido Schimmel [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=20260902190406.GA4127474@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qotmddnjs@ajou.ac.kr \
    --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