]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/glibc-2.38/0014-elf-Do-not-run-constructors-for-proxy-objects.patch
glibc: Import latest patches from upstream
[ipfire-2.x.git] / src / patches / glibc-2.38 / 0014-elf-Do-not-run-constructors-for-proxy-objects.patch
CommitLineData
b9215da1
MT
1From 7ae211a01b085d0bde54bd13b887ce8f9d57c2b4 Mon Sep 17 00:00:00 2001
2From: Florian Weimer <fweimer@redhat.com>
3Date: Tue, 22 Aug 2023 13:56:25 +0200
a61a21ef 4Subject: [PATCH 14/44] elf: Do not run constructors for proxy objects
b9215da1
MT
5
6Otherwise, the ld.so constructor runs for each audit namespace
7and each dlmopen namespace.
8
9(cherry picked from commit f6c8204fd7fabf0cf4162eaf10ccf23258e4d10e)
10---
11 elf/dl-init.c | 8 ++++++--
12 1 file changed, 6 insertions(+), 2 deletions(-)
13
14diff --git a/elf/dl-init.c b/elf/dl-init.c
15index 5b0732590f..ba4d2fdc85 100644
16--- a/elf/dl-init.c
17+++ b/elf/dl-init.c
18@@ -25,10 +25,14 @@
19 static void
20 call_init (struct link_map *l, int argc, char **argv, char **env)
21 {
22+ /* Do not run constructors for proxy objects. */
23+ if (l != l->l_real)
24+ return;
25+
26 /* If the object has not been relocated, this is a bug. The
27 function pointers are invalid in this case. (Executables do not
28- need relocation, and neither do proxy objects.) */
29- assert (l->l_real->l_relocated || l->l_real->l_type == lt_executable);
30+ need relocation.) */
31+ assert (l->l_relocated || l->l_type == lt_executable);
32
33 if (l->l_init_called)
34 /* This object is all done. */
35--
362.39.2
37