Closed
[Bug-Report|缺陷反馈]: AscendRequant 输入 shape 校验缺少 rank 前置判断,存在越界读/写风险(质量加固) #8164
renshuojianAdd on 16 days agoClosed at 16 days ago
16 days ago Added label: bug-report
16 days ago Close issue
16 days ago Added label: resolved
8 days ago Assign chenjiayi_ as responsible person
8 days ago changed custom state from 进行中 to 已完成
chenjiayi_
8 days ago Comments:
8 days ago Comments:
补充说明本问题的处理结果:
已修复并合入 master。AscendRequant 增加 rank 前置判断、广播形状校验与元素总数溢出校验。
修复内容(文件/函数):
quant/ascend_requant/op_host/ascend_requant_infershape.cpp:新增ValidateBroadcastShape与ValidateTotalElements,在 infershape 与 tiling 流程拒绝广播放大、输出 shape 偏离 x、rank 越界与元素总数/步长溢出。quant/ascend_requant/op_host/arch35/ascend_requant_tiling_arch35.cpp:分块与步长计算改用__int128累计并透传错误码。quant/ascend_requant/op_kernel/arch35/ascend_requant_kernel.h:同步边界防护。
验证:
- PR 记录 obp、david 冒烟通过。
- UT 新增 119 行覆盖 rank、广播、输出 shape 与溢出边界。
说明:本次修改限于输入校验与边界计算,正常 shape 的计算路径保持原样。
该 issue 已关闭,修复已由 PR !13098 合入 master。
MR 链接:PR#13098


11 hours ago Removed responsible person chenjiayi_
Describe the current behavior / 问题描述 (Mandatory / 必填)
Environment Information / 环境信息 (Mandatory / 必填)
950
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
Describe the expected behavior / 预期结果 (Mandatory / 必填)
infershape、tiling能够有效拦截异常输入。
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
验证ok
Special notes for this issue/备注 (Optional / 选填)