cve-2022-49812
Vulnerability from cvelistv5
Published
2025-05-01 14:09
Modified
2025-05-04 08:45
Severity ?
EPSS score ?
Summary
bridge: switchdev: Fix memory leaks when changing VLAN protocol
References
{ "containers": { "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "net/bridge/br_vlan.c" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "347f1793b573466424c550f2748ed837b6690fe7", "status": "affected", "version": "279737939a8194f02fa352ab4476a1b241f44ef4", "versionType": "git" }, { "lessThan": "fc16a2c81a3eb1cbba8775f5bdc67856df903a7c", "status": "affected", "version": "279737939a8194f02fa352ab4476a1b241f44ef4", "versionType": "git" }, { "lessThan": "f8926e2d2225eb7b7e11cd3fa266aaad9075b767", "status": "affected", "version": "279737939a8194f02fa352ab4476a1b241f44ef4", "versionType": "git" }, { "lessThan": "9d45921ee4cb364910097e7d1b7558559c2f9fd2", "status": "affected", "version": "279737939a8194f02fa352ab4476a1b241f44ef4", "versionType": "git" } ] }, { "defaultStatus": "affected", "product": "Linux", "programFiles": [ "net/bridge/br_vlan.c" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "status": "affected", "version": "5.0" }, { "lessThan": "5.0", "status": "unaffected", "version": "0", "versionType": "semver" }, { "lessThanOrEqual": "5.10.*", "status": "unaffected", "version": "5.10.157", "versionType": "semver" }, { "lessThanOrEqual": "5.15.*", "status": "unaffected", "version": "5.15.80", "versionType": "semver" }, { "lessThanOrEqual": "6.0.*", "status": "unaffected", "version": "6.0.10", "versionType": "semver" }, { "lessThanOrEqual": "*", "status": "unaffected", "version": "6.1", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "cpeMatch": [ { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.10.157", "versionStartIncluding": "5.0", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.15.80", "versionStartIncluding": "5.0", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.0.10", "versionStartIncluding": "5.0", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.1", "versionStartIncluding": "5.0", "vulnerable": true } ], "negate": false, "operator": "OR" } ] } ], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nbridge: switchdev: Fix memory leaks when changing VLAN protocol\n\nThe bridge driver can offload VLANs to the underlying hardware either\nvia switchdev or the 8021q driver. When the former is used, the VLAN is\nmarked in the bridge driver with the \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027\nprivate flag.\n\nTo avoid the memory leaks mentioned in the cited commit, the bridge\ndriver will try to delete a VLAN via the 8021q driver if the VLAN is not\nmarked with the previously mentioned flag.\n\nWhen the VLAN protocol of the bridge changes, switchdev drivers are\nnotified via the \u0027SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL\u0027 attribute, but\nthe 8021q driver is also called to add the existing VLANs with the new\nprotocol and delete them with the old protocol.\n\nIn case the VLANs were offloaded via switchdev, the above behavior is\nboth redundant and buggy. Redundant because the VLANs are already\nprogrammed in hardware and drivers that support VLAN protocol change\n(currently only mlx5) change the protocol upon the switchdev attribute\nnotification. Buggy because the 8021q driver is called despite these\nVLANs being marked with \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027. This leads to\nmemory leaks [1] when the VLANs are deleted.\n\nFix by not calling the 8021q driver for VLANs that were already\nprogrammed via switchdev.\n\n[1]\nunreferenced object 0xffff8881f6771200 (size 256):\n comm \"ip\", pid 446855, jiffies 4298238841 (age 55.240s)\n hex dump (first 32 bytes):\n 00 00 7f 0e 83 88 ff ff 00 00 00 00 00 00 00 00 ................\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\n backtrace:\n [\u003c00000000012819ac\u003e] vlan_vid_add+0x437/0x750\n [\u003c00000000f2281fad\u003e] __br_vlan_set_proto+0x289/0x920\n [\u003c000000000632b56f\u003e] br_changelink+0x3d6/0x13f0\n [\u003c0000000089d25f04\u003e] __rtnl_newlink+0x8ae/0x14c0\n [\u003c00000000f6276baf\u003e] rtnl_newlink+0x5f/0x90\n [\u003c00000000746dc902\u003e] rtnetlink_rcv_msg+0x336/0xa00\n [\u003c000000001c2241c0\u003e] netlink_rcv_skb+0x11d/0x340\n [\u003c0000000010588814\u003e] netlink_unicast+0x438/0x710\n [\u003c00000000e1a4cd5c\u003e] netlink_sendmsg+0x788/0xc40\n [\u003c00000000e8992d4e\u003e] sock_sendmsg+0xb0/0xe0\n [\u003c00000000621b8f91\u003e] ____sys_sendmsg+0x4ff/0x6d0\n [\u003c000000000ea26996\u003e] ___sys_sendmsg+0x12e/0x1b0\n [\u003c00000000684f7e25\u003e] __sys_sendmsg+0xab/0x130\n [\u003c000000004538b104\u003e] do_syscall_64+0x3d/0x90\n [\u003c0000000091ed9678\u003e] entry_SYSCALL_64_after_hwframe+0x46/0xb0" } ], "providerMetadata": { "dateUpdated": "2025-05-04T08:45:52.554Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/347f1793b573466424c550f2748ed837b6690fe7" }, { "url": "https://git.kernel.org/stable/c/fc16a2c81a3eb1cbba8775f5bdc67856df903a7c" }, { "url": "https://git.kernel.org/stable/c/f8926e2d2225eb7b7e11cd3fa266aaad9075b767" }, { "url": "https://git.kernel.org/stable/c/9d45921ee4cb364910097e7d1b7558559c2f9fd2" } ], "title": "bridge: switchdev: Fix memory leaks when changing VLAN protocol", "x_generator": { "engine": "bippy-1.2.0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2022-49812", "datePublished": "2025-05-01T14:09:36.741Z", "dateReserved": "2025-05-01T14:05:17.226Z", "dateUpdated": "2025-05-04T08:45:52.554Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2022-49812\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-05-01T15:16:04.560\",\"lastModified\":\"2025-05-02T13:53:20.943\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nbridge: switchdev: Fix memory leaks when changing VLAN protocol\\n\\nThe bridge driver can offload VLANs to the underlying hardware either\\nvia switchdev or the 8021q driver. When the former is used, the VLAN is\\nmarked in the bridge driver with the \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027\\nprivate flag.\\n\\nTo avoid the memory leaks mentioned in the cited commit, the bridge\\ndriver will try to delete a VLAN via the 8021q driver if the VLAN is not\\nmarked with the previously mentioned flag.\\n\\nWhen the VLAN protocol of the bridge changes, switchdev drivers are\\nnotified via the \u0027SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL\u0027 attribute, but\\nthe 8021q driver is also called to add the existing VLANs with the new\\nprotocol and delete them with the old protocol.\\n\\nIn case the VLANs were offloaded via switchdev, the above behavior is\\nboth redundant and buggy. Redundant because the VLANs are already\\nprogrammed in hardware and drivers that support VLAN protocol change\\n(currently only mlx5) change the protocol upon the switchdev attribute\\nnotification. Buggy because the 8021q driver is called despite these\\nVLANs being marked with \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027. This leads to\\nmemory leaks [1] when the VLANs are deleted.\\n\\nFix by not calling the 8021q driver for VLANs that were already\\nprogrammed via switchdev.\\n\\n[1]\\nunreferenced object 0xffff8881f6771200 (size 256):\\n comm \\\"ip\\\", pid 446855, jiffies 4298238841 (age 55.240s)\\n hex dump (first 32 bytes):\\n 00 00 7f 0e 83 88 ff ff 00 00 00 00 00 00 00 00 ................\\n 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\\n backtrace:\\n [\u003c00000000012819ac\u003e] vlan_vid_add+0x437/0x750\\n [\u003c00000000f2281fad\u003e] __br_vlan_set_proto+0x289/0x920\\n [\u003c000000000632b56f\u003e] br_changelink+0x3d6/0x13f0\\n [\u003c0000000089d25f04\u003e] __rtnl_newlink+0x8ae/0x14c0\\n [\u003c00000000f6276baf\u003e] rtnl_newlink+0x5f/0x90\\n [\u003c00000000746dc902\u003e] rtnetlink_rcv_msg+0x336/0xa00\\n [\u003c000000001c2241c0\u003e] netlink_rcv_skb+0x11d/0x340\\n [\u003c0000000010588814\u003e] netlink_unicast+0x438/0x710\\n [\u003c00000000e1a4cd5c\u003e] netlink_sendmsg+0x788/0xc40\\n [\u003c00000000e8992d4e\u003e] sock_sendmsg+0xb0/0xe0\\n [\u003c00000000621b8f91\u003e] ____sys_sendmsg+0x4ff/0x6d0\\n [\u003c000000000ea26996\u003e] ___sys_sendmsg+0x12e/0x1b0\\n [\u003c00000000684f7e25\u003e] __sys_sendmsg+0xab/0x130\\n [\u003c000000004538b104\u003e] do_syscall_64+0x3d/0x90\\n [\u003c0000000091ed9678\u003e] entry_SYSCALL_64_after_hwframe+0x46/0xb0\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bridge: switchdev: Fix memory leakage when Changing VLAN protocol El controlador del puente puede descargar VLAN al hardware subyacente mediante switchdev o el controlador 8021q. Cuando se utiliza el primero, la VLAN se marca en el controlador del puente con el indicador privado \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027. Para evitar las fugas de memoria mencionadas en la confirmaci\u00f3n citada, el controlador del puente intentar\u00e1 eliminar una VLAN mediante el controlador 8021q si la VLAN no est\u00e1 marcada con el indicador mencionado anteriormente. Cuando cambia el protocolo VLAN del puente, se notifica a los controladores switchdev mediante el atributo \u0027SWITCHDEV_ATTR_ID_BRIDGE_VLAN_PROTOCOL\u0027, pero tambi\u00e9n se llama al controlador 8021q para agregar las VLAN existentes con el nuevo protocolo y eliminarlas con el protocolo anterior. En caso de que las VLAN se descargaran mediante switchdev, el comportamiento anterior es redundante y presenta errores. Redundante porque las VLAN ya est\u00e1n programadas en el hardware y los controladores compatibles con el cambio de protocolo de VLAN (actualmente solo mlx5) cambian el protocolo al recibir la notificaci\u00f3n del atributo switchdev. Presenta errores porque se llama al controlador 8021q a pesar de que estas VLAN est\u00e1n marcadas con \u0027BR_VLFLAG_ADDED_BY_SWITCHDEV\u0027. Esto provoca fugas de memoria [1] al eliminar las VLAN. Se soluciona no llamando al controlador 8021q para las VLAN ya programadas mediante switchdev. [1] objeto sin referencia 0xffff8881f6771200 (tama\u00f1o 256): comm \\\"ip\\\", pid 446855, jiffies 4298238841 (edad 55.240s) volcado hexadecimal (primeros 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 ................ backtrace: [\u0026lt;00000000012819ac\u0026gt;] vlan_vid_add+0x437/0x750 [\u0026lt;00000000f2281fad\u0026gt;] __br_vlan_set_proto+0x289/0x920 [\u0026lt;000000000632b56f\u0026gt;] br_changelink+0x3d6/0x13f0 [\u0026lt;0000000089d25f04\u0026gt;] __rtnl_newlink+0x8ae/0x14c0 [\u0026lt;00000000f6276baf\u0026gt;] rtnl_newlink+0x5f/0x90 [\u0026lt;00000000746dc902\u0026gt;] rtnetlink_rcv_msg+0x336/0xa00 [\u0026lt;000000001c2241c0\u0026gt;] netlink_rcv_skb+0x11d/0x340 [\u0026lt;0000000010588814\u0026gt;] netlink_unicast+0x438/0x710 [\u0026lt;00000000e1a4cd5c\u0026gt;] netlink_sendmsg+0x788/0xc40 [\u0026lt;00000000e8992d4e\u0026gt;] sock_sendmsg+0xb0/0xe0 [\u0026lt;00000000621b8f91\u0026gt;] ____sys_sendmsg+0x4ff/0x6d0 [\u0026lt;000000000ea26996\u0026gt;] ___sys_sendmsg+0x12e/0x1b0 [\u0026lt;00000000684f7e25\u0026gt;] __sys_sendmsg+0xab/0x130 [\u0026lt;000000004538b104\u0026gt;] do_syscall_64+0x3d/0x90 [\u0026lt;0000000091ed9678\u0026gt;] entry_SYSCALL_64_after_hwframe+0x46/0xb0 \"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/347f1793b573466424c550f2748ed837b6690fe7\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/9d45921ee4cb364910097e7d1b7558559c2f9fd2\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f8926e2d2225eb7b7e11cd3fa266aaad9075b767\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/fc16a2c81a3eb1cbba8775f5bdc67856df903a7c\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}" } }
Loading...
Loading...
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.