已开启
CVE-2026-46033 修复补丁回合4.19/4.18引入UAF问题修复 #9817
ecronic创建于  11 天前
ecronic
ecronic
11 天前 创建

【缺陷描述】:请补充详细的缺陷问题现象描述

CVE-2026-46033 修复补丁回合4.19存在补丁冲突,AI 生成解冲突补丁:
51c8d538230b crypto: authencesn - reject short ahash digests during instance creation
后续未检视出补丁存在缺陷,合入4.19内核,检视发现回合补丁存在资源泄露和UAF风险,需修复

一、缺陷信息

5.10 的正常错误流程(安全)

当 digestsize ∈ {1,2,3} 时,5.10 执行路径:

crypto_authenc_esn_create()
  │
  ├─ crypto_grab_ahash(&ctx->auth, ...)          [ahash spawn 初始化并链入 cra_users]
  │   成功
  ├─ auth = crypto_spawn_ahash_alg(&ctx->auth)
  │
  ├─ if (auth->digestsize > 0 && auth->digestsize < 4)   [新增校验,命中]
  │     err = -EINVAL
  │     goto err_free_inst
  │
  └─ err_free_inst:
       crypto_authenc_esn_free(inst)              [全套清理]
         ├─ crypto_drop_skcipher(&ctx->enc)       [skcipher 未初始化, spawn->alg=NULL, 安全跳过]
         ├─ crypto_drop_ahash(&ctx->auth)         [摘除 ahash spawn: list_del]  ★ 正确清理
         └─ kfree(inst)                           [释放 inst]

crypto_authenc_esn_free 内含 crypto_drop_ahash,所以 ahash spawn 被正确
摘除后再 kfreecrypto_drop_spawn 内部检查 spawn->alg,未初始化的 skcipher
spawn 的 alg 为 NULL,crypto_drop_spawn 直接 return(algapi.c:704),安全。

5.10 之所以安全err_free_inst 标签背后的 crypto_authenc_esn_free
全套清理函数,不依赖标签层级,任何错误点 goto err_free_inst 都能正确清理
所有已初始化的资源。

4.19 的异常错误流程(UAF)

同样的 digestsize ∈ {1,2,3},4.19 执行路径:

crypto_authenc_esn_create()
  │
  ├─ auth = ahash_attr_alg(tb[1], ...)            [查找 cbcmac(cipher_null)]
  │   成功, auth->digestsize = 1
  │
  ├─ inst = kzalloc(...)                          [分配 inst]
  │
  ├─ crypto_init_ahash_spawn(&ctx->auth, auth, inst)
  │   │
  │   └─ crypto_init_spawn()                      [algapi.c:649]
  │       ├─ spawn->inst = inst
  │       ├─ spawn->alg = alg                     [指向 cbcmac(cipher_null)]
  │       └─ list_add(&spawn->list, &alg->cra_users)
  │                                         ★ spawn 节点链入 ahash 的 cra_users
  │   成功
  │
  ├─ crypto_set_skcipher_spawn(&ctx->enc, ...)    [仅设置 inst 指针, 未链入]
  │
  ├─ if (auth->digestsize > 0 && auth->digestsize < 4)   [新增校验, 1>0 && 1<4 命中]
  │     err = -EINVAL
  │     goto err_free_inst                        ★ 越过 err_drop_auth
  │
  └─ err_free_inst:                               [4.19: 仅 kfree]
       kfree(inst)                                [释放 inst, 含 ctx->auth spawn 节点]
                                                   ★ spawn 仍挂在 cra_users → 悬垂指针

  // 此后 ahash (cbcmac(cipher_null)) 的 cra_users 链表中有一个指向已释放内存的节点

