about summary refs log tree commit diff
path: root/elf/tst-auditmod25.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* S390: Fix elf/tst-audit25[ab]Stefan Liebler2022-04-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | If glibc is configured with --disable-default-pie and build on s390 with -O3, the tests elf/tst-audit25a and elf/tst-audit25b are failing as there are additional la_symbind lines for free and malloc. It turns out that those belong to the executable. In fact those are the PLT-stubs. Furthermore la_symbind is also called for calloc and realloc symbols, but those belong to libc. Those functions are not called at all, but dlsym'ed in elf/dl-minimal.c: __rtld_malloc_init_real (struct link_map *main_map) { ... void *new_calloc = lookup_malloc_symbol (main_map, "calloc", &version); void *new_free = lookup_malloc_symbol (main_map, "free", &version); void *new_malloc = lookup_malloc_symbol (main_map, "malloc", &version); void *new_realloc = lookup_malloc_symbol (main_map, "realloc", &version); ... } Therefore, this commit just ignored symbols with LA_SYMB_DLSYM flag. Reviewed-by: Adheemrval Zanella <adhemerval.zanella@linaro.org>
* hppa: Fix bind-now audit (BZ #28857)Adhemerval Zanella2022-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | On hppa, a function pointer returned by la_symbind is actually a function descriptor has the plabel bit set (bit 30). This must be cleared to get the actual address of the descriptor. If the descriptor has been bound, the first word of the descriptor is the physical address of theA function, otherwise, the first word of the descriptor points to a trampoline in the PLT. This patch also adds a workaround on tests because on hppa (and it seems to be the only ABI I have see it), some shared library adds a dynamic PLT relocation to am empty symbol name: $ readelf -r elf/tst-audit25mod1.so [...] Relocation section '.rela.plt' at offset 0x464 contains 6 entries: Offset Info Type Sym.Value Sym. Name + Addend 00002008 00000081 R_PARISC_IPLT 508 [...] It breaks some assumptions on the test, where a symbol with an empty name ("") is passed on la_symbind. Checked on x86_64-linux-gnu and hppa-linux-gnu.
* elf: Issue la_symbind for bind-now (BZ #23734)Adhemerval Zanella2022-02-011-0/+79
The audit symbind callback is not called for binaries built with -Wl,-z,now or when LD_BIND_NOW=1 is used, nor the PLT tracking callbacks (plt_enter and plt_exit) since this would change the expected program semantics (where no PLT is expected) and would have performance implications (such as for BZ#15533). LAV_CURRENT is also bumped to indicate the audit ABI change (where la_symbind flags are set by the loader to indicate no possible PLT trace). To handle powerpc64 ELFv1 function descriptor, _dl_audit_symbind requires to know whether bind-now is used so the symbol value is updated to function text segment instead of the OPD (for lazy binding this is done by PPC64_LOAD_FUNCPTR on _dl_runtime_resolve). Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, powerpc64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>