The branch, main has been updated via 9429f65 Avoid dclose(RTLD_NEXT) via cbb353d Fix prctl on ppc64le from 826f7b6 Bump version to 1.0.0
https://git.samba.org/?p=priv_wrapper.git;a=shortlog;h=main - Log ----------------------------------------------------------------- commit 9429f654289ac6ee4ebac69fce9f61502034454d Author: Samuel Thibault <samuel.thiba...@ens-lyon.org> Date: Thu Nov 10 18:39:23 2022 +0000 Avoid dclose(RTLD_NEXT) In case the libc was not found and RTLD_NEXT is used instead, we should not dlclose it, otherwise mayhem happens. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15228 Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org> Reviewed-by: Andreas Schneider <a...@samba.org> Reviewed-by: Pavel Filipenský <pfilipen...@samba.org> commit cbb353de05f8a121b609978360367463961054e6 Author: Pavel Filipenský <pfilipen...@samba.org> Date: Thu Nov 10 13:41:04 2022 +0100 Fix prctl on ppc64le There is a fortify abort on ppc64le in test_prctl: Program received signal SIGABRT, Aborted. 0x00007ffff7cbc72c in __pthread_kill_implementation () from /lib64/libc.so.6 (gdb) bt Some backround from Florian Weimer <fwei...@redhat.com>: You've got this type definition, and I think that's the function pointer you use for the call: | #ifdef HAVE_PRCTL | typedef int (*__libc_prctl)(int option, | unsigned long arg2, | unsigned long arg3, | unsigned long arg4, | unsigned long arg5); | #endif That's not a variadic prototype, so the callee doesn't set up the parameter save area. This is essentially the same issue that you had a while back with open/openat. (https://gitlab.com/cwrap/socket_wrapper/-/commit/c7774174beffe9a8d29dd4fb38bbed43ece1cecd) Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: src/priv_wrapper.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) Changeset truncated at 500 lines: diff --git a/src/priv_wrapper.c b/src/priv_wrapper.c index acff955..d273943 100644 --- a/src/priv_wrapper.c +++ b/src/priv_wrapper.c @@ -173,11 +173,7 @@ static void privwrap_log(enum privwrap_dbglvl_e dbglvl, typedef int (*__libc_chroot)(const char *path); #ifdef HAVE_PRCTL -typedef int (*__libc_prctl)(int option, - unsigned long arg2, - unsigned long arg3, - unsigned long arg4, - unsigned long arg5); +typedef int (*__libc_prctl)(int option, ...); #endif #ifdef HAVE_PLEDGE typedef int (*__libc_pledge)(const char *promises, @@ -727,7 +723,11 @@ void privwrap_constructor(void) void privwrap_destructor(void) { - if (privwrap.libc.handle != NULL) { + if (privwrap.libc.handle != NULL +#ifdef RTLD_NEXT + && privwrap.libc.handle != RTLD_NEXT +#endif + ) { dlclose(privwrap.libc.handle); } } -- Priv Wrapper Repository