summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
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/net
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/net')
-rw-r--r--lib/libc/net/rcmd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 2885dc3..1ba9888 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
#endif
#include <arpa/nameser.h>
#include "un-namespace.h"
+#include "libc_private.h"
extern int innetgr( const char *, const char *, const char *, const char * );
@@ -148,7 +149,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
refused = 0;
sigemptyset(&newmask);
sigaddset(&newmask, SIGURG);
- _sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask);
+ __libc_sigprocmask(SIG_BLOCK, (const sigset_t *)&newmask, &oldmask);
for (timo = 1, lport = IPPORT_RESERVED - 1;;) {
s = rresvport_af(&lport, ai->ai_family);
if (s < 0) {
@@ -163,7 +164,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
(void)fprintf(stderr, "rcmd: socket: %s\n",
strerror(errno));
freeaddrinfo(res);
- _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask,
+ __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask,
NULL);
return (-1);
}
@@ -181,7 +182,7 @@ rcmd_af(ahost, rport, locuser, remuser, cmd, fd2p, af)
(void)fprintf(stderr, "%s: %s\n",
*ahost, strerror(errno));
freeaddrinfo(res);
- _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask,
+ __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask,
NULL);
return (-1);
}
@@ -306,7 +307,7 @@ again:
}
goto bad2;
}
- _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL);
+ __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL);
freeaddrinfo(res);
return (s);
bad2:
@@ -314,7 +315,7 @@ bad2:
(void)_close(*fd2p);
bad:
(void)_close(s);
- _sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL);
+ __libc_sigprocmask(SIG_SETMASK, (const sigset_t *)&oldmask, NULL);
freeaddrinfo(res);
return (-1);
}
OpenPOWER on IntegriCloud