{"id":"CVE-2022-49878","aliases":["CVE-2022-49878"],"related":[],"kind":"vulnerability","state":"published","title":"bpf, verifier: Fix memory leak in array reallocation for stack state","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, verifier: Fix memory leak in array reallocation for stack state\n\nIf an error (NULL) is returned by krealloc(), callers of realloc_array()\nwere setting their allocation pointers to NULL, but on error krealloc()\ndoes not touch the original allocation. This would result in a memory\nresource leak. Instead, free the old allocation on the error handling\npath.\n\nThe memory leak information is as follows as also reported by Zhengchao:\n\n  unreferenced object 0xffff888019801800 (size 256):\n  comm \"bpf_repo\", pid 6490, jiffies 4294959200 (age 17.170s)\n  hex dump (first 32 bytes):\n    00 00 00 00 00 00 00 00 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    [<00000000b211474b>] __kmalloc_node_track_caller+0x45/0xc0\n    [<0000000086712a0b>] krealloc+0x83/0xd0\n    [<00000000139aab02>] realloc_array+0x82/0xe2\n    [<00000000b1ca41d1>] grow_stack_state+0xfb/0x186\n    [<00000000cd6f36d2>] check_mem_access.cold+0x141/0x1341\n    [<0000000081780455>] do_check_common+0x5358/0xb350\n    [<0000000015f6b091>] bpf_check.cold+0xc3/0x29d\n    [<000000002973c690>] bpf_prog_load+0x13db/0x2240\n    [<00000000028d1644>] __sys_bpf+0x1605/0x4ce0\n    [<00000000053f29bd>] __x64_sys_bpf+0x75/0xb0\n    [<0000000056fedaf5>] do_syscall_64+0x35/0x80\n    [<000000002bd58261>] entry_SYSCALL_64_after_hwframe+0x63/0xcd","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, verifier: Fix memory leak in array reallocation for stack state\n\nIf an error (NULL) is returned by krealloc(), callers of realloc_array()\nwere setting their allocation pointers to NULL, but on error krealloc()\ndoes not touch the original allocation. This would result in a memory\nresource leak. Instead, free the old allocation on the error handling\npath.\n\nThe memory leak information is as follows as also reported by Zhengchao:\n\n  unreferenced object 0xffff888019801800 (size 256):\n  comm \"bpf_repo\", pid 6490, jiffies 4294959200 (age 17.170s)\n  hex dump (first 32 bytes):\n    00 00 00 00 00 00 00 00 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    [<00000000b211474b>] __kmalloc_node_track_caller+0x45/0xc0\n    [<0000000086712a0b>] krealloc+0x83/0xd0\n    [<00000000139aab02>] realloc_array+0x82/0xe2\n    [<00000000b1ca41d1>] grow_stack_state+0xfb/0x186\n    [<00000000cd6f36d2>] check_mem_access.cold+0x141/0x1341\n    [<0000000081780455>] do_check_common+0x5358/0xb350\n    [<0000000015f6b091>] bpf_check.cold+0xc3/0x29d\n    [<000000002973c690>] bpf_prog_load+0x13db/0x2240\n    [<00000000028d1644>] __sys_bpf+0x1605/0x4ce0\n    [<00000000053f29bd>] __x64_sys_bpf+0x75/0xb0\n    [<0000000056fedaf5>] do_syscall_64+0x35/0x80\n    [<000000002bd58261>] entry_SYSCALL_64_after_hwframe+0x63/0xcd","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bpf, verificador: Se corrige una fuga de memoria en la reasignación de matriz para el estado de la pila. Si krealloc() devuelve un error (NULL), los usuarios de realloc_array() establecían sus punteros de asignación en NULL, pero en caso de error, krealloc() no modifica la asignación original. Esto provocaría una fuga de recursos de memoria. En su lugar, se libera la asignación anterior en la ruta de gestión de errores. La información de fuga de memoria es la siguiente, tal como lo informó Zhengchao: objeto sin referencia 0xffff888019801800 (tamaño 256): comm \"bpf_repo\", pid 6490, jiffies 4294959200 (edad 17.170s) volcado hexadecimal (primeros 32 bytes): 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 00 00 00 00 00 00 ................ backtrace: [&lt;00000000b211474b&gt;] __kmalloc_node_track_caller+0x45/0xc0 [&lt;0000000086712a0b&gt;] krealloc+0x83/0xd0 [&lt;00000000139aab02&gt;] realloc_array+0x82/0xe2 [&lt;00000000b1ca41d1&gt;] grow_stack_state+0xfb/0x186 [&lt;00000000cd6f36d2&gt;] check_mem_access.cold+0x141/0x1341 [&lt;0000000081780455&gt;] do_check_common+0x5358/0xb350 [&lt;0000000015f6b091&gt;] bpf_check.cold+0xc3/0x29d [&lt;000000002973c690&gt;] bpf_prog_load+0x13db/0x2240 [&lt;00000000028d1644&gt;] __sys_bpf+0x1605/0x4ce0 [&lt;00000000053f29bd&gt;] __x64_sys_bpf+0x75/0xb0 [&lt;0000000056fedaf5&gt;] do_syscall_64+0x35/0x80 [&lt;000000002bd58261&gt;] entry_SYSCALL_64_after_hwframe+0x63/0xcd","source":"nvd"}],"published":"2025-05-01T14:10:26.389Z","modified":"2026-06-17T05:19:23.973Z","severity":{"scorer":"CISA-ADP","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":"CISA-ADP","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"},{"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":"c69431aab67a912836e5831f03d99a819c14c9c3","fixed":"06615967d4889b08b19ff3dda96e8b131282f73d","status":"affected"},{"type":"git","introduced":"c69431aab67a912836e5831f03d99a819c14c9c3","fixed":"3e210891c4a4c2d858cd6f9f61d5809af251d4df","status":"affected"},{"type":"git","introduced":"c69431aab67a912836e5831f03d99a819c14c9c3","fixed":"42378a9ca55347102bbf86708776061d8fe3ece2","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.14","status":"unaffected"},{"type":"semver","introduced":"5.15.79","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.0.9","lastAffected":"6.0.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.1","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.14","fixed":"5.15.79"},{"status":"affected","introduced":"5.16","fixed":"6.0.9"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"},{"status":"affected","version":"6.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/06615967d4889b08b19ff3dda96e8b131282f73d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3e210891c4a4c2d858cd6f9f61d5809af251d4df","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/42378a9ca55347102bbf86708776061d8fe3ece2","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-10-01T16:02:47.368Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49878","url":"https://www.cve.org/CVERecord?id=CVE-2022-49878","licence":"CVE Terms of Use","modified":"2026-05-11T19:08:29.598Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49878","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49878","licence":"Public domain","modified":"2026-06-17T05:19:23.973Z"}],"updatedAt":"2026-11-25T22:58:20.915Z","epss":{"score":0.00281,"percentile":0.13181,"date":"2026-11-30T12:00:22.000Z"}}