Fix prctl on ppc64le
authorPavel Filipenský <pfilipensky@samba.org>
Thu, 10 Nov 2022 12:41:04 +0000 (13:41 +0100)
committerAndreas Schneider <asn@samba.org>
Tue, 15 Nov 2022 11:15:22 +0000 (12:15 +0100)
commitcbb353de05f8a121b609978360367463961054e6
tree5d5438ddf5d9e85c7734eb0a9a9d54472ae09de4
parent826f7b6193fd41914facc449f73cbeed1cac500b
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 <fweimer@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 <asn@samba.org>
src/priv_wrapper.c