一、 漏洞 CVE-2022-49890 基础信息
漏洞信息
                                        # 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内核版本未在描述中明确提及。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
capabilities: fix potential memleak on error path from vfs_getxattr_alloc()
来源:美国国家漏洞数据库 NVD
漏洞描述信息
In the Linux kernel, the following vulnerability has been resolved: capabilities: fix potential memleak on error path from vfs_getxattr_alloc() In cap_inode_getsecurity(), we will use vfs_getxattr_alloc() to complete the memory allocation of tmpbuf, if we have completed the memory allocation of tmpbuf, but failed to call handler->get(...), there will be a memleak in below logic: |-- 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!) */ So we will try to free(tmpbuf) after vfs_getxattr_alloc() fails to fix it. [PM: subject line and backtrace tweaks]
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
N/A
来源:美国国家漏洞数据库 NVD
漏洞标题
Linux kernel 安全漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于未释放tmpbuf内存,可能导致内存泄漏。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
其他
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2022-49890 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2022-49890 的情报信息