427 Star 1.5K Fork 1.6K

GVPopenEuler/kernel

 / 详情

【OLK-5.10/6.6】xfs: Fix data overflow in xfs_mod_fdblocks()

已完成
任务
创建于  
2024-11-29 12:22

原问题代码中,会下 xfs 预留块相关的 ioctl,入参是一个较大的数,xfs_reserve_blocks 函数的执行逻辑是,如果当前传入的预留块大小比整个文件系统的可用块还要大,也将传入的预留块赋值给 mp->m_resblks,是因为后续的 xfs_mod_fdblocks 函数会去适配。

但是 当前 xfs_mod_fdblocks 会去计算 mp->m_resblks - mp->m_resblks_avail,并强转为 long long,而前两者都是 unsigned long long类型,如果二者之差非常大,最高符号位为1,会使得计算出的结果是一个较大的负值,后续修改 mp->m_fdblocks 会将其变为一个非常大的值,使得 xfs 每次前台写时判断 fdblocks 都是有空间的,但是后台回写会没有空间,导致了告警。

需要修改 xfs_mod_fdblocks 函数,修改有关数据类型。

评论 (1)

Zizhi Wo 创建了任务 4个月前

Hi wozizhi, 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.

登录 后才可以发表评论

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

搜索帮助

371d5123 14472233 46e8bd33 14472233