]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nscd: Do not use __inet_aton_exact@GLIBC_PRIVATE [BZ #20018]
authorFlorian Weimer <fweimer@redhat.com>
Mon, 4 Feb 2019 19:07:18 +0000 (20:07 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 4 Feb 2019 20:36:38 +0000 (21:36 +0100)
This commit avoids referencing the __inet_aton_exact@GLIBC_PRIVATE
symbol from nscd.  In master, the separately-compiled getaddrinfo
implementation in nscd needs it, however such an internal ABI change
is not desirable on a release branch if it can be avoided.

ChangeLog
nscd/Makefile
nscd/gai.c
nscd/nscd-inet_addr.c [new file with mode: 0644]

index 0db10776e6470e774340a9e0ea2e6eb8aa0fed02..cb119f36acc4c8b0ae79b37aaee91a01b632fb93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2019-02-04  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #20018]
+       nscd: Do not rely on new GLIBC_PRIVATE ABI after CVE-2016-10739 fix.
+       * nscd/nscd-inet_addr.c: New file.  Build resolv/inet_addr.c for
+       nscd, without public symbols.
+       * nscd/Makefile (nscd-modules): Add it.
+       * nscd/gai.c: Include <arpa/inet.h> and change visibility of
+       __inet_aton_exact.
+
 2019-01-21  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #20018]
index b713a84c4953d41109cee32d171cfbb153374ac7..eb23c01a396254a5d5c6de183aa5ef0c32c2477e 100644 (file)
@@ -36,7 +36,7 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
                getsrvbynm_r getsrvbypt_r servicescache \
                dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
                xmalloc xstrdup aicache initgrcache gai res_hconf \
-               netgroupcache
+               netgroupcache nscd-inet_addr
 
 ifeq ($(build-nscd)$(have-thread-library),yesyes)
 
index f57f396f574a6e524647b63d7939c0a42070a36e..68a4abd30e5b5d2913f9f1eb2e95d2b3ab5afa7c 100644 (file)
 #define __getifaddrs getifaddrs
 #define __freeifaddrs freeifaddrs
 
+/* We do not want to export __inet_aton_exact.  Get the prototype and
+   change its visibility to hidden.  */
+#include <arpa/inet.h>
+__typeof__ (__inet_aton_exact) __inet_aton_exact
+  __attribute__ ((visibility ("hidden")));
+
 /* We are nscd, so we don't want to be talking to ourselves.  */
 #undef  USE_NSCD
 
diff --git a/nscd/nscd-inet_addr.c b/nscd/nscd-inet_addr.c
new file mode 100644 (file)
index 0000000..f366b95
--- /dev/null
@@ -0,0 +1,32 @@
+/* Legacy IPv4 text-to-address functions.  Version for nscd.
+   Copyright (C) 2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <arpa/inet.h>
+
+/* We do not want to export __inet_aton_exact.  Get the prototype and
+   change the visibility to hidden.  */
+#include <arpa/inet.h>
+__typeof__ (__inet_aton_exact) __inet_aton_exact
+  __attribute__ ((visibility ("hidden")));
+
+/* Do not provide definitions of the public symbols exported from
+   libc.  */
+#undef weak_alias
+#define weak_alias(from, to)
+
+#include <resolv/inet_addr.c>