summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-08-29 14:25:01 +0000
committerkib <kib@FreeBSD.org>2015-08-29 14:25:01 +0000
commit146b187d13b83615f02a68c038af82670588495f (patch)
treeadcae95aa50cd2cbf281d867115b7156006965ea /lib/libc/stdio
parent8cde3bfeee04d11f30244c875082f0c8423cbcd8 (diff)
downloadFreeBSD-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/stdio')
-rw-r--r--lib/libc/stdio/tmpfile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdio/tmpfile.c b/lib/libc/stdio/tmpfile.c
index c67d1e4..e5a2be1 100644
--- a/lib/libc/stdio/tmpfile.c
+++ b/lib/libc/stdio/tmpfile.c
@@ -46,9 +46,10 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <paths.h>
#include "un-namespace.h"
+#include "libc_private.h"
FILE *
-tmpfile()
+tmpfile(void)
{
sigset_t set, oset;
FILE *fp;
@@ -69,7 +70,7 @@ tmpfile()
return (NULL);
sigfillset(&set);
- (void)_sigprocmask(SIG_BLOCK, &set, &oset);
+ (void)__libc_sigprocmask(SIG_BLOCK, &set, &oset);
fd = mkstemp(buf);
if (fd != -1)
@@ -77,7 +78,7 @@ tmpfile()
free(buf);
- (void)_sigprocmask(SIG_SETMASK, &oset, NULL);
+ (void)__libc_sigprocmask(SIG_SETMASK, &oset, NULL);
if (fd == -1)
return (NULL);
OpenPOWER on IntegriCloud