428 Star 1.6K Fork 1.6K

GVPopenEuler/kernel

 / 详情

CVE-2023-52451

待办的
任务
创建于  
2024-02-28 11:47

在ppc架构的pseries平台上,内存热插拔使用drmem_info来跟踪可用的内存插槽。

dlpar_memory_remove_by_index(u32 drc_index) 的功能是根据提供的索引号,从 DLPAR(Dynamic Logical Partitioning,可以动态增加或减少的分配给逻辑分区的内存) 内存中的相应位置删除内存块。
此函数首先会对提供的索引号进行有效性检查,以确保其在 DLPAR 内存的有效范围内,方法如下:
    遍历&drmem_info->lmbs[0]到&drmem_info->lmbs[drmem_info->n_lmbs],并将每个元素赋值给lmb,然后用lmb->drc_index对比传参drc_index。

如果全都没匹配上(例如内存插槽数量超过了lmbs数组大小,这里就会匹配不上),lmb会指向&drmem_info->lmbs[drmem_info->n_lmbs],这是数组中最后一个有效条目之后的一个元素。在函数末尾打印调试信息时,会访问lmb->base_addr,即访问数组末尾之外的内存地址,从而导致系统崩溃。

因此新增一条调试信息来记录匹配不到drc_index的情况,并仅在lmb->base_addr指向有效条目时使用下标打印调试信息。

评论 (1)

林郁钧 创建了任务 1年前

Hi ieee233_3, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers.

openeuler-ci-bot 添加了
 
sig/Kernel
标签
1年前

登录 后才可以发表评论

状态
负责人
项目
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936 林郁钧-ieee233_3
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助