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 master updated. glibc-2.26.9000-1000-g49b036b


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, master has been updated
       via  49b036bce9f021ae994a85aee8b410d20b29c8b7 (commit)
      from  c85c564d1442f0bc09a6c80fca025f004e12d044 (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=49b036bce9f021ae994a85aee8b410d20b29c8b7

commit 49b036bce9f021ae994a85aee8b410d20b29c8b7
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Dec 18 18:50:40 2017 +0000

    Fix nscd readlink argument aliasing (bug 22446).
    
    Current GCC mainline detects that nscd calls readlink with the same
    buffer for both input and output, which is not valid (those arguments
    are both restrict-qualified in POSIX).  This patch makes it use a
    separate buffer for readlink's input (with a size that is sufficient
    to avoid truncation, so there should be no problems with warnings
    about possible truncation, though not strictly minimal, but much
    smaller than the buffer for output) to avoid this problem.
    
    Tested compilation for aarch64-linux-gnu with build-many-glibcs.py.
    
    	[BZ #22446]
    	* nscd/connections.c (handle_request) [SO_PEERCRED]: Use separate
    	buffers for readlink input and output.

diff --git a/ChangeLog b/ChangeLog
index 31b25ab..c5ee8fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-18  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #22446]
+	* nscd/connections.c (handle_request) [SO_PEERCRED]: Use separate
+	buffers for readlink input and output.
+
 2017-12-18  Sergei Trofimovich  <slyfox@gentoo.org>
 
 	[BZ #22624]
diff --git a/nscd/connections.c b/nscd/connections.c
index cc1ed72..dab722d 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -1077,14 +1077,15 @@ cannot handle old request version %d; current version is %d"),
       if (debug_level > 0)
 	{
 #ifdef SO_PEERCRED
+	  char pbuf[sizeof ("/proc//exe") + 3 * sizeof (long int)];
 # ifdef PATH_MAX
 	  char buf[PATH_MAX];
 # else
 	  char buf[4096];
 # endif
 
-	  snprintf (buf, sizeof (buf), "/proc/%ld/exe", (long int) pid);
-	  ssize_t n = readlink (buf, buf, sizeof (buf) - 1);
+	  snprintf (pbuf, sizeof (pbuf), "/proc/%ld/exe", (long int) pid);
+	  ssize_t n = readlink (pbuf, buf, sizeof (buf) - 1);
 
 	  if (n <= 0)
 	    dbg_log (_("\

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

Summary of changes:
 ChangeLog          |    6 ++++++
 nscd/connections.c |    5 +++--
 2 files changed, 9 insertions(+), 2 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]