Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 277D6313548 for ; Fri, 19 Sep 2025 15:28:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758295712; cv=none; b=S6abzawxuDjl+wgTjcjuVgaLzffXkdXBbRgFBOTXcyb1EnmjzJ9MGDvKRvpDuq8A0NQkZOy20359xb6nJbAw+e6YbPxQSLyb6uB75VlDUcs8H1zjDCf8561wNz8Z+DEMUldC1WVNaBCD7LnVpKbtIPaldOe+Oh7/D9X8xR1eUPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758295712; c=relaxed/simple; bh=0cfE0JsRWdG4L4BdHuxwW3PquTFhZl4nzfiwrp9Y/e4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AiuSPhv/Mdd2H4ePfXdjeMZVDFj5VevM23yaFZOajuuPli0qUdjyuWQg3moGSWIdnOO3g1+ENLw8F9mzCMzdZgq24F8QgHpr4LMSdlOOv0sCtiC8+Ghq8bBjh3Gh0jucQqd4Eqd0wGwbiOQtTNVHHtX1cl5WGP8rTv8KuQm7QuY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QpbWBhIL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="QpbWBhIL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B2B4C4CEF0; Fri, 19 Sep 2025 15:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758295711; bh=0cfE0JsRWdG4L4BdHuxwW3PquTFhZl4nzfiwrp9Y/e4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QpbWBhILg/8nCeYWDXlAgwJ+3W83vKOo9UocSXzdqMeekB3mt+Tp2V2wC+Nu7bRRC Bldhj9otLHwIzBR4PCkxpqVNNv7L2NhTRg5UOakHv9s49V9BaacdHC30r5R+NIu4+H Hi71nMpdK9tZpPMhtQZVtIg9A0D5GEonIIOQGsHc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39851: vxlan: Fix NPD when refreshing an FDB entry with a nexthop object Date: Fri, 19 Sep 2025 17:28:15 +0200 Message-ID: <2025091904-CVE-2025-39851-8a50@gregkh> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3912; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0gP1Frqg3Ttdi/sSQMeItvugrywz49EUy/+LSFlw0iE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlny1oYzdNv1qTsbqhOFpfh3yry/ucTDe0zLTJLd05r1 HJdt0a7I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACYy+x/Dgr3LBJf+LmqR9d6x b6/U6TS9gyaTLRhmMUfFOpxyWsWQmGRde1P64rXQhYknAQ== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: vxlan: Fix NPD when refreshing an FDB entry with a nexthop object VXLAN FDB entries can point to either a remote destination or an FDB nexthop group. The latter is usually used in EVPN deployments where learning is disabled. However, when learning is enabled, an incoming packet might try to refresh an FDB entry that points to an FDB nexthop group and therefore does not have a remote. Such packets should be dropped, but they are only dropped after dereferencing the non-existent remote, resulting in a NPD [1] which can be reproduced using [2]. Fix by dropping such packets earlier. Remove the misleading comment from first_remote_rcu(). [1] BUG: kernel NULL pointer dereference, address: 0000000000000000 [...] CPU: 13 UID: 0 PID: 361 Comm: mausezahn Not tainted 6.17.0-rc1-virtme-g9f6b606b6b37 #1 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-4.fc41 04/01/2014 RIP: 0010:vxlan_snoop+0x98/0x1e0 [...] Call Trace: vxlan_encap_bypass+0x209/0x240 encap_bypass_if_local+0xb1/0x100 vxlan_xmit_one+0x1375/0x17e0 vxlan_xmit+0x6b4/0x15f0 dev_hard_start_xmit+0x5d/0x1c0 __dev_queue_xmit+0x246/0xfd0 packet_sendmsg+0x113a/0x1850 __sock_sendmsg+0x38/0x70 __sys_sendto+0x126/0x180 __x64_sys_sendto+0x24/0x30 do_syscall_64+0xa4/0x260 entry_SYSCALL_64_after_hwframe+0x4b/0x53 [2] #!/bin/bash ip address add 192.0.2.1/32 dev lo ip address add 192.0.2.2/32 dev lo ip nexthop add id 1 via 192.0.2.3 fdb ip nexthop add id 10 group 1 fdb ip link add name vx0 up type vxlan id 10010 local 192.0.2.1 dstport 12345 localbypass ip link add name vx1 up type vxlan id 10020 local 192.0.2.2 dstport 54321 learning bridge fdb add 00:11:22:33:44:55 dev vx0 self static dst 192.0.2.2 port 54321 vni 10020 bridge fdb add 00:aa:bb:cc:dd:ee dev vx1 self static nhid 10 mausezahn vx0 -a 00:aa:bb:cc:dd:ee -b 00:11:22:33:44:55 -c 1 -q The Linux kernel CVE team has assigned CVE-2025-39851 to this issue. Affected and fixed versions =========================== Issue introduced in 5.8 with commit 1274e1cc42264d4e629841e4f182795cb0becfd2 and fixed in 6.12.46 with commit 4ff4f3104da6507e0f118c63c4560dfdeb59dce3 Issue introduced in 5.8 with commit 1274e1cc42264d4e629841e4f182795cb0becfd2 and fixed in 6.16.6 with commit 0e8630f24c14d9c655d19eabe2e52a9e9f713307 Issue introduced in 5.8 with commit 1274e1cc42264d4e629841e4f182795cb0becfd2 and fixed in 6.17-rc5 with commit 6ead38147ebb813f08be6ea8ef547a0e4c09559a Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-39851 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/net/vxlan/vxlan_core.c drivers/net/vxlan/vxlan_private.h Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/4ff4f3104da6507e0f118c63c4560dfdeb59dce3 https://git.kernel.org/stable/c/0e8630f24c14d9c655d19eabe2e52a9e9f713307 https://git.kernel.org/stable/c/6ead38147ebb813f08be6ea8ef547a0e4c09559a