一、 漏洞 CVE-2025-38257 基础信息
漏洞信息
                                        # s390/pkey: 防止 memdup_user() 的大小计算溢出

## 概述
在Linux内核中,`s390/pkey`模块中存在一个漏洞,该漏洞可能导致在调用`memdup_user()`时产生溢出。

## 细节
`nr_apqns`变量中的apqn目标列表项数量是由用户空间通过 ioctl 调用确定的。这会导致在计算传递给`memdup_user()`的大小时产生溢出。如果发生溢出,实际分配的区域大小和描述它的值将不同步,从而导致各种不可预测的行为。

通过使用`memdup_array_user()`辅助函数来解决该问题,该函数会在检测到溢出时返回错误。需要注意的是,这与`nr_apqns`最初为零的情况不同,后者被认为是有效的,并应在后续的`pkey_handler`实现中处理。

## 影响
该漏洞可能导致分配的内存大小与实际值不同步,从而引起不可预见的行为。

## 发现信息
该漏洞由Linux Verification Center (linuxtesting.org)发现。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
s390/pkey: Prevent overflow in size calculation for memdup_user()
来源:美国国家漏洞数据库 NVD
漏洞描述信息
In the Linux kernel, the following vulnerability has been resolved: s390/pkey: Prevent overflow in size calculation for memdup_user() Number of apqn target list entries contained in 'nr_apqns' variable is determined by userspace via an ioctl call so the result of the product in calculation of size passed to memdup_user() may overflow. In this case the actual size of the allocated area and the value describing it won't be in sync leading to various types of unpredictable behaviour later. Use a proper memdup_array_user() helper which returns an error if an overflow is detected. Note that it is different from when nr_apqns is initially zero - that case is considered valid and should be handled in subsequent pkey_handler implementations. Found by Linux Verification Center (linuxtesting.org).
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
N/A
来源:美国国家漏洞数据库 NVD
漏洞标题
Linux kernel 安全漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于s390 pkey驱动中memdup_user计算溢出,可能导致内存分配错误。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
其他
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2025-38257 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2025-38257 的情报信息