<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc/elf/rtld.c, branch vdso</title>
<subtitle>Fork of glibc for development</subtitle>
<id>https://git.zx2c4.com/glibc/atom/elf/rtld.c?h=vdso</id>
<link rel='self' href='https://git.zx2c4.com/glibc/atom/elf/rtld.c?h=vdso'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/'/>
<updated>2024-08-06T13:26:17Z</updated>
<entry>
<title>rtld: Fix handling of '--' option</title>
<updated>2024-08-06T13:26:17Z</updated>
<author>
<name>Henrik Lindström</name>
<email>henrik@lxm.se</email>
</author>
<published>2024-07-26T10:33:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=2227195794f96c7bf583e9ea4fb929cbedf1d8a1'/>
<id>urn:sha1:2227195794f96c7bf583e9ea4fb929cbedf1d8a1</id>
<content type='text'>
It always resulted in the error `unrecognized option '--'` previously.
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>elf: Clarify and invert second argument of _dl_allocate_tls_init</title>
<updated>2024-08-05T16:26:42Z</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2024-08-01T21:31:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=fe06fb313bddf7e4530056897d4a706606e49377'/>
<id>urn:sha1:fe06fb313bddf7e4530056897d4a706606e49377</id>
<content type='text'>
Also remove an outdated comment: _dl_allocate_tls_init is
called as part of pthread_create.

Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</content>
</entry>
<entry>
<title>elf/rtld: Fix auxiliary vector for enable_secure</title>
<updated>2024-07-03T11:01:44Z</updated>
<author>
<name>Stefan Liebler</name>
<email>stli@linux.ibm.com</email>
</author>
<published>2024-07-02T13:25:20Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=d2f6ceaccbae2f645075dedad2b762896da1ec04'/>
<id>urn:sha1:d2f6ceaccbae2f645075dedad2b762896da1ec04</id>
<content type='text'>
Starting with commit
59974938fe1f4add843f5325f78e2a7ccd8db853
elf/rtld: Count skipped environment variables for enable_secure

The new testcase elf/tst-tunables-enable_secure-env segfaults on s390 (31bit).
There _start parses the auxiliary vector for some additional checks.

Therefore it skips over the zeros after the environment variables ...
0x7fffac20:     0x7fffbd17      0x7fffbd32      0x7fffbd69      0x00000000
------------------------------------------------^^^last environment variable

... and then it parses the auxiliary vector and stops at AT_NULL.
0x7fffac30:     0x00000000      0x00000021      0x00000000      0x00000000
--------------------------------^^^AT_SYSINFO_EHDR--------------^^^AT_NULL
----------------^^^newp-----------------------------------------^^^oldp
Afterwards it tries to access AT_PHDR which points to somewhere and segfaults.

Due to not incorporating the skip_env variable in the computation of oldp
when shuffling down the auxv in rtld.c, it just copies one entry with AT_NULL
and value 0x00000021 and stops the loop.  In reality we have skipped
GLIBC_TUNABLES environment variable (=&gt; skip_env=1). Thus we should copy from
here:
0x7fffac40:     0x00000021      0x7ffff000      0x00000010      0x007fffff
----------------^^^fixed-oldp

This patch fixes the computation of oldp when shuffling down auxiliary vector.
It also adds some checks in the testcase.  Those checks also fail on
s390x (64bit) and x86_64 without the fix.

