]> sourceware.org Git - glibc.git/commit
elf: Signal RT_CONSISTENT after relocation processing in dlopen (bug 31986)
authorFlorian Weimer <fweimer@redhat.com>
Fri, 25 Oct 2024 14:50:10 +0000 (16:50 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 25 Oct 2024 14:54:22 +0000 (16:54 +0200)
commit43db5e2c0672cae7edea7c9685b22317eae25471
tree63a58a46a7b000bdedd3716ed7ae4d53162d6501
parente096b7a1896886eb7dd2732ccbf1184b0eec9a63
elf: Signal RT_CONSISTENT after relocation processing in dlopen (bug 31986)

Previously, a la_activity audit event was generated before
relocation processing completed.  This does did not match what
happened during initial startup in elf/rtld.c (towards the end
of dl_main).  It also caused various problems if an auditor
tried to open the same shared object again using dlmopen:
If it was the directly loaded object, it had a search scope
associated with it, so the early exit in dl_open_worker_begin
was taken even though the object was unrelocated.  This caused
the r_state == RT_CONSISTENT assert to fail.  Avoidance of the
assert also depends on reversing the order of r_state update
and auditor event (already implemented in a previous commit).

At the later point, args->map can be NULL due to failure,
so use the assigned namespace ID instead if that is available.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
elf/Makefile
elf/dl-open.c
elf/tst-dlopen-auditdup-auditmod.c [new file with mode: 0644]
elf/tst-dlopen-auditdup.c [new file with mode: 0644]
elf/tst-dlopen-auditdupmod.c [new file with mode: 0644]
This page took 0.040337 seconds and 5 git commands to generate.