diff options
author | kib <kib@FreeBSD.org> | 2015-08-29 14:25:01 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-08-29 14:25:01 +0000 |
commit | 146b187d13b83615f02a68c038af82670588495f (patch) | |
tree | adcae95aa50cd2cbf281d867115b7156006965ea /lib/libc/db | |
parent | 8cde3bfeee04d11f30244c875082f0c8423cbcd8 (diff) | |
download | FreeBSD-src-146b187d13b83615f02a68c038af82670588495f.zip FreeBSD-src-146b187d13b83615f02a68c038af82670588495f.tar.gz |
Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.
Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc. The result was
breaking signal semantic and rtld locking.
The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT. The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.
The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.
Reported by: Pete French <petefrench@ingresso.co.uk>
Tested by: Michiel Boland <boland37@xs4all.nl>
Reviewed by: jilles (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Diffstat (limited to 'lib/libc/db')
-rw-r--r-- | lib/libc/db/btree/bt_open.c | 5 | ||||
-rw-r--r-- | lib/libc/db/hash/hash_page.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c index 94ba014..051fc28 100644 --- a/lib/libc/db/btree/bt_open.c +++ b/lib/libc/db/btree/bt_open.c @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> #include "un-namespace.h" +#include "libc_private.h" #include <db.h> #include "btree.h" @@ -401,10 +402,10 @@ tmp(void) } (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((fd = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL); return(fd); } diff --git a/lib/libc/db/hash/hash_page.c b/lib/libc/db/hash/hash_page.c index d319d98..8040419 100644 --- a/lib/libc/db/hash/hash_page.c +++ b/lib/libc/db/hash/hash_page.c @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include <assert.h> #endif #include "un-namespace.h" +#include "libc_private.h" #include <db.h> #include "hash.h" @@ -861,10 +862,10 @@ open_temp(HTAB *hashp) /* Block signals; make sure file goes away at process exit. */ (void)sigfillset(&set); - (void)_sigprocmask(SIG_BLOCK, &set, &oset); + (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset); if ((hashp->fp = mkostemp(path, O_CLOEXEC)) != -1) (void)unlink(path); - (void)_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); + (void)__libc_sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL); return (hashp->fp != -1 ? 0 : -1); } |