# CVE-2023-54216: net/mlx5e: TC, Fix using eswitch mapping in nic mode

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.20% (percentile 6, 2026-11-28)
- **Published:** 2025-12-30T12:11:12.730Z
- **Modified:** 2026-10-28T19:10:00.193Z

## Who should check

- Anyone running Linux \>= 6702782845a5bf381a19b204c369e63420041665, \< 4150441c010dec36abc389828e2e4758bd8ad4b3; \>= 6702782845a5bf381a19b204c369e63420041665, \< dfa1e46d6093831b9d49f0f350227a1d13644a2f
- Anyone running Linux 6.3

## Description

In the Linux kernel, the following vulnerability has been resolved:

net/mlx5e: TC, Fix using eswitch mapping in nic mode

Cited patch is using the eswitch object mapping pool while
in nic mode where it isn't initialized. This results in the
trace below \[0\].

Fix that by using either nic or eswitch object mapping pool
depending if eswitch is enabled or not.

\[0\]:
\[  826.446057\] ==================================================================
\[  826.446729\] BUG: KASAN: slab-use-after-free in mlx5\_add\_flow\_rules+0x30/0x490 \[mlx5\_core\]
\[  826.447515\] Read of size 8 at addr ffff888194485830 by task tc/6233

\[  826.448243\] CPU: 16 PID: 6233 Comm: tc Tainted: G        W          6.3.0-rc6+ \#1
\[  826.448890\] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
\[  826.449785\] Call Trace:
\[  826.450052\]  \<TASK\>
\[  826.450302\]  dump\_stack\_lvl+0x33/0x50
\[  826.450650\]  print\_report+0xc2/0x610
\[  826.450998\]  ? \_\_virt\_addr\_valid+0xb1/0x130
\[  826.451385\]  ? mlx5\_add\_flow\_rules+0x30/0x490 \[mlx5\_core\]
\[  826.451935\]  kasan\_report+0xae/0xe0
\[  826.452276\]  ? mlx5\_add\_flow\_rules+0x30/0x490 \[mlx5\_core\]
\[  826.452829\]  mlx5\_add\_flow\_rules+0x30/0x490 \[mlx5\_core\]
\[  826.453368\]  ? \_\_kmalloc\_node+0x5a/0x120
\[  826.453733\]  esw\_add\_restore\_rule+0x20f/0x270 \[mlx5\_core\]
\[  826.454288\]  ? mlx5\_eswitch\_add\_send\_to\_vport\_meta\_rule+0x260/0x260 \[mlx5\_core\]
\[  826.455011\]  ? mutex\_unlock+0x80/0xd0
\[  826.455361\]  ? \_\_mutex\_unlock\_slowpath.constprop.0+0x210/0x210
\[  826.455862\]  ? mapping\_add+0x2cb/0x440 \[mlx5\_core\]
\[  826.456425\]  mlx5e\_tc\_action\_miss\_mapping\_get+0x139/0x180 \[mlx5\_core\]
\[  826.457058\]  ? mlx5e\_tc\_update\_skb\_nic+0xb0/0xb0 \[mlx5\_core\]
\[  826.457636\]  ? \_\_kasan\_kmalloc+0x77/0x90
\[  826.458000\]  ? \_\_kmalloc+0x57/0x120
\[  826.458336\]  mlx5\_tc\_ct\_flow\_offload+0x325/0xe40 \[mlx5\_core\]
\[  826.458916\]  ? ct\_kernel\_enter.constprop.0+0x48/0xa0
\[  826.459360\]  ? mlx5\_tc\_ct\_parse\_action+0xf0/0xf0 \[mlx5\_core\]
\[  826.459933\]  ? mlx5e\_mod\_hdr\_attach+0x491/0x520 \[mlx5\_core\]
\[  826.460507\]  ? mlx5e\_mod\_hdr\_get+0x12/0x20 \[mlx5\_core\]
\[  826.461046\]  ? mlx5e\_tc\_attach\_mod\_hdr+0x154/0x170 \[mlx5\_core\]
\[  826.461635\]  mlx5e\_configure\_flower+0x969/0x2110 \[mlx5\_core\]
\[  826.462217\]  ? \_raw\_spin\_lock\_bh+0x85/0xe0
\[  826.462597\]  ? \_\_mlx5e\_add\_fdb\_flow+0x750/0x750 \[mlx5\_core\]
\[  826.463163\]  ? kasan\_save\_stack+0x2e/0x40
\[  826.463534\]  ? down\_read+0x115/0x1b0
\[  826.463878\]  ? down\_write\_killable+0x110/0x110
\[  826.464288\]  ? tc\_setup\_action.part.0+0x9f/0x3b0
\[  826.464701\]  ? mlx5e\_is\_uplink\_rep+0x4c/0x90 \[mlx5\_core\]
\[  826.465253\]  ? mlx5e\_tc\_reoffload\_flows\_work+0x130/0x130 \[mlx5\_core\]
\[  826.465878\]  tc\_setup\_cb\_add+0x112/0x250
\[  826.466247\]  fl\_hw\_replace\_filter+0x230/0x310 \[cls\_flower\]
\[  826.466724\]  ? fl\_hw\_destroy\_filter+0x1a0/0x1a0 \[cls\_flower\]
\[  826.467212\]  fl\_change+0x14e1/0x2030 \[cls\_flower\]
\[  826.467636\]  ? sock\_def\_readable+0x89/0x120
\[  826.468019\]  ? fl\_tmplt\_create+0x2d0/0x2d0 \[cls\_flower\]
\[  826.468509\]  ? kasan\_unpoison+0x23/0x50
\[  826.468873\]  ? get\_random\_u16+0x180/0x180
\[  826.469244\]  ? \_\_radix\_tree\_lookup+0x2b/0x130
\[  826.469640\]  ? fl\_get+0x7b/0x140 \[cls\_flower\]
\[  826.470042\]  ? fl\_mask\_put+0x200/0x200 \[cls\_flower\]
\[  826.470478\]  ? \_\_mutex\_unlock\_slowpath.constprop.0+0x210/0x210
\[  826.470973\]  ? fl\_tmplt\_create+0x2d0/0x2d0 \[cls\_flower\]
\[  826.471427\]  tc\_new\_tfilter+0x644/0x1050
\[  826.471795\]  ? tc\_get\_tfilter+0x860/0x860
\[  826.472170\]  ? \_\_thaw\_task+0x130/0x130
\[  826.472525\]  ? arch\_stack\_walk+0x98/0xf0
\[  826.472892\]  ? cap\_capable+0x9f/0xd0
\[  826.473235\]  ? security\_capable+0x47/0x60
\[  826.473608\]  rtnetlink\_rcv\_msg+0x1d5/0x550
\[  826.473985\]  ? rtnl\_calcit.isra.0+0x1f0/0x1f0
\[  826.474383\]  ? \_\_stack\_depot\_save+0x35/0x4c0
\[  826.474779\]  ? kasan\_save\_stack+0x2e/0x40
\[  826.475149\]  ? kasan\_save\_stack+0x1e/0x40
\[  826.475518\]  ? \_\_kasan\_record\_aux\_stack+0x9f/0xb0
\[  826.475939\]  ? task\_work\_add+0x77/0x1c0
\[  826.476305\]  netlink\_rcv\_skb+0xe0/0x210
---truncated---

## Affected and fixed versions

- Linux: \>= 6702782845a5bf381a19b204c369e63420041665, \< 4150441c010dec36abc389828e2e4758bd8ad4b3; \>= 6702782845a5bf381a19b204c369e63420041665, \< dfa1e46d6093831b9d49f0f350227a1d13644a2f (cvelist)
- Linux: 6.3 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-54216. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-54216.md
Affected: Linux >= 6702782845a5bf381a19b204c369e63420041665, < 4150441c010dec36abc389828e2e4758bd8ad4b3; >= 6702782845a5bf381a19b204c369e63420041665, < dfa1e46d6093831b9d49f0f350227a1d13644a2f; Linux 6.3
Fixed in: Linux 4150441c010dec36abc389828e2e4758bd8ad4b3

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-54216 being exploited?

There is no confirmed exploitation: CVE-2023-54216 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2023-54216?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-54216?

Linux \>= 6702782845a5bf381a19b204c369e63420041665, \< 4150441c010dec36abc389828e2e4758bd8ad4b3; \>= 6702782845a5bf381a19b204c369e63420041665, \< dfa1e46d6093831b9d49f0f350227a1d13644a2f; Linux 6.3.

### Is there a fix for CVE-2023-54216?

Yes. Fixed in Linux 4150441c010dec36abc389828e2e4758bd8ad4b3. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-54216?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/4150441c010dec36abc389828e2e4758bd8ad4b3>
- other: <https://git.kernel.org/stable/c/dfa1e46d6093831b9d49f0f350227a1d13644a2f>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-54216>

HTML: <https://flawdb.com/CVE-2023-54216> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-54216>