Co-authored-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>elf: Support recursive use of dynamic TLS in interposed malloc</title>
<updated>2024-07-01T17:02:11Z</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2024-07-01T15:42:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=018f0fc3b818d4d1460a4e2384c24802504b1d20'/>
<id>urn:sha1:018f0fc3b818d4d1460a4e2384c24802504b1d20</id>
<content type='text'>
It turns out that quite a few applications use bundled mallocs that
have been built to use global-dynamic TLS (instead of the recommended
initial-exec TLS).  The previous workaround from
commit afe42e935b3ee97bac9a7064157587777259c60e ("elf: Avoid some
free (NULL) calls in _dl_update_slotinfo") does not fix all
encountered cases unfortunatelly.

This change avoids the TLS generation update for recursive use
of TLS from a malloc that was called during a TLS update.  This
is possible because an interposed malloc has a fixed module ID and
TLS slot.  (It cannot be unloaded.)  If an initially-loaded module ID
is encountered in __tls_get_addr and the dynamic linker is already
in the middle of a TLS update, use the outdated DTV, thus avoiding
another call into malloc.  It's still necessary to update the
DTV to the most recent generation, to get out of the slow path,
which is why the check for recursion is needed.

The bookkeeping is done using a global counter instead of per-thread
flag because TLS access in the dynamic linker is tricky.

All this will go away once the dynamic linker stops using malloc
for TLS, likely as part of a change that pre-allocates all TLS
during pthread_create/dlopen.

Fixes commit d2123d68275acc0f061e73d5f86ca504e0d5a344 ("elf: Fix slow
tls access after dlopen [BZ #19924]").

Reviewed-by: Szabolcs Nagy &lt;szabolcs.nagy@arm.com&gt;
</content>
</entry>
<entry>
<title>Revert "Allow glibc to be compiled without EXEC_PAGESIZE"</title>
<updated>2024-04-22T21:00:18Z</updated>
<author>
<name>Samuel Thibault</name>
<email>samuel.thibault@ens-lyon.org</email>
</author>
<published>2024-04-22T21:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=16c8dfba14ff7596ad3aea941a240f8abcdc50e6'/>
<id>urn:sha1:16c8dfba14ff7596ad3aea941a240f8abcdc50e6</id>
<content type='text'>
This reverts commit 49aa652db810ebdca3a662ebd5b0468bd08ec688.

This is still being discussed.
</content>
</entry>
<entry>
<title>elf/rtld: Count skipped environment variables for enable_secure</title>
<updated>2024-04-16T20:32:10Z</updated>
<author>
<name>Joe Simmons-Talbott</name>
<email>josimmon@redhat.com</email>
</author>
<published>2024-04-16T20:31:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=59974938fe1f4add843f5325f78e2a7ccd8db853'/>
<id>urn:sha1:59974938fe1f4add843f5325f78e2a7ccd8db853</id>
<content type='text'>
When using the glibc.rtld.enable_secure tunable we need to keep track of
the count of environment variables we skip due to __libc_enable_secure
being set and adjust the auxv section of the stack.  This fixes an
assertion when running ld.so directly with glibc.rtld.enable_secure set.
Add a testcase that ensures the assert is not hit.

elf/rtld.c:1324   assert (auxv == sp + 1);

Reviewed-by: Adhemerval Zanella  &lt;adhemerval.zanella@linaro.org&gt;
</content>
</entry>
<entry>
<title>Allow glibc to be compiled without EXEC_PAGESIZE</title>
<updated>2024-03-23T21:47:26Z</updated>
<author>
<name>Sergey Bugaev</name>
<email>bugaevc@gmail.com</email>
</author>
<published>2024-03-23T17:32:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=49aa652db810ebdca3a662ebd5b0468bd08ec688'/>
<id>urn:sha1:49aa652db810ebdca3a662ebd5b0468bd08ec688</id>
<content type='text'>
We would like to avoid statically defining any specific page size on
aarch64-gnu, and instead make sure that everything uses the dynamic
page size, available via vm_page_size and GLRO(dl_pagesize).

There are currently a few places in glibc that require EXEC_PAGESIZE
to be defined. Per Roland's suggestion [0], drop the static
GLRO(dl_pagesize) initializers (for now, only if EXEC_PAGESIZE is not
defined), and don't require EXEC_PAGESIZE definition for libio to
enable mmap usage.

[0]: https://mail.gnu.org/archive/html/bug-hurd/2011-10/msg00035.html

Signed-off-by: Sergey Bugaev &lt;bugaevc@gmail.com&gt;
Message-ID: &lt;20240323173301.151066-4-bugaevc@gmail.com&gt;
</content>
</entry>
<entry>
<title>elf: correct relocation statistics for !ELF_MACHINE_START_ADDRESS</title>
<updated>2024-01-29T17:27:35Z</updated>
<author>
<name>Andreas Schwab</name>
<email>schwab@suse.de</email>
</author>
<published>2024-01-29T16:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=9c72830eb3e12c1d57ac7d1992c96ee69ccd835d'/>
<id>urn:sha1:9c72830eb3e12c1d57ac7d1992c96ee69ccd835d</id>
<content type='text'>
Fixes: 6628c742b2 ("elf: Remove prelink support")
</content>
</entry>
<entry>
<title>Update copyright dates with scripts/update-copyrights</title>
<updated>2024-01-01T18:53:40Z</updated>
<author>
<name>Paul Eggert</name>
<email>eggert@cs.ucla.edu</email>
</author>
<published>2024-01-01T18:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307'/>
<id>urn:sha1:dff8da6b3e89b986bb7f6b1ec18cf65d5972e307</id>
<content type='text'>
</content>
</entry>
<entry>
<title>elf: Initialize GLRO(dl_lazy) before relocating libc in dynamic startup</title>
<updated>2023-12-08T13:33:03Z</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2023-12-08T08:51:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=b3bee76c5f59498b9c189608f0a3132e2013fa1a'/>
<id>urn:sha1:b3bee76c5f59498b9c189608f0a3132e2013fa1a</id>
<content type='text'>
GLRO(dl_lazy) is used to set the parameters for the early
_dl_relocate_object call, so the consider_profiling setting has to
be applied before the call.

Fixes commit 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate
libc.so early during startup and dlmopen (bug 31083)").

Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</content>
</entry>
</feed>
