{"id":"CVE-2022-49890","aliases":["CVE-2022-49890"],"related":[],"kind":"vulnerability","state":"published","title":"capabilities: fix potential memleak on error path from vfs_getxattr_alloc()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ncapabilities: fix potential memleak on error path from vfs_getxattr_alloc()\n\nIn cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to\ncomplete the memory allocation of tmpbuf, if we have completed\nthe memory allocation of tmpbuf, but failed to call handler->get(...),\nthere will be a memleak in below logic:\n\n  |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...)\n    |           /* ^^^ alloc for tmpbuf */\n    |-- value = krealloc(*xattr_value, error + 1, flags)\n    |           /* ^^^ alloc memory */\n    |-- error = handler->get(handler, ...)\n    |           /* error! */\n    |-- *xattr_value = value\n    |           /* xattr_value is &tmpbuf (memory leak!) */\n\nSo we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it.\n\n[PM: subject line and backtrace tweaks]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ncapabilities: fix potential memleak on error path from vfs_getxattr_alloc()\n\nIn cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to\ncomplete the memory allocation of tmpbuf, if we have completed\nthe memory allocation of tmpbuf, but failed to call handler->get(...),\nthere will be a memleak in below logic:\n\n  |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...)\n    |           /* ^^^ alloc for tmpbuf */\n    |-- value = krealloc(*xattr_value, error + 1, flags)\n    |           /* ^^^ alloc memory */\n    |-- error = handler->get(handler, ...)\n    |           /* error! */\n    |-- *xattr_value = value\n    |           /* xattr_value is &tmpbuf (memory leak!) */\n\nSo we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it.\n\n[PM: subject line and backtrace tweaks]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: capacidades: reparar posible fuga de memoria en la ruta de error de vfs_getxattr_alloc() En cap_inode_getsecurity(), utilizaremos vfs_getxattr_alloc() para completar la asignación de memoria de tmpbuf, si hemos completado la asignación de memoria de tmpbuf, pero no pudimos llamar a handler-&gt;get(...), habrá una fuga de memoria en la siguiente lógica: |-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...) | /* ^^^ asignar para tmpbuf */ |-- valor = krealloc(*xattr_value, error + 1, flags) | /* ^^^ asignar memoria */ |-- error = handler-&gt;get(handler, ...) | /* ¡error! */ |-- *xattr_value = valor | /* xattr_value es &amp;tmpbuf (¡pérdida de memoria!) */ Intentaremos liberar (tmpbuf) después de que vfs_getxattr_alloc() no pueda solucionarlo. [MP: línea de asunto y ajustes de backtrace]","source":"nvd"}],"published":"2025-05-01T14:10:34.481Z","modified":"2026-06-17T05:19:26.050Z","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":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"90577bcc01c4188416a47269f8433f70502abe98","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"0c3e6288da650d1ec911a259c77bc2d88e498603","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"cdf01c807e974048c43c7fd3ca574f6086a57906","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"2de8eec8afb75792440b8900a01d52b8f6742fd1","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"7480aeff0093d8c54377553ec6b31110bea37b4d","status":"affected"},{"type":"git","introduced":"8db6c34f1dbc8e06aa016a9b829b06902c3e1340","fixed":"8cf0a1bc12870d148ae830a4ba88cfdf0e879cee","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.14","status":"unaffected"},{"type":"semver","introduced":"4.14.299","lastAffected":"4.14.*","status":"unaffected"},{"type":"semver","introduced":"4.19.265","lastAffected":"4.19.*","status":"unaffected"},{"type":"semver","introduced":"5.4.224","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.154","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.78","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.0.8","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":"4.14","fixed":"4.14.299"},{"status":"affected","introduced":"4.15","fixed":"4.19.265"},{"status":"affected","introduced":"4.20","fixed":"5.4.224"},{"status":"affected","introduced":"5.5","fixed":"5.10.154"},{"status":"affected","introduced":"5.11","fixed":"5.15.78"},{"status":"affected","introduced":"5.16","fixed":"6.0.8"},{"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/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-10-01T16:08:33.672Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49890","url":"https://www.cve.org/CVERecord?id=CVE-2022-49890","licence":"CVE Terms of Use","modified":"2026-05-11T19:08:43.268Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49890","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49890","licence":"Public domain","modified":"2026-06-17T05:19:26.050Z"}],"updatedAt":"2026-11-25T22:58:20.921Z","epss":{"score":0.00285,"percentile":0.1371,"date":"2026-11-30T12:00:22.000Z"}}