glibc/glibc-RHEL-47403-3.patch
Frédéric Bérat 72524e00c3 Prevented ld.so from asserting and crashing during audited library loads.
- Backport: Extend struct r_debug to support multiple namespaces [BZ
  #15971]
- Backport: elf: Include <sysdep.h> in elf/dl-debug-symbols.S
- Backport: Minor: don't call _dl_debug_update (which can have side
  effects) inside assert
- Backport: elf: Run constructors on cyclic recursive dlopen (bug
  31986)
- Backport: elf: Signal LA_ACT_CONSISTENT to auditors after
  RT_CONSISTENT switch
- Backport: elf: Signal RT_CONSISTENT after relocation processing in
  dlopen (bug 31986)
- Backport: Revert "elf: Run constructors on cyclic recursive dlopen
  (bug 31986)"
- Backport: elf: Test dlopen (NULL, RTLD_LAZY) from an ELF constructor
- Backport: elf: Fix map_complete Systemtap probe in dl_open_worker
- Backport: elf: Introduce separate _r_debug_array variable
- Add downstream patch to keep the ABI stable

Resolves: RHEL-47403
2025-07-08 17:06:56 +02:00

33 lines
1.1 KiB
Diff

commit 1b5e65ef6a442fdccf88d43c3048f98292d85631
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Sat Mar 25 21:27:01 2023 +0000
Minor: don't call _dl_debug_update (which can have side effects) inside assert
diff --git a/elf/dl-open.c b/elf/dl-open.c
index eef724f7e9b2211d..0d2b4cd4785a226a 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -596,7 +596,9 @@ dl_open_worker_begin (void *a)
if ((mode & RTLD_GLOBAL) && new->l_global == 0)
add_to_global_update (new);
- assert (_dl_debug_update (args->nsid)->r_state == RT_CONSISTENT);
+ const int r_state __attribute__ ((unused))
+ = _dl_debug_update (args->nsid)->r_state;
+ assert (r_state == RT_CONSISTENT);
return;
}
@@ -916,7 +918,9 @@ no more namespaces available for dlmopen()"));
_dl_signal_exception (errcode, &exception, NULL);
}
- assert (_dl_debug_update (args.nsid)->r_state == RT_CONSISTENT);
+ const int r_state __attribute__ ((unused))
+ = _dl_debug_update (args.nsid)->r_state;
+ assert (r_state == RT_CONSISTENT);
/* Release the lock. */
__rtld_lock_unlock_recursive (GL(dl_load_lock));