{"id":"CVE-2022-49890","published":"2025-05-01T14:10:34Z","modified":"2026-05-11T19:08:43Z","title":"capabilities: fix potential memleak on error path from vfs_getxattr_alloc()","vendor":"Linux","product":"Linux","tier":"tail","description":{"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]","provenance":"source","from":"CVE.org"},"cvss":{"score":5.5,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CISA ADP Vulnrichment"},"epss":{"score":0.00218,"percentile":0.12496,"provenance":"source"},"cwes":[{"id":"CWE-401","name":"Missing Release of Memory after Effective Lifetime"}],"references":[{"url":"https://git.kernel.org/stable/c/6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85","tags":[]},{"url":"https://git.kernel.org/stable/c/90577bcc01c4188416a47269f8433f70502abe98","tags":[]},{"url":"https://git.kernel.org/stable/c/0c3e6288da650d1ec911a259c77bc2d88e498603","tags":[]},{"url":"https://git.kernel.org/stable/c/cdf01c807e974048c43c7fd3ca574f6086a57906","tags":[]},{"url":"https://git.kernel.org/stable/c/2de8eec8afb75792440b8900a01d52b8f6742fd1","tags":[]},{"url":"https://git.kernel.org/stable/c/7480aeff0093d8c54377553ec6b31110bea37b4d","tags":[]},{"url":"https://git.kernel.org/stable/c/8cf0a1bc12870d148ae830a4ba88cfdf0e879cee","tags":[]}],"priority":{"score":6.3,"factors":[{"name":"EPSS percentile","points":2.5},{"name":"CVSS severity","points":3.85}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 6bb00eb21c0fbf18e5d3538c9ff0cf63fd0ace85",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 90577bcc01c4188416a47269f8433f70502abe98",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 0c3e6288da650d1ec911a259c77bc2d88e498603",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < cdf01c807e974048c43c7fd3ca574f6086a57906",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 2de8eec8afb75792440b8900a01d52b8f6742fd1",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 7480aeff0093d8c54377553ec6b31110bea37b4d",">= 8db6c34f1dbc8e06aa016a9b829b06902c3e1340, < 8cf0a1bc12870d148ae830a4ba88cfdf0e879cee"]},{"vendor":"Linux","product":"Linux","versions":["4.14"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-10-01T16:08:33.672566Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2025-12880","exploited":false,"provenance":"source"}}