public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: elf: fix pointer provenance of l_tls_initimage
@ 2022-08-05 19:36 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2022-08-05 19:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2b1192cae03642b2cb16f918322f5cddfc54eae2

commit 2b1192cae03642b2cb16f918322f5cddfc54eae2
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Apr 7 17:04:59 2022 +0100

    cheri: elf: fix pointer provenance of l_tls_initimage

Diff:
---
 elf/dl-load.c | 2 +-
 elf/rtld.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1ad0868dad..367b8cdab1 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1369,7 +1369,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 = (ElfW(Addr)) l->l_tls_initimage + (char *) l->l_addr;
 
   /* Process program headers again after load segments are mapped in
      case processing requires accessing those segments.  Scan program
diff --git a/elf/rtld.c b/elf/rtld.c
index 2c61935a21..6ba7b94761 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1274,7 +1274,7 @@ rtld_setup_main_map (struct link_map *main_map)
      the executable is actually an ET_DYN object.  */
   if (main_map->l_tls_initimage != NULL)
     main_map->l_tls_initimage
-      = (char *) main_map->l_tls_initimage + main_map->l_addr;
+      = (ElfW(Addr)) main_map->l_tls_initimage + (char *) main_map->l_addr;
   if (! main_map->l_map_end)
     main_map->l_map_end = ~0;
   if (! main_map->l_text_end)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-05 19:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 19:36 [glibc/arm/morello/main] cheri: elf: fix pointer provenance of l_tls_initimage Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).