4.19 之所以缺陷err_free_inst 标签仅执行 kfree(inst),不摘除 spawn。
ahash spawn 已在 crypto_init_ahash_spawn 中链入 cra_users,必须经
err_drop_authcrypto_drop_ahashcrypto_drop_spawnlist_del)摘除后
才能 kfree。跳过 err_drop_auth 导致:

  1. spawn 的 list 节点仍挂在 cbcmac(cipher_null)->cra_users 链表
  2. kfree(inst) 释放了 spawn 所在的内存(spawn 是 inst 内联的 ctx->auth.base
  3. 遍历 cra_users 时取到已释放的 spawn 节点 → UAF

【缺陷所属的os版本】

openEuler-1.0-LTS

【内核版本】

【缺陷所属软件及版本号】

openEuler-1.0-LTS

【环境信息】

硬件信息

  • 提供跟硬件相关的信息,如架构、cpu和内存规格等
  • 虚拟机场景,额外补充宿主机os版本类型

软件信息

  • 跟缺陷所属软件相关的其它软件版本信息(如软件包构建失败由gcc引起,请填写gcc的版本号)

网络信息

  • 如果有特殊组网,请提供网络拓扑信息以及网络数据走向

【问题复现步骤】

【实际结果】

【期望结果】

【其他相关附件信息】

【缺陷详情及分析指导参考链接】

二、缺陷分析结构反馈
影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

修复是否涉及abi变化(是/否):
openEuler-20.03-LTS-SP4
openEuler-22.03-LTS-SP3
openEuler-22.03-LTS-SP4
openEuler-24.03-LTS
openEuler-24.03-LTS-SP1
openEuler-24.03-LTS-SP2

likedislike
openeuler-ci-botopeneuler-ci-bot成员
11 天前 将 allen-shi 设为负责人
openeuler-ci-botopeneuler-ci-bot成员
11 天前 添加了label:sig/Kernel
openeuler-ci-botopeneuler-ci-bot成员
11 天前 修改了issue 的描述
openeuler-ci-bot
openeuler-ci-bot成员
11 天前 评论:

Welcome To openEuler Community

Hey @gaoshengcui , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: Kernel ,
and any of the maintainers: @hanjunguo, @oekernel, @sanglipeng, @wkfxxx, @zeng_zhaorong ,
and any of the committers: @CTC-XiboWang, @Frank_Sae, @GoGo_phytium, @GongLei-, @LiuYongQiang0816, @SuperSix173, @Tankll2021, @TrueAI, @YiweiZ, @allen-shi, @alvin-ling, @baratta, @bibo_mao, @caixu-blue, @chen-jun-hw, @chenjiesong, @chenjunxin1992, @chenke2026, @chiqijun, @chriszjh, @duanqiangwen, @eingesch, @fangfeng123, @fanghaiqinghw, @gang_he, @gaojuxin09, @gouhao2022, @guohaocs2c, @guzitao, @hanjunguo, @hanliyang, @hellotcc, @henryze, @hewanhan, @hjx_gitff, @hongwu-wang, @htforge, @hu-chunzhi, @hunan4222, @jackknight, @jerry_lilijun, @jiayi0118, @junlong-zheng, @juntianlinux, @kailiu42, @kaitiandu, @kazero00, @kevinzhu1, @kile2009, @klmengkd, @koishimind, @kongzizaixian, @kylin-mayukun, @leoliu-oc, @li-huisong, @linan888, @linyunsheng, @liulongfang, @liyihang0226, @lostway1, @lujialin2, @mao-hongbo, @markyuan4ta21, @mawupeng, @mingqian218472, @mingrui-liu, @mufengyan, @pigalsofine, @robinorg, @rock_hw, @sanglipeng, @shu-shengming, @shuaijiakun, @sming56_admin, @stavewu, @stkid, @sun_nanyong, @wangboe2022, @wanghang73, @wenzhiwei11, @whoisxxx, @wkfxxx, @woqidaideshi, @wsoydl, @xingmz1, @xukuohai, @yeweihua999, @ygn-ndwd-official, @yonghu_4dc5, @young-sun, @yubo-liu1, @yuehaibing_planb, @yuzenghui1, @zhang-changzhong, @zhangyi089, @zhujianwei001, @zichengqu, @zouyipeng, @zqiao216 .

likedislike
openeuler-ci-bot
openeuler-ci-bot成员
11 天前 评论:

以下的要求不是强制性的, 未按模板评论时对issue无任何影响
issue处理注意事项:
1. 当前issue受影响的分支提交pr时, 须在pr描述中填写当前issue编号进行关联, 否则无法关闭当前issue;
2. 模板内容需要填写完整, 无论是受影响或者不受影响都需要填写完整内容,未引入的分支不需要填写, 否则无法关闭当前issue;
3. 以下为模板中需要填写完整的内容, 请复制到评论区回复, 注: 内容的标题名称(影响性分析说明, 缺陷严重等级, 受影响版本排查(受影响/不受影响), 修复是否涉及abi变化(是/否))不能省略,省略后defect-manager将无法正常解析填写内容.
评论区可能使用到的指令说明:

指令 指令说明 使用权限
/check-issue 触发defect-manager校验 不限
/reason xxx /reason +挂起或取消条件 不限

影响性分析说明:

缺陷严重等级:(Critical/High/Moderate/Low)

缺陷根因说明:

受影响版本排查(受影响/不受影响):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

abi变化(是/否):

  1. openEuler-20.03-LTS-SP4:
  2. openEuler-22.03-LTS-SP3:
  3. openEuler-22.03-LTS-SP4:
  4. openEuler-24.03-LTS:
  5. openEuler-24.03-LTS-SP1:
  6. openEuler-24.03-LTS-SP2:

缺陷issue处理具体操作请参考:
https://atomgit.com/openeuler/cve-manager/blob/master/cve-vulner-manager/doc/md/defect-manager-manual.md
pr关联issue具体操作请参考:
https://docs.atomgit.com/docs/help/home/org_project/pullrequests/pr-related-issue

likedislike
openeuler-ci-botopeneuler-ci-bot成员
11 天前 添加了label:DEFECT/UNFIXED
Oopeneuler-infra-bot成员
11 天前 关联了pull request: crypto: authencesn - fix spawn leak in digestsize check error path
Oopeneuler-infra-bot成员
10 天前 关联了pull request: crypto: authencesn - fix spawn leak in digestsize check error path
Oopeneuler-infra-bot成员
10 天前 关联了pull request: crypto: authencesn - fix spawn leak in digestsize check error path