# CVE-2022-49812: bridge: switchdev: Fix memory leaks when changing VLAN protocol

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.28% (percentile 14, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-05-01T14:09:36.741Z
- **Modified:** 2026-11-05T20:17:13.530Z

## Who should check

- Anyone running Linux \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 347f1793b573466424c550f2748ed837b6690fe7; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< fc16a2c81a3eb1cbba8775f5bdc67856df903a7c; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< f8926e2d2225eb7b7e11cd3fa266aaad9075b767; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 9d45921ee4cb364910097e7d1b7558559c2f9fd2
- Anyone running Linux 5.0

## Description

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

bridge: switchdev: Fix memory leaks when changing VLAN protocol

The bridge driver can offload VLANs to the underlying hardware either
via switchdev or the 8021q driver. When the former is used, the VLAN is
marked in the bridge driver with the 'BR\_VLFLAG\_ADDED\_BY\_SWITCHDEV'
private flag.

To avoid the memory leaks mentioned in the cited commit, the bridge
driver will try to delete a VLAN via the 8021q driver if the VLAN is not
marked with the previously mentioned flag.

When the VLAN protocol of the bridge changes, switchdev drivers are
notified via the 'SWITCHDEV\_ATTR\_ID\_BRIDGE\_VLAN\_PROTOCOL' attribute, but
the 8021q driver is also called to add the existing VLANs with the new
protocol and delete them with the old protocol.

In case the VLANs were offloaded via switchdev, the above behavior is
both redundant and buggy. Redundant because the VLANs are already
programmed in hardware and drivers that support VLAN protocol change
(currently only mlx5) change the protocol upon the switchdev attribute
notification. Buggy because the 8021q driver is called despite these
VLANs being marked with 'BR\_VLFLAG\_ADDED\_BY\_SWITCHDEV'. This leads to
memory leaks \[1\] when the VLANs are deleted.

Fix by not calling the 8021q driver for VLANs that were already
programmed via switchdev.

\[1\]
unreferenced object 0xffff8881f6771200 (size 256):
  comm "ip", pid 446855, jiffies 4298238841 (age 55.240s)
  hex dump (first 32 bytes):
    00 00 7f 0e 83 88 ff ff 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    \[\<00000000012819ac\>\] vlan\_vid\_add+0x437/0x750
    \[\<00000000f2281fad\>\] \_\_br\_vlan\_set\_proto+0x289/0x920
    \[\<000000000632b56f\>\] br\_changelink+0x3d6/0x13f0
    \[\<0000000089d25f04\>\] \_\_rtnl\_newlink+0x8ae/0x14c0
    \[\<00000000f6276baf\>\] rtnl\_newlink+0x5f/0x90
    \[\<00000000746dc902\>\] rtnetlink\_rcv\_msg+0x336/0xa00
    \[\<000000001c2241c0\>\] netlink\_rcv\_skb+0x11d/0x340
    \[\<0000000010588814\>\] netlink\_unicast+0x438/0x710
    \[\<00000000e1a4cd5c\>\] netlink\_sendmsg+0x788/0xc40
    \[\<00000000e8992d4e\>\] sock\_sendmsg+0xb0/0xe0
    \[\<00000000621b8f91\>\] \_\_\_\_sys\_sendmsg+0x4ff/0x6d0
    \[\<000000000ea26996\>\] \_\_\_sys\_sendmsg+0x12e/0x1b0
    \[\<00000000684f7e25\>\] \_\_sys\_sendmsg+0xab/0x130
    \[\<000000004538b104\>\] do\_syscall\_64+0x3d/0x90
    \[\<0000000091ed9678\>\] entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0

## Affected and fixed versions

- Linux: \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 347f1793b573466424c550f2748ed837b6690fe7; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< fc16a2c81a3eb1cbba8775f5bdc67856df903a7c; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< f8926e2d2225eb7b7e11cd3fa266aaad9075b767; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 9d45921ee4cb364910097e7d1b7558559c2f9fd2 (cvelist)
- Linux: 5.0 (cvelist)

## Mitigation

- Upgrade Linux to 9d45921ee4cb364910097e7d1b7558559c2f9fd2 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49812.md
Affected: Linux >= 279737939a8194f02fa352ab4476a1b241f44ef4, < 347f1793b573466424c550f2748ed837b6690fe7; >= 279737939a8194f02fa352ab4476a1b241f44ef4, < fc16a2c81a3eb1cbba8775f5bdc67856df903a7c; >= 279737939a8194f02fa352ab4476a1b241f44ef4, < f8926e2d2225eb7b7e11cd3fa266aaad9075b767; >= 279737939a8194f02fa352a…
Fixed in: Linux 347f1793b573466424c550f2748ed837b6690fe7, Linux 9d45921ee4cb364910097e7d1b7558559c2f9fd2

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-2022-49812 being exploited?

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

### How serious is CVE-2022-49812?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49812?

Linux \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 347f1793b573466424c550f2748ed837b6690fe7; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< fc16a2c81a3eb1cbba8775f5bdc67856df903a7c; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< f8926e2d2225eb7b7e11cd3fa266aaad9075b767; \>= 279737939a8194f02fa352ab4476a1b241f44ef4, \< 9d45921ee4cb364910097e7d1b7558559c2f9fd2; Linux 5.0.

### Is there a fix for CVE-2022-49812?

Yes. Fixed in Linux 347f1793b573466424c550f2748ed837b6690fe7, Linux 9d45921ee4cb364910097e7d1b7558559c2f9fd2. Upgrade Linux to 9d45921ee4cb364910097e7d1b7558559c2f9fd2 or later.

### How do I check if I'm affected by CVE-2022-49812?

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

- patch: <https://git.kernel.org/stable/c/347f1793b573466424c550f2748ed837b6690fe7>
- patch: <https://git.kernel.org/stable/c/fc16a2c81a3eb1cbba8775f5bdc67856df903a7c>
- patch: <https://git.kernel.org/stable/c/f8926e2d2225eb7b7e11cd3fa266aaad9075b767>
- patch: <https://git.kernel.org/stable/c/9d45921ee4cb364910097e7d1b7558559c2f9fd2>

## 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-2022-49812>

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