{"id":"CVE-2022-49636","aliases":["CVE-2022-49636"],"related":[],"kind":"vulnerability","state":"published","title":"vlan: fix memory leak in vlan_newlink()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nvlan: fix memory leak in vlan_newlink()\n\nBlamed commit added back a bug I fixed in commit 9bbd917e0bec\n(\"vlan: fix memory leak in vlan_dev_set_egress_priority\")\n\nIf a memory allocation fails in vlan_changelink() after other allocations\nsucceeded, we need to call vlan_dev_free_egress_priority()\nto free all allocated memory because after a failed ->newlink()\nwe do not call any methods like ndo_uninit() or dev->priv_destructor().\n\nIn following example, if the allocation for last element 2000:2001 fails,\nwe need to free eight prior allocations:\n\nip link add link dummy0 dummy0.100 type vlan id 100 \\\n\tegress-qos-map 1:2 2:3 3:4 4:5 5:6 6:7 7:8 8:9 2000:2001\n\nsyzbot report was:\n\nBUG: memory leak\nunreferenced object 0xffff888117bd1060 (size 32):\ncomm \"syz-executor408\", pid 3759, jiffies 4294956555 (age 34.090s)\nhex dump (first 32 bytes):\n09 00 00 00 00 a0 00 00 00 00 00 00 00 00 00 00 ................\n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\nbacktrace:\n[<ffffffff83fc60ad>] kmalloc include/linux/slab.h:600 [inline]\n[<ffffffff83fc60ad>] vlan_dev_set_egress_priority+0xed/0x170 net/8021q/vlan_dev.c:193\n[<ffffffff83fc6628>] vlan_changelink+0x178/0x1d0 net/8021q/vlan_netlink.c:128\n[<ffffffff83fc67c8>] vlan_newlink+0x148/0x260 net/8021q/vlan_netlink.c:185\n[<ffffffff838b1278>] rtnl_newlink_create net/core/rtnetlink.c:3363 [inline]\n[<ffffffff838b1278>] __rtnl_newlink+0xa58/0xdc0 net/core/rtnetlink.c:3580\n[<ffffffff838b1629>] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3593\n[<ffffffff838ac66c>] rtnetlink_rcv_msg+0x21c/0x5c0 net/core/rtnetlink.c:6089\n[<ffffffff839f9c37>] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2501\n[<ffffffff839f8da7>] netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]\n[<ffffffff839f8da7>] netlink_unicast+0x397/0x4c0 net/netlink/af_netlink.c:1345\n[<ffffffff839f9266>] netlink_sendmsg+0x396/0x710 net/netlink/af_netlink.c:1921\n[<ffffffff8384dbf6>] sock_sendmsg_nosec net/socket.c:714 [inline]\n[<ffffffff8384dbf6>] sock_sendmsg+0x56/0x80 net/socket.c:734\n[<ffffffff8384e15c>] ____sys_sendmsg+0x36c/0x390 net/socket.c:2488\n[<ffffffff838523cb>] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2542\n[<ffffffff838525b8>] __sys_sendmsg net/socket.c:2571 [inline]\n[<ffffffff838525b8>] __do_sys_sendmsg net/socket.c:2580 [inline]\n[<ffffffff838525b8>] __se_sys_sendmsg net/socket.c:2578 [inline]\n[<ffffffff838525b8>] __x64_sys_sendmsg+0x78/0xf0 net/socket.c:2578\n[<ffffffff845ad8d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n[<ffffffff845ad8d5>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80\n[<ffffffff8460006a>] entry_SYSCALL_64_after_hwframe+0x46/0xb0","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nvlan: fix memory leak in vlan_newlink()\n\nBlamed commit added back a bug I fixed in commit 9bbd917e0bec\n(\"vlan: fix memory leak in vlan_dev_set_egress_priority\")\n\nIf a memory allocation fails in vlan_changelink() after other allocations\nsucceeded, we need to call vlan_dev_free_egress_priority()\nto free all allocated memory because after a failed ->newlink()\nwe do not call any methods like ndo_uninit() or dev->priv_destructor().\n\nIn following example, if the allocation for last element 2000:2001 fails,\nwe need to free eight prior allocations:\n\nip link add link dummy0 dummy0.100 type vlan id 100 \\\n\tegress-qos-map 1:2 2:3 3:4 4:5 5:6 6:7 7:8 8:9 2000:2001\n\nsyzbot report was:\n\nBUG: memory leak\nunreferenced object 0xffff888117bd1060 (size 32):\ncomm \"syz-executor408\", pid 3759, jiffies 4294956555 (age 34.090s)\nhex dump (first 32 bytes):\n09 00 00 00 00 a0 00 00 00 00 00 00 00 00 00 00 ................\n00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\nbacktrace:\n[<ffffffff83fc60ad>] kmalloc include/linux/slab.h:600 [inline]\n[<ffffffff83fc60ad>] vlan_dev_set_egress_priority+0xed/0x170 net/8021q/vlan_dev.c:193\n[<ffffffff83fc6628>] vlan_changelink+0x178/0x1d0 net/8021q/vlan_netlink.c:128\n[<ffffffff83fc67c8>] vlan_newlink+0x148/0x260 net/8021q/vlan_netlink.c:185\n[<ffffffff838b1278>] rtnl_newlink_create net/core/rtnetlink.c:3363 [inline]\n[<ffffffff838b1278>] __rtnl_newlink+0xa58/0xdc0 net/core/rtnetlink.c:3580\n[<ffffffff838b1629>] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3593\n[<ffffffff838ac66c>] rtnetlink_rcv_msg+0x21c/0x5c0 net/core/rtnetlink.c:6089\n[<ffffffff839f9c37>] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2501\n[<ffffffff839f8da7>] netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]\n[<ffffffff839f8da7>] netlink_unicast+0x397/0x4c0 net/netlink/af_netlink.c:1345\n[<ffffffff839f9266>] netlink_sendmsg+0x396/0x710 net/netlink/af_netlink.c:1921\n[<ffffffff8384dbf6>] sock_sendmsg_nosec net/socket.c:714 [inline]\n[<ffffffff8384dbf6>] sock_sendmsg+0x56/0x80 net/socket.c:734\n[<ffffffff8384e15c>] ____sys_sendmsg+0x36c/0x390 net/socket.c:2488\n[<ffffffff838523cb>] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2542\n[<ffffffff838525b8>] __sys_sendmsg net/socket.c:2571 [inline]\n[<ffffffff838525b8>] __do_sys_sendmsg net/socket.c:2580 [inline]\n[<ffffffff838525b8>] __se_sys_sendmsg net/socket.c:2578 [inline]\n[<ffffffff838525b8>] __x64_sys_sendmsg+0x78/0xf0 net/socket.c:2578\n[<ffffffff845ad8d5>] do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n[<ffffffff845ad8d5>] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80\n[<ffffffff8460006a>] entry_SYSCALL_64_after_hwframe+0x46/0xb0","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: vlan: arregla la pérdida de memoria en vlan_newlink() El commit culpable agregó un error que arreglé en el commit 9bbd917e0bec (\"vlan: arregla la pérdida de memoria en vlan_dev_set_egress_priority\") Si una asignación de memoria falla en vlan_changelink() después de que otras asignaciones tuvieron éxito, debemos llamar a vlan_dev_free_egress_priority() para liberar toda la memoria asignada porque después de un -&gt;newlink() fallido no llamamos a ningún método como ndo_uninit() o dev-&gt;priv_destructor(). En el siguiente ejemplo, si falla la asignación del último elemento 2000:2001, necesitamos liberar ocho asignaciones anteriores: ip link add link dummy0 dummy0.100 type vlan id 100 \\ egress-qos-map 1:2 2:3 3:4 4:5 5:6 6:7 7:8 8:9 2000:2001 el informe de syzbot fue: ERROR: pérdida de memoria objeto no referenciado 0xffff888117bd1060 (size 32): comm \"syz-executor408\", pid 3759, jiffies 4294956555 (age 34.090s) hex dump (first 32 bytes): 09 00 00 00 00 a0 00 00 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: [] kmalloc include/linux/slab.h:600 [inline] [] vlan_dev_set_egress_priority+0xed/0x170 net/8021q/vlan_dev.c:193 [] vlan_changelink+0x178/0x1d0 net/8021q/vlan_netlink.c:128 [] vlan_newlink+0x148/0x260 net/8021q/vlan_netlink.c:185 [] rtnl_newlink_create net/core/rtnetlink.c:3363 [inline] [] __rtnl_newlink+0xa58/0xdc0 net/core/rtnetlink.c:3580 [] rtnl_newlink+0x49/0x70 net/core/rtnetlink.c:3593 [] rtnetlink_rcv_msg+0x21c/0x5c0 net/core/rtnetlink.c:6089 [] netlink_rcv_skb+0x87/0x1d0 net/netlink/af_netlink.c:2501 [] netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] [] netlink_unicast+0x397/0x4c0 net/netlink/af_netlink.c:1345 [] netlink_sendmsg+0x396/0x710 net/netlink/af_netlink.c:1921 [] sock_sendmsg_nosec net/socket.c:714 [inline] [] sock_sendmsg+0x56/0x80 net/socket.c:734 [] ____sys_sendmsg+0x36c/0x390 net/socket.c:2488 [] ___sys_sendmsg+0x8b/0xd0 net/socket.c:2542 [] __sys_sendmsg net/socket.c:2571 [inline] [] __do_sys_sendmsg net/socket.c:2580 [inline] [] __se_sys_sendmsg net/socket.c:2578 [inline] [] __x64_sys_sendmsg+0x78/0xf0 net/socket.c:2578 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x46/0xb0","source":"nvd"}],"published":"2025-02-26T02:23:46.222Z","modified":"2026-06-17T05:18:42.173Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-401"],"affected":[{"ranges":[{"type":"git","introduced":"b195d229de401377f70c04e0dff93b342464ec8e","fixed":"549de58dba4bf1b2adc72e9948b9c76fa88be9d2","status":"affected"},{"type":"git","introduced":"62d7ad2c191122119c66361ba6d9f04974b51afe","fixed":"df27729a4fe0002dfd80c96fe1c142829c672728","status":"affected"},{"type":"git","introduced":"842801181864690fdcde73b017cce4c1353a7083","fixed":"f5dc10b910bdac523e5947336445a77066c51bf9","status":"affected"},{"type":"git","introduced":"37aa50c539bcbcc01767e515bd170787fcfc0f33","fixed":"4c43069bb1097dd6cc1cf0f7c43a36d1f7b3910b","status":"affected"},{"type":"git","introduced":"37aa50c539bcbcc01767e515bd170787fcfc0f33","fixed":"72a0b329114b1caa8e69dfa7cdad1dd3c69b8602","status":"affected"},{"type":"semver","introduced":"5.4.291","fixed":"5.4.292","status":"affected"},{"type":"semver","introduced":"5.10.235","fixed":"5.10.236","status":"affected"},{"type":"semver","introduced":"5.15.142","fixed":"5.15.180","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.17","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.17","status":"unaffected"},{"type":"semver","introduced":"5.4.292","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.236","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.180","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.18.13","lastAffected":"5.18.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.19","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.15.142","fixed":"5.16"},{"status":"affected","introduced":"5.17","fixed":"5.18.13"},{"status":"affected","version":"5.19"},{"status":"affected","version":"5.19"},{"status":"affected","version":"5.19"},{"status":"affected","version":"5.19"},{"status":"affected","version":"5.19"},{"status":"affected","version":"5.19"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/549de58dba4bf1b2adc72e9948b9c76fa88be9d2","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/df27729a4fe0002dfd80c96fe1c142829c672728","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f5dc10b910bdac523e5947336445a77066c51bf9","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4c43069bb1097dd6cc1cf0f7c43a36d1f7b3910b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/72a0b329114b1caa8e69dfa7cdad1dd3c69b8602","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49636","url":"https://www.cve.org/CVERecord?id=CVE-2022-49636","licence":"CVE Terms of Use","modified":"2026-05-23T15:22:36.202Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49636","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49636","licence":"Public domain","modified":"2026-06-17T05:18:42.173Z"}],"updatedAt":"2026-11-25T22:58:20.771Z","epss":{"score":0.00284,"percentile":0.1348,"date":"2026-11-30T12:00:22.000Z"}}