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

[Commits] r20511 - in /fsf/trunk/libc: ChangeLog NEWS libio/iogetdelim.c stdlib/tst-secure-getenv.c



Author: eglibc
Date: Wed Sep  5 00:01:59 2012
New Revision: 20511

Log:
Import glibc-mainline for 2012-09-05

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/libio/iogetdelim.c
    fsf/trunk/libc/stdlib/tst-secure-getenv.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Sep  5 00:01:59 2012
@@ -1,3 +1,17 @@
+2012-09-04  Florian Weimer  <fweimer@xxxxxxxxxx>
+
+	* stdlib/tst-secure-getenv.c (alternative_main): Only warn on SGID
+	failures.
+
+	* stdlib/tst-secure-getenv.c: Fix whitespace in comments.
+
+2012-09-04  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	[BZ #9914]
+	* libio/iogetdelim.c: Include <limits.h>.
+	(_IO_getdelim): Avoid integer overflow in testing whether cur_len
+	+ len + 1 would overflow.
+
 2012-09-03  Andreas Jaeger  <aj@xxxxxxx>
 
 	* sysdeps/x86_64/fpu/libm-test-ulps: Update.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Wed Sep  5 00:01:59 2012
@@ -9,10 +9,10 @@
 
 * The following bugs are resolved with this release:
 
-  3479, 5400, 6778, 6808, 9685, 11607, 13412, 13717, 13696, 13939, 14042,
-  14090, 14166, 14150, 14151, 14154, 14157, 14166, 14173, 14195, 14252,
-  14283, 14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349,
-  14459, 14476, 14505, 14516, 14519, 14532, 14538
+  3479, 5400, 6778, 6808, 9685, 9914, 11607, 13412, 13717, 13696, 13939,
+  14042, 14090, 14166, 14150, 14151, 14154, 14157, 14166, 14173, 14195,
+  14252, 14283, 14298, 14303, 14307, 14328, 14331, 14336, 14337, 14347,
+  14349, 14459, 14476, 14505, 14516, 14519, 14532, 14538
 
 * Support for STT_GNU_IFUNC symbols added for s390 and s390x.
   Optimized versions of memcpy, memset, and memcmp added for System z10 and

Modified: fsf/trunk/libc/libio/iogetdelim.c
==============================================================================
--- fsf/trunk/libc/libio/iogetdelim.c (original)
+++ fsf/trunk/libc/libio/iogetdelim.c Wed Sep  5 00:01:59 2012
@@ -29,6 +29,7 @@
 #include "libioP.h"
 #include <string.h>
 #include <errno.h>
+#include <limits.h>
 
 /* Read up to (and including) a TERMINATOR from FP into *LINEPTR
    (and null-terminate it).  *LINEPTR is a pointer returned from malloc (or
@@ -89,7 +90,7 @@
       t = (char *) memchr ((void *) fp->_IO_read_ptr, delimiter, len);
       if (t != NULL)
 	len = (t - fp->_IO_read_ptr) + 1;
-      if (__builtin_expect (cur_len + len + 1 < 0, 0))
+      if (__builtin_expect (len >= SSIZE_MAX - cur_len, 0))
 	{
 	  __set_errno (EOVERFLOW);
 	  result = -1;

Modified: fsf/trunk/libc/stdlib/tst-secure-getenv.c
==============================================================================
--- fsf/trunk/libc/stdlib/tst-secure-getenv.c (original)
+++ fsf/trunk/libc/stdlib/tst-secure-getenv.c Wed Sep  5 00:01:59 2012
@@ -18,7 +18,7 @@
 /* Test that secure_getenv works by invoking the test as a SGID
    program with a group ID from the supplementary group list.  This
    test can fail spuriously if the user is not a member of a suitable
-   supplementary group. */
+   supplementary group.  */
 
 #include <errno.h>
 #include <fcntl.h>
@@ -36,7 +36,7 @@
 static const char *test_dir;
 
 /* Return a GID which is not our current GID, but is present in the
-   supplementary group list. */
+   supplementary group list.  */
 static gid_t
 choose_gid (void)
 {
@@ -60,7 +60,7 @@
 
 /* Copies the executable into a restricted directory, so that we can
    safely make it SGID with the TARGET group ID.  Then runs the
-   executable. */
+   executable.  */
 static int
 run_executable_sgid (gid_t target)
 {
@@ -152,7 +152,7 @@
     }
   if (kid == 0)
     {
-      /* Child process. */
+      /* Child process.  */
       char *args[] = { execname, MAGIC_ARGUMENT, NULL };
       execve (execname, args, environ);
       printf ("execve (%s): %m\n", execname);
@@ -228,9 +228,10 @@
     {
       if (getgid () == getegid ())
 	{
-	  printf ("SGID failed: GID and EGID match (%jd)\n",
+	  /* This can happen if the file system is mounted nosuid.  */
+	  fprintf (stderr, "SGID failed: GID and EGID match (%jd)\n",
 		  (intmax_t) getgid ());
-	  exit (2);
+	  exit (MAGIC_STATUS);
 	}
       if (getenv ("PATH") == NULL)
 	{

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits