# capabilities:修复vfs_getxattr_alloc()错误路径中的潜在内存泄漏问题
## 概述
在Linux内核中,修复了`cap_inode_getsecurity()`函数中`vfs_getxattr_alloc()`调用失败时可能导致的内存泄漏问题。
## 细节
在`cap_inode_getsecurity()`函数中,使用`vfs_getxattr_alloc()`完成`tmpbuf`的内存分配。如果成功完成了`tmpbuf`的内存分配,但在调用`handler->get(...)`时失败,将导致内存泄漏。具体逻辑如下:
```markdown
|-- ret = (int)vfs_getxattr_alloc(mnt_userns, ...)
| /* ^^^ alloc for tmpbuf */
|-- value = krealloc(*xattr_value, error + 1, flags)
| /* ^^^ alloc memory */
|-- error = handler->get(handler, ...)
| /* error! */
|-- *xattr_value = value
| /* xattr_value is &tmpbuf (memory leak!) */
```
为了解决这个问题,需要在`vfs_getxattr_alloc()`调用失败后调用`free(tmpbuf)`。
## 影响
该漏洞可能导致内核内存泄漏,影响系统性能和稳定性。具体影响的Linux内核版本未在描述中明确提及。
# | POC 描述 | 源链接 | 神龙链接 |
---|
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: 503 Service Temporarily Unavailable -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签:
标题: Making sure you're not a bot! -- 🔗来源链接
标签: