CVE-2025-40254 json
net: openvswitch: remove never-working support for setting nsh fields
published 2025-12-04 11 mo ago modified 2026-10-19 20 d ago also EUVD-2025-201203
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.3%
- EPSS 0.3% chance of exploitation in 30 days, percentile 17%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
net: openvswitch: remove never-working support for setting nsh fields
The validation of the set(nsh(...)) action is completely wrong. It runs through the nsh_key_put_from_nlattr() function that is the same function that validates NSH keys for the flow match and the push_nsh() action. However, the set(nsh(...)) has a very different memory layout. Nested attributes in there are doubled in size in case of the masked set(). That makes proper validation impossible.
There is also confusion in the code between the 'masked' flag, that says that the nested attributes are doubled in size containing both the value and the mask, and the 'is_mask' that says that the value we're parsing is the mask. This is causing kernel crash on trying to write into mask part of the match with SW_FLOW_KEY_PUT() during validation, while validate_nsh() doesn't allocate any memory for it:
BUG: kernel NULL pointer dereference, address: 0000000000000018 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 1c2383067 P4D 1c2383067 PUD 20b703067 PMD 0 Oops: Oops: 0000 [#1] SMP NOPTI CPU: 8 UID: 0 Kdump: loaded Not tainted 6.17.0-rc4+ #107 PREEMPT(voluntary) RIP: 0010:nsh_key_put_from_nlattr+0x19d/0x610 [openvswitch] Call Trace: <TASK> validate_nsh+0x60/0x90 [openvswitch] validate_set.constprop.0+0x270/0x3c0 [openvswitch] __ovs_nla_copy_actions+0x477/0x860 [openvswitch] ovs_nla_copy_actions+0x8d/0x100 [openvswitch] ovs_packet_cmd_execute+0x1cc/0x310 [openvswitch] genl_family_rcv_msg_doit+0xdb/0x130 genl_family_rcv_msg+0x14b/0x220 genl_rcv_msg+0x47/0xa0 netlink_rcv_skb+0x53/0x100 genl_rcv+0x24/0x40 netlink_unicast+0x280/0x3b0 netlink_sendmsg+0x1f7/0x430 ____sys_sendmsg+0x36b/0x3a0 ___sys_sendmsg+0x87/0xd0 __sys_sendmsg+0x6d/0xd0 do_syscall_64+0x7b/0x2c0 entry_SYSCALL_64_after_hwframe+0x76/0x7e
The third issue with this process is that while trying to convert the non-masked set into masked one, validate_set() copies and doubles the size of the OVS_KEY_ATTR_NSH as if it didn't have any nested attributes. It should be copying each nested attribute and doubling them in size independently. And the process must be properly reversed during the conversion back from masked to a non-masked variant during the flow dump.
In the end, the only two outcomes of trying to use this action are either validation failure or a kernel crash. And if somehow someone manages to install a flow with such an action, it will most definitely not do what it is supposed to, since all the keys and the masks are mixed up.
Fixing all the issues is a complex task as it requires re-writing most of the validation code.
Given that and the fact that this functionality never worked since introduction, let's just remove it altogether. It's better to re-introduce it later with a proper implementation instead of trying to fix it in stable releases.
Patch / fix
- Linux Linux 5.4.302, 5.10.247, 5.15.197, 6.1.159, 6.6.118, 6.12.60, 6.17.10, 6.18
- Siemens RUGGEDCOM RST2428P V4.0
- linux Debian 12 6.1.159-1
- linux Debian 13 6.12.63-1
- linux Debian 14 6.17.10-1
debian advisories DEBIAN-CVE-2025-40254
- linux Ubuntu 22.04 LTS 5.15.0-173.183
- linux Ubuntu 24.04 LTS 6.8.0-106.106
- linux Ubuntu 25.10 6.17.0-19.19
- linux-aws Ubuntu 22.04 LTS 5.15.0-1103.110
- linux-aws Ubuntu 24.04 LTS 6.8.0-1050.53
- linux-aws Ubuntu 25.10 6.17.0-1009.9
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1103.112
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1052.55
ubuntu advisories UBUNTU-CVE-2025-40254
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-40.1
- kernel-source-rt Linux Micro 6.1, Linux Micro 6.0 6.4.0-40.1
- kernel-source Linux Micro 6.1, Linux Micro 6.0 6.4.0-39.1
- kernel-default Linux Micro 6.1, Linux Micro 6.0 6.4.0-39.1
- kernel-kvmsmall Linux Micro 6.1, Linux Micro 6.0 6.4.0-39.1
- kernel-default-base Linux Micro 6.1, Linux Micro 6.0 6.4.0-39.1.21.16
- kernel-rt Real Time Module 15 SP7 6.4.0-150700.7.31.2
- kernel-syms-rt Real Time Module 15 SP7 6.4.0-150700.7.31.1
suse advisories SUSE-SU-2026:20845-1SUSE-SU-2026:20876-1SUSE-SU-2026:20477-1SUSE-SU-2026:20498-1SUSE-SU-2026:0587-1SUSE-SU-2026:0472-1
- kernel-rt openSUSE Leap 16.0 6.12.0-160000.9.1
- dtb-aarch64 openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-64kb openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-syms openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-azure openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-obs-qa openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-source openSUSE Leap 16.0 6.12.0-160000.9.1
- kernel-default openSUSE Leap 16.0 6.12.0-160000.9.1
opensuse advisories openSUSE-SU-2026:20145-1
- git.kernel.org/stable/c/3415faa1fcb4150f29a72c5ecf959339d797feb7 commit
- git.kernel.org/stable/c/3d2e7d3b28469081ccf08301df07cc411a1cc5e9 commit
- git.kernel.org/stable/c/f95bef5ba0b88d971b02c776f24bd17544930a3a commit
- git.kernel.org/stable/c/87d2429381ddcf8cbd30c8c36793a4f7916d5f99 commit
- git.kernel.org/stable/c/0b903f33c31c82b1c3591279fd8a23893802b987 commit
- git.kernel.org/stable/c/9c61d8fe1350b7322f4953318165d6719c3b1475 commit
- git.kernel.org/stable/c/4689ba45296dbb3a47e70a1bc2ed0328263e48f3 commit
- git.kernel.org/stable/c/dfe28c4167a9259fc0c372d9f9473e1ac95cff67 commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-40254 updated cvss 4.7
kernel: net: openvswitch: remove never-working support for setting nsh fields
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 moreaffected: workaround, no fix planned “To mitigate this issue, prevent the openvswitch module from being loaded. See https://access.redhat.com/solutions/41278 for instructions on how to blacklist a kernel module.”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelaffected: workaround, no fix available “To mitigate this issue, prevent the openvswitch module from being loaded. See https://access.redhat.com/solutions/41278 for instructions on how to blacklist a kernel module.”
-
Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
cisa ICSA-26-188-05 updated cvss 7.0
Siemens SINEC OS
-
Siemens RUGGEDCOM RST2428P (6GK6242-6PA00) < 4.0affected: fixed in V4.0 support.industry.siemens.com
Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 4 mo ago
Exploit prediction
0.26% chance of exploitation in the next 30 days, higher than 17% of all scored CVEs (FIRST EPSS, 2026-11-08).
Affected products
- Linux Linux
- Siemens RUGGEDCOM RST2428P
Classification
- Technology feeds
References
- git.kernel.org /stable/c/3415faa1fcb4150f29a72c5ecf959339d797feb7
- git.kernel.org /stable/c/3d2e7d3b28469081ccf08301df07cc411a1cc5e9
- git.kernel.org /stable/c/f95bef5ba0b88d971b02c776f24bd17544930a3a
- git.kernel.org /stable/c/87d2429381ddcf8cbd30c8c36793a4f7916d5f99
- git.kernel.org /stable/c/0b903f33c31c82b1c3591279fd8a23893802b987
- git.kernel.org /stable/c/9c61d8fe1350b7322f4953318165d6719c3b1475
- git.kernel.org /stable/c/4689ba45296dbb3a47e70a1bc2ed0328263e48f3
- git.kernel.org /stable/c/dfe28c4167a9259fc0c372d9f9473e1ac95cff67
- cert-portal.siemens.com /productcert/html/ssa-253495.html
Sources
- CVE List CVE-2025-40254
- NVD CVE-2025-40254
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.