99 Star 56 Fork 226

src-openEuler / kernel

 / 详情

主线补丁回合:evm: Check also if *tfm is an error pointer in init_desc()

已完成
任务
创建于  
2023-01-12 19:52

回合 53de3b080d5e ("evm: Check also if *tfm is an error pointer in init_desc()"),以及其后续修补补丁:843385694721 ("evm: Fix a small race in init_desc()")

  1. 53de3b080d5e ("evm: Check also if *tfm is an error pointer in init_desc()")
    修补一种在多线程场景下可能的竞争状态:
    Task A                                          | Task B
    *tfm = crypto_alloc_shash() /* error pointer */ | 
                                                    | if (*tfm == NULL) // *tfm is not NULL, use it
                                                    | rc = crypto_shash_init(desc) // panic
    *tfm = NULL                                     |
    
    为此,使用 IS_ERR_OR_NULL(*tfm) 替代 *tfm == NULL
  2. 843385694721 ("evm: Fix a small race in init_desc()")
    在极端条件下,即便使用了 IS_ERR_OR_NULL() 也会出现竞争状态:其内部会针对 error pointer 和 NULL 做两次判断,而竞争状态可能出现在两次判断之间。

评论 (1)

Raverstern 创建了任务

Hi raverstern, 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: @Xie XiuQi , @YangYingliang , @成坚 (CHENG Jian) , @jiaoff , @AlexGuo , @hanjun-guo , @woqidaideshi , @zhengzengkai , @Jackie Liu , @Zhang Yi , @colyli , @ThunderTown , @htforge , @Chiqijun , @冷嘲啊 , @zhujianwei001 , @kylin-mayukun , @wangxiongfeng , @Kefeng , @SuperSix173 , @WangShaoBo , @Zheng Zucheng , @陈结松 , @刘恺 , @whoisxxx , @wuxu_buque , @koulihong , @柳歆 , @朱科潜 , @Xu Kuohai , @Lingmingqiang , @juntian , @OSSIM , @郑振鹏 , @刘勇强 , @yuzenghui , @Qiuuuuu , @xiehaocheng , @chen wei , @CTC-Xibo.Wang , @Jason Zeng , @Yuehaibing , @guzitao , @zhanghongchen , @lujialin , @苟浩 , @georgeguo , @毛泓博 , @AllenShi , @DuanqiangWen

openeuler-ci-bot 添加了
 
sig/Kernel
标签
Raverstern 修改了描述
Raverstern 修改了描述
Raverstern 修改了描述
Qiuuuuu 通过src-openeuler/kernel Pull Request !946任务状态待办的 修改为已完成

登录 后才可以发表评论

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

搜索帮助