已开启
libbpf: validate ELF symbol table entry size (backport 6c8e5e7) #242
libbpf: validate ELF symbol table entry size (backport 6c8e5e7) #242
已开启
Lei-Chen创建于 3 天前
Lei-Chen
3 天前

当前PR是否有AI参与:

[] 否
[x] 是
__1. Agent平台信息: opencode v2.2.2
__2. 模型信息: zai-org/GLM-5.2-FP8
__3. Prompt摘要: 使用 openEuler 漏洞回移技能,为 libbpf 回移上游 ELF 符号表 sh_entsize 零值校验修复,完成复现、补丁、spec 修改与验证

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

elf_find_func_offset() 用 symbols->d_size / sh.sh_entsize 计算符号数量,未校验 sh_entsize 非零。畸形 ELF 的 .symtab 段将 sh_entsize 设为 0 时,uprobe/uretprobe 目标符号解析路径触发除零(SIGFPE)。本 PR 回移上游 6c8e5e7d981b45619eccd22d895cec3c6afe3418,在除法前拒绝零 sh_entsize,新增 backport-libbpf-Validate-ELF-symbol-table-entry-size.patch,Release +1。

该PR关联的 issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #52

希望检视人员了解:

本修复为上游对应修复的同步回移,AI 仅辅助编写与验证;已人工逐行核对逻辑,并完成以下验证:

  • 25 个现有补丁 + 新补丁全部 applied OK;新补丁 patch -F0 零 fuzz,目标文件 blob 与预期一致;
  • 补丁链构建通过;
  • PoC:普通目标文件符号解析返回偏移;将 .symtab 的 sh_entsize 改为 0 后,修复前 ASan 报 FPE(elf_find_func_offset),修复后返回 -LIBBPF_ERRNO__FORMAT,不再崩溃。

上游提交链接见 issue #52。该缺陷上游未分配 CVE。

likedislike
合并受阻
LLei-Chen
3 天前 创建了 pull request,commit 39b46ca3
LLei-Chen
3 天前 关联了issue:libbpf: ELF .symtab sh_entsize=0 导致 elf_find_func_offset() 除零(待 backport 上游 6c8e5e7)
openeuler-ci-botopeneuler-ci-bot成员
3 天前 将yalogr,MrRlu,weiyj__lk,happyseeker,wonleing设为审查人
openeuler-ci-botopeneuler-ci-bot成员
3 天前 添加了label:sig/sig-ebpf
openeuler-ci-bot
openeuler-ci-bot成员
3 天前 评论:

Welcome To openEuler Community

Hey @hello-leichen , 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: sig-ebpf ,
and any of the maintainers: @MrRlu, @happyseeker, @weiyj__lk, @wonleing, @yalogr ,
and any of the committers: @LemmyHuang, @bitcoffee, @linford-wu, @perfectwcy, @supercharge1 .

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

当前仓库存在以下 保护分支 :

Protected Branch Version Release
master 1.2.2 17
openEuler-24.03-LTS-Next 1.2.2 17
openEuler-24.03-LTS-SP1 1.2.2 17
openEuler-24.03-LTS-SP4 1.2.2 17
openEuler-26.09-DevStation 1.2.2 17
openEuler-24.03-LTS-SP3 1.2.2 17
openEuler-26.09 1.2.2 15
openEuler-22.03-LTS-SP4 0.8.1 21
openEuler-20.03-LTS-SP4 0.3 6
revert-mr-231-1791612878441-auto 1.2.2 15
revert-mr-231-1791612822883-auto 1.2.2 15
revert-merge-70-openEuler-23.03 0.8.1 4

评论 /sync <branch1> <branch2> ... 可将当前 PR 修改同步到其它分支(创建同步 PR):
a) 如果当前 PR 是 Open 状态,同步操作将延迟到 PR 被合并时执行
b) 如果当前 PR 已经 Merged,将立即执行同步操作

注意:

  1. /sync 命令可以指定同步到多个分支,仅最后一个 /sync 命令生效
  2. 如果创建的同步 PR 不正确,可通过向同步 PR 的源分支提交轻量级 PR 完善,或使用 /close 命令关闭
likedislike
openeuler-ci-botopeneuler-ci-bot成员
3 天前 添加了label:ai-co-authored
openeuler-ci-botopeneuler-ci-bot成员
3 天前 添加了label:openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-bot成员
3 天前 评论:

CLA Signature Pass

hello-leichen, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
openeuler-ci-botopeneuler-ci-bot成员
3 天前 添加了label:ai-includes-code
openeuler-ci-botopeneuler-ci-bot成员
3 天前 添加了label:ai-compliance-successful
openeuler-bot
openeuler-bot成员
3 天前 评论:

门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/src-openeuler/trigger/libbpf/55

likedislike
openeuler-botopeneuler-bot成员
3 天前 添加了label:ci_processing
openeuler-bot
openeuler-bot成员
3 天前 评论:

x86_64架构构建及构建后检查:multiarch/src-openeuler/x86-64/libbpf/55

likedislike
openeuler-bot
openeuler-bot成员
3 天前 评论:

aarch64架构构建及构建后检查:multiarch/src-openeuler/aarch64/libbpf/55

likedislike
openeuler-botopeneuler-bot成员
3 天前 删除了label:ci_processing
openeuler-bot
openeuler-bot成员
3 天前 评论:
Check Name Build Result 详情 Build Details
check_binary_file ✅SUCCESS #55
check_lfsconfig ☑EXCLUDE
check_package_yaml_file ✅SUCCESS
check_repo_in_maintain ✅SUCCESS
check_consistency ✅SUCCESS
check_spec_file ✅SUCCESS
x86_64 check_build ✅SUCCESS #55
check_install ✅SUCCESS
check_license ✅SUCCESS
aarch64 check_build ✅SUCCESS #55
check_install ✅SUCCESS
check_license ✅SUCCESS
likedislike
openeuler-botopeneuler-bot成员
3 天前 添加了label:ci_successful
openeuler-bot
openeuler-bot成员
3 天前 评论:

如下为接口变更检查结果,目标分支为openEuler-26.09,请PR提交者check差异信息

Arch Name Check Items Rpm Name Check Result Build Details
compare_package(x86_64) add_rpms ✅SUCCESS #55
delete_rpms ✅SUCCESS
rpm_abi ✅SUCCESS
rpm_files ✅SUCCESS
rpm_header ✅SUCCESS
rpm_lib ✅SUCCESS
rpm_provides ✅SUCCESS
rpm_requires ✅SUCCESS
rpm_symbol ✅SUCCESS
compare_package(aarch64) add_rpms ✅SUCCESS #55
delete_rpms ✅SUCCESS
rpm_abi ✅SUCCESS
rpm_files ✅SUCCESS
rpm_header ✅SUCCESS
rpm_lib ✅SUCCESS
rpm_provides ✅SUCCESS
rpm_requires ✅SUCCESS
rpm_symbol ✅SUCCESS
likedislike
openeuler-bot
openeuler-bot成员
3 天前 评论:
likedislike