This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch release/2.26/master updated. glibc-2.26-164-g3aaf8bd


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, release/2.26/master has been updated
       via  3aaf8bda00988f21f4a83affff47bafc74a745a0 (commit)
      from  f958b45d528390fb486cecd0b0615a1994e96795 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3aaf8bda00988f21f4a83affff47bafc74a745a0

commit 3aaf8bda00988f21f4a83affff47bafc74a745a0
Author: Daniel Alvarez <dalvarez@redhat.com>
Date:   Fri Jun 29 17:23:13 2018 +0200

    getifaddrs: Don't return ifa entries with NULL names [BZ #21812]
    
    A lookup operation in map_newlink could turn into an insert because of
    holes in the interface part of the map.  This leads to incorrectly set
    the name of the interface to NULL when the interface is not present
    for the address being processed (most likely because the interface was
    added between the RTM_GETLINK and RTM_GETADDR calls to the kernel).
    When such changes are detected by the kernel, it'll mark the dump as
    "inconsistent" by setting NLM_F_DUMP_INTR flag on the next netlink
    message.
    
    This patch checks this condition and retries the whole operation.
    Hopes are that next time the interface corresponding to the address
    entry is present in the list and correct name is returned.
    
    (cherry picked from commit c1f86a33ca32e26a9d6e29fc961e5ecb5e2e5eb4)

diff --git a/ChangeLog b/ChangeLog
index 0981fca..c502ace 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-06-29  Daniel Alvarez  <dalvarez@redhat.com>
+	    Jakub Sitnicki  <jkbs@redhat.com>
+
+	[BZ #21812]
+	* sysdeps/unix/sysv/linux/ifaddrs.c (getifaddrs_internal): Retry
+	on NLM_F_DUMP_INTR.
+
 2018-06-28  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #23349]
diff --git a/NEWS b/NEWS
index c34c639..db43d87 100644
--- a/NEWS
+++ b/NEWS
@@ -93,6 +93,7 @@ The following bugs are resolved with this release:
   [21265] x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve
   [21269] i386 sigaction sa_restorer handling is wrong
   [21780] posix: Set p{read,write}v2 to return ENOTSUP
+  [21812] getifaddrs: Don't return ifa entries with NULL names
   [21871] x86-64: Use _dl_runtime_resolve_opt only with AVX512F
   [21885] getaddrinfo: Release resolver context on error in gethosts
   [21915] getaddrinfo: incorrect result handling for NSS service modules
diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c
index 3bc9902..4f75401 100644
--- a/sysdeps/unix/sysv/linux/ifaddrs.c
+++ b/sysdeps/unix/sysv/linux/ifaddrs.c
@@ -371,6 +371,14 @@ getifaddrs_internal (struct ifaddrs **ifap)
 	  if ((pid_t) nlh->nlmsg_pid != nh.pid || nlh->nlmsg_seq != nlp->seq)
 	    continue;
 
+	  /* If the dump got interrupted, we can't rely on the results
+	     so try again. */
+	  if (nlh->nlmsg_flags & NLM_F_DUMP_INTR)
+	    {
+	      result = -EAGAIN;
+	      goto exit_free;
+	    }
+
 	  if (nlh->nlmsg_type == NLMSG_DONE)
 	    break;		/* ok */
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                         |    7 +++++++
 NEWS                              |    1 +
 sysdeps/unix/sysv/linux/ifaddrs.c |    8 ++++++++
 3 files changed, 16 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]