代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。