已合并
perf越界写入 #1354
perf越界写入 #1354
已合并
yang-pangyuan创建于 4月9日
yang-pangyuan成员
4月9日

相关的Issue

https://gitcode.com/openharmony/kernel_liteos_a/issues/1064

原因(目的、解决的问题等)

攻击者通过控制文件路径长度来触发越界写入,在OsGetUsrIpInfo函数中,路径长度信息info->len保存的是实际字符串长度(可能远大于32),但在strncpy_s复制时只复制固定32字节的缓冲区,后续的OsPerfSaveIpInfo函数使用对齐后的长度进行计算,导致写入偏移计算错误。 写入数据的偏移已经超出了原始的PerfSampleData.PerfBackTrace偏移,当按照此偏移继续保存数据时就会造成越界写,超出栈变量PerfSampleData data边界,造成缓冲区溢出

描述(做了什么,变更了什么)

修复info->len

测试用例(新增、改动、可能影响的功能)

BA

是否涉及对外变更(典型的如:对外API规格变更、新增对外接口等等)

否,不涉及对外变更

是否需要同步至release(如:3.0LTS ... )分支?

likedislike
Pull Request已成功合入, 合并人@openharmony_ci
(感谢 yang-pangyuan 的贡献)
Yyang-pangyuan成员
4月9日 关联了issue:【漏洞】 【master】 vul-1051589864585170944
Yyang-pangyuan成员
4月9日 修改标题为 “perf越界写入漏洞”,原标题为“IssueNo: perf越界写入漏洞”
yang-pangyuan成员
4月9日 评论:

start build

likedislike
openharmony_ciopenharmony_ci成员
4月9日 添加了label:waiting_on_author
openharmony_ci
openharmony_ci成员
4月9日 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ciopenharmony_ci成员
4月9日 添加了label:dco检查成功
openharmony_ci
openharmony_ci成员
4月9日 评论:

首次触发
门禁构建开始,包含静态检查、代码编译和测试【hispark_taurus_LiteOS测试, master_inner_build编译, hispark_taurus_LiteOS编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/69d7576064650f998b8051ec/runlist

likedislike
openharmony_ciopenharmony_ci成员
4月9日 添加了label:编译失败
openharmony_ciopenharmony_ci成员
4月9日 添加了label:静态检查成功
openharmony_ciopenharmony_ci成员
4月9日 添加了label:冒烟测试失败
openharmony_ci
openharmony_ci成员
4月9日 评论:

代码门禁未通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/69d7576064650f998b8051ec/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result package
1 hispark_taurus_LiteOS failed(compile failed) >>>
2 master_inner_build success(IGNORE) >>>

likedislike
Yyang-pangyuan成员
4月10日 推送  1 个提交:26585476-IssueNo: https://gitcode.com/openharmony/kernel_liteos_a/issues/1063
openharmony_ciopenharmony_ci成员
4月10日 删除了label:静态检查成功
openharmony_ciopenharmony_ci成员
4月10日 删除了label:编译失败
openharmony_ciopenharmony_ci成员
4月10日 删除了label:冒烟测试失败
openharmony_ci
openharmony_ci成员
4月10日 评论:

代码有更新,重置PR验证状态

likedislike
yang-pangyuan成员
4月10日 评论:

start build

likedislike
openharmony_ci
openharmony_ci成员
4月10日 评论:

感谢提交 Pull Requests!如果您提交的PR已经开发完毕,请评论 "start build" 触发门禁,更多交互操作,请访问OpenHarmony社区支持命令清单。如果需要调整订阅PR、Issue的变更状态,请访问订阅链接


Thanks for submitting the pull request. If your Pull Request has already been developed, you can leave a "start build" comment to trigger the gated system. For more commands, please visit OpenHarmony Command List. If you need to change the subscription of a Pull Request or Issue, please visit the link.

likedislike
openharmony_ci
openharmony_ci成员
4月10日 评论:

本地或库上代码有更新,全量重新构建,重置所有关联PR的验证状态
门禁构建开始,包含静态检查、代码编译和测试【hispark_taurus_LiteOS测试, hispark_taurus_LiteOS编译, master_inner_build编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/69d85e6664650f998baa185c/runlist

likedislike
openharmony_ciopenharmony_ci成员
4月10日 添加了label:编译成功
openharmony_ciopenharmony_ci成员
4月10日 添加了label:静态检查成功
openharmony_ciopenharmony_ci成员
4月10日 添加了label:冒烟测试成功
openharmony_ciopenharmony_ci成员
4月10日 通过测试
openharmony_ci
openharmony_ci成员
4月10日 评论:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/69d85e6664650f998baa185c/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result test result package
1 hispark_taurus_LiteOS success success >>>
2 master_inner_build success(IGNORE) NA >>>

likedislike
openharmony_ciopenharmony_ci成员
4月10日 删除了label:waiting_on_author
openharmony_ciopenharmony_ci成员
4月10日 添加了label:waiting_for_review
openharmony_ci
openharmony_ci成员
4月10日 评论:

您好,Committer @JerryH1011 @LeonChan525 @zhu-sheng-le ,请分配检视人员检视该PR,可以通过命令"assign [@someone_id]"分配检视人员,也可以直接评论"assign"分配给自己进行检视。


Hello, Committer @JerryH1011 @LeonChan525 @zhu-sheng-le . Please assign someone to review the PR. You can assign a reviewer by using the command "assign [@someone_id]", or you can comment "assign" to review the PR by yourself.

likedislike
Zzhu-sheng-le成员
5月6日 通过审查
openharmony_ci
openharmony_ci成员
5月6日 评论:

验证结果已超过12小时,之前验证结果无效,自动重新触发构建,请关注最新验证结果

likedislike
openharmony_ci
openharmony_ci成员
5月6日 评论:

start build

likedislike
openharmony_ciopenharmony_ci成员
5月6日 删除了label:编译成功
openharmony_ciopenharmony_ci成员
5月6日 删除了label:静态检查成功
openharmony_ciopenharmony_ci成员
5月6日 删除了label:冒烟测试成功
openharmony_ci
openharmony_ci成员
5月6日 评论:

上次构建已超过12小时,重新全量验证,重置所有关联PR的验证状态
门禁构建开始,包含静态检查、代码编译和测试【hispark_taurus_LiteOS测试, hispark_taurus_LiteOS编译, master_inner_build编译】,预计在60分钟内完成,门禁结果会同步发送到注册邮箱。您可以通过如下链接跟踪门禁进展:http://dcp.openharmony.cn/workbench/cicd/detail/69faf75664650f998b32c38d/runlist

likedislike
openharmony_ciopenharmony_ci成员
5月6日 添加了label:编译成功
openharmony_ciopenharmony_ci成员
5月6日 添加了label:静态检查成功
openharmony_ciopenharmony_ci成员
5月6日 添加了label:冒烟测试成功
openharmony_ciopenharmony_ci成员
5月6日 通过测试
openharmony_ci
openharmony_ci成员
5月6日 评论:

代码门禁通过
您可以通过如下链接查看门禁报告:http://dcp.openharmony.cn/workbench/cicd/detail/69faf75664650f998b32c38d/runlist

静态检查:

# check type result report
1 codeCheck pass >>>

编译测试:
# Device build result test result package
1 hispark_taurus_LiteOS success success >>>
2 master_inner_build success(IGNORE) NA >>>

likedislike
openharmony_ci
openharmony_ci成员
5月6日 评论:

您好,Committer @JerryH1011 @LeonChan525 @zhu-sheng-le ,请分配检视人员检视该PR,可以通过命令"assign [@someone_id]"分配检视人员,也可以直接评论"assign"分配给自己进行检视。


Hello, Committer @JerryH1011 @LeonChan525 @zhu-sheng-le . Please assign someone to review the PR. You can assign a reviewer by using the command "assign [@someone_id]", or you can comment "assign" to review the PR by yourself.

likedislike
openharmony_ciopenharmony_ci成员
5月6日 合入了pull request,合并节点 SHA:cc8f4f52b08993437c7d104d8a3cccd129db076d
openharmony_ciopenharmony_ci成员
5月6日 删除了label:waiting_for_review
openharmony_ciopenharmony_ci成员
5月6日 添加了label:merged
Yyang-pangyuan成员
6月4日 修改标题为 “perf越界写入”,原标题为“perf越界写入漏洞”
OOpenHarmony_CMO成员
6月17日 修改了pull request 的描述