Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib Disable Fortification for pthread and rump stubs.



details:   https://anonhg.NetBSD.org/src/rev/4d07d39c4b5c
branches:  trunk
changeset: 764429:4d07d39c4b5c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Apr 21 13:38:14 2011 +0000

description:
Disable Fortification for pthread and rump stubs.

diffstat:

 lib/libpthread/pthread_cancelstub.c |  43 ++++--------------------------------
 lib/librumphijack/hijack.c          |  29 ++++--------------------
 2 files changed, 10 insertions(+), 62 deletions(-)

diffs (123 lines):

diff -r e66a992f6dc1 -r 4d07d39c4b5c lib/libpthread/pthread_cancelstub.c
--- a/lib/libpthread/pthread_cancelstub.c       Thu Apr 21 13:06:20 2011 +0000
+++ b/lib/libpthread/pthread_cancelstub.c       Thu Apr 21 13:38:14 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_cancelstub.c,v 1.33 2011/04/21 08:17:00 martin Exp $   */
+/*     $NetBSD: pthread_cancelstub.c,v 1.34 2011/04/21 13:38:14 joerg Exp $    */
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -29,8 +29,11 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/* Disable namespace mangling, Fortification is useless here anyway. */
+#undef _FORTIFY_SOURCE
+
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_cancelstub.c,v 1.33 2011/04/21 08:17:00 martin Exp $");
+__RCSID("$NetBSD: pthread_cancelstub.c,v 1.34 2011/04/21 13:38:14 joerg Exp $");
 
 #ifndef lint
 
@@ -50,8 +53,6 @@
  */
 #define __LIBC12_SOURCE__
 
-#define __ssp_weak_name(fun)   _cancelstub_ ## fun
-
 #include <sys/msg.h>
 #include <sys/types.h>
 #include <sys/uio.h>
@@ -470,40 +471,6 @@
        return retval;
 }
 
-#if _FORTIFY_SOURCE > 0
-#define STUB(fun) __ssp_weak_name(fun)
-ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
-ssize_t
-STUB(readlink)(const char * __restrict path, char * __restrict buf,
-    size_t bufsiz)
-{
-       return _sys_readlink(path, buf, bufsiz);
-}
-
-char *_sys_getcwd(char *, size_t);
-char *
-STUB(getcwd)(char *buf, size_t size)
-{
-       return _sys_getcwd(buf, size);
-}
-#else
-#define STUB(fun) fun
-#endif
-
-ssize_t
-STUB(read)(int d, void *buf, size_t nbytes)
-{
-       ssize_t retval;
-       pthread_t self;
-
-       self = pthread__self();
-       TESTCANCEL(self);
-       retval = _sys_read(d, buf, nbytes);
-       TESTCANCEL(self);
-
-       return retval;
-}
-
 ssize_t
 readv(int d, const struct iovec *iov, int iovcnt)
 {
diff -r e66a992f6dc1 -r 4d07d39c4b5c lib/librumphijack/hijack.c
--- a/lib/librumphijack/hijack.c        Thu Apr 21 13:06:20 2011 +0000
+++ b/lib/librumphijack/hijack.c        Thu Apr 21 13:38:14 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: hijack.c,v 1.89 2011/04/21 08:21:13 martin Exp $      */
+/*      $NetBSD: hijack.c,v 1.90 2011/04/21 13:38:14 joerg Exp $       */
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -25,10 +25,11 @@
  * SUCH DAMAGE.
  */
 
+/* Disable namespace mangling, Fortification is useless here anyway. */
+#undef _FORTIFY_SOURCE
+
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: hijack.c,v 1.89 2011/04/21 08:21:13 martin Exp $");
-
-#define __ssp_weak_name(fun) _hijack_ ## fun
+__RCSID("$NetBSD: hijack.c,v 1.90 2011/04/21 13:38:14 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -1970,26 +1971,6 @@
        (int, int),                                                     \
        (fd, how))
 
-#if _FORTIFY_SOURCE > 0
-#define STUB(fun) __ssp_weak_name(fun)
-ssize_t _sys_readlink(const char * __restrict, char * __restrict, size_t);
-ssize_t
-STUB(readlink)(const char * __restrict path, char * __restrict buf,
-    size_t bufsiz)
-{
-       return _sys_readlink(path, buf, bufsiz);
-}
-
-char *_sys_getcwd(char *, size_t);
-char *
-STUB(getcwd)(char *buf, size_t size)
-{
-       return _sys_getcwd(buf, size);
-}
-#else
-#define STUB(fun) fun
-#endif
-
 FDCALL(ssize_t, REALREAD, DUALCALL_READ,                               \
        (int fd, void *buf, size_t buflen),                             \
        (int, void *, size_t),                                          \



Home | Main Index | Thread Index | Old Index