Ai
13 Star 20 Fork 182

src-openEuler/glibc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-UB-on__dl_map_object_from_fd.patch 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Andy Lau 提交于 2025-07-29 11:13 +08:00 . backport patches from glibc upstream
From e529bfe8dee4bfde3ac74927b5b7b8df65cf3bb0 Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed, 7 May 2025 11:17:29 -0300
Subject: [PATCH] elf: Fix UB on _dl_map_object_from_fd
On 32-bit architecture ubsan triggers:
UBSAN: Undefined behaviour in dl-load.c:1345:54 pointer index expression with base 0x00612508 overflowed to 0xf7c3a508
Use explicit uintptr_t operation instead.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
---
elf/dl-load.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index bf29ec725d..6e26ef0583 100644
@@ -1359,7 +1359,7 @@ cannot enable executable stack as shared object requires");
/* Adjust the address of the TLS initialization image. */
if (l->l_tls_initimage != NULL)
- l->l_tls_initimage = (char *) l->l_tls_initimage + l->l_addr;
+ l->l_tls_initimage = (void*)((uintptr_t)l->l_tls_initimage + l->l_addr);
/* Process program headers again after load segments are mapped in
case processing requires accessing those segments. Scan program
--
2.43.7
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/glibc.git
git@gitee.com:src-openeuler/glibc.git
src-openeuler
glibc
glibc
master

搜索帮助