GNU C Library master sources branch, release/2.14/master, updated. glibc-2.14-27-g63072fc
schwab@sourceware.org
schwab@sourceware.org
Fri Jul 22 10:01:00 GMT 2011
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.14/master has been updated
via 63072fc6170f06657800a536c084db5d6e45e80f (commit)
via 1390c85454f89134a4329b383a3582a0e14d2f50 (commit)
via 6e23b0ab48e7e91bd5e1f691811a968f864d072d (commit)
via 680b74830af43c5ff4391d9f7dc8f2e1a3a939d7 (commit)
via f6244abb8c68c705b8f8bfb3c8adb44dffe5a157 (commit)
via b3c34b4a97273baf7546cd85bc90621571eee7cd (commit)
via 51f8ca96484efa481e3c86d48560fd7061cfdbc1 (commit)
via 77b2540f78e4c97ffded2c0600012cc48c4670fd (commit)
via af6207d5391d434d6f2951da4c8f57d1f3a2a762 (commit)
from 1a1fbe1558c397336afd2ec3518b1d8fad6ed018 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=63072fc6170f06657800a536c084db5d6e45e80f
commit 63072fc6170f06657800a536c084db5d6e45e80f
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Jul 20 22:53:58 2011 -0400
Check for overflows in expressions
Some passed in values might cause overflows in expressions.
(cherry picked from commit 90bb2039e93c6b7e95531cf9a9dfc23bbb50f860)
diff --git a/ChangeLog b/ChangeLog
index 36ddde7..515f22c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-07-20 Ulrich Drepper <drepper@gmail.com>
+ [BZ #12852]
+ * posix/glob.c (glob): Check passed in values before using them in
+ expressions to avoid some overflows.
+ (glob_in_dir): Likewise.
+
+2011-07-20 Ulrich Drepper <drepper@gmail.com>
+
* sysdeps/x86_64/bits/link.h (La_x86_64_ymm): Force 16-byte alignment.
2011-07-20 Andreas Schwab <schwab@redhat.com>
diff --git a/posix/glob.c b/posix/glob.c
index 2cd5290..89c8775 100644
--- a/posix/glob.c
+++ b/posix/glob.c
@@ -46,6 +46,12 @@
#include <pwd.h>
+#if defined HAVE_STDINT_H || defined _LIBC
+# include <stdint.h>
+#elif !defined UINTPTR_MAX
+# define UINTPTR_MAX (~((size_t) 0))
+#endif
+
#include <errno.h>
#ifndef __set_errno
# define __set_errno(val) errno = (val)
@@ -436,6 +442,10 @@ glob (pattern, flags, errfunc, pglob)
else
{
size_t i;
+
+ if (pglob->gl_offs >= ~((size_t) 0) / sizeof (char *))
+ return GLOB_NOSPACE;
+
pglob->gl_pathv = (char **) malloc ((pglob->gl_offs + 1)
* sizeof (char *));
if (pglob->gl_pathv == NULL)
@@ -954,10 +964,8 @@ glob (pattern, flags, errfunc, pglob)
int newcount = pglob->gl_pathc + pglob->gl_offs;
char **new_gl_pathv;
- new_gl_pathv
- = (char **) realloc (pglob->gl_pathv,
- (newcount + 1 + 1) * sizeof (char *));
- if (new_gl_pathv == NULL)
+ if (newcount > UINTPTR_MAX - (1 + 1)
+ || newcount + 1 + 1 > ~((size_t) 0) / sizeof (char *))
{
nospace:
free (pglob->gl_pathv);
@@ -965,6 +973,12 @@ glob (pattern, flags, errfunc, pglob)
pglob->gl_pathc = 0;
return GLOB_NOSPACE;
}
+
+ new_gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (newcount + 1 + 1) * sizeof (char *));
+ if (new_gl_pathv == NULL)
+ goto nospace;
pglob->gl_pathv = new_gl_pathv;
if (flags & GLOB_MARK)
@@ -1104,14 +1118,19 @@ glob (pattern, flags, errfunc, pglob)
int newcount = pglob->gl_pathc + pglob->gl_offs;
char **new_gl_pathv;
- new_gl_pathv = (char **) realloc (pglob->gl_pathv,
- (newcount + 2)
- * sizeof (char *));
- if (new_gl_pathv == NULL)
+ if (newcount > UINTPTR_MAX - 2
+ || newcount + 2 > ~((size_t) 0) / sizeof (char *))
{
+ nospace2:
globfree (&dirs);
return GLOB_NOSPACE;
}
+
+ new_gl_pathv = (char **) realloc (pglob->gl_pathv,
+ (newcount + 2)
+ * sizeof (char *));
+ if (new_gl_pathv == NULL)
+ goto nospace2;
pglob->gl_pathv = new_gl_pathv;
pglob->gl_pathv[newcount] = __strdup (pattern);
@@ -1636,6 +1655,13 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
{
result = 0;
+ if (pglob->gl_pathc > UINTPTR_MAX - pglob->gl_offs
+ || pglob->gl_pathc + pglob->gl_offs > UINTPTR_MAX - nfound
+ || pglob->gl_pathc + pglob->gl_offs + nfound > UINTPTR_MAX - 1
+ || (pglob->gl_pathc + pglob->gl_offs + nfound + 1
+ > UINTPTR_MAX / sizeof (char *)))
+ goto memory_error;
+
char **new_gl_pathv;
new_gl_pathv
= (char **) realloc (pglob->gl_pathv,
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1390c85454f89134a4329b383a3582a0e14d2f50
commit 1390c85454f89134a4329b383a3582a0e14d2f50
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Jul 20 14:20:00 2011 -0400
Force :a_x86_64_ymm to be 16-byte aligned
(cherry picked from commit 6986b98a18490e76b16911d1c6b1ba013598d40d)
diff --git a/ChangeLog b/ChangeLog
index ea8e0f2..36ddde7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-20 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/x86_64/bits/link.h (La_x86_64_ymm): Force 16-byte alignment.
+
2011-07-20 Andreas Schwab <schwab@redhat.com>
* resolv/res_query.c (__libc_res_nquerydomain): Use size_t for
diff --git a/sysdeps/x86_64/bits/link.h b/sysdeps/x86_64/bits/link.h
index 643a293..14cc92b 100644
--- a/sysdeps/x86_64/bits/link.h
+++ b/sysdeps/x86_64/bits/link.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2009, 2011 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
@@ -65,7 +65,8 @@ __END_DECLS
/* Registers for entry into PLT on x86-64. */
# if __GNUC_PREREQ (4,0)
typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
-typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32)));
+typedef float La_x86_64_ymm
+ __attribute__ ((__vector_size__ (32), __aligned__ (16)));
# else
typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
# endif
@@ -76,7 +77,7 @@ typedef union
La_x86_64_ymm ymm[2];
# endif
La_x86_64_xmm xmm[4];
-} La_x86_64_vector __attribute__ ((aligned(16)));
+} La_x86_64_vector __attribute__ ((__aligned__ (16)));
typedef struct La_x86_64_regs
{
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6e23b0ab48e7e91bd5e1f691811a968f864d072d
commit 6e23b0ab48e7e91bd5e1f691811a968f864d072d
Author: Andreas Schwab <schwab@redhat.com>
Date: Wed Jul 20 11:40:37 2011 -0400
Use size_t for strlen results
(cherry picked from commit 28b59fca7ae3cfc2d57e0007aaa3793d4b775e97)
diff --git a/ChangeLog b/ChangeLog
index 4beefb4..ea8e0f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-20 Andreas Schwab <schwab@redhat.com>
+
+ * resolv/res_query.c (__libc_res_nquerydomain): Use size_t for
+ strlen results.
+
2011-07-19 Andreas Schwab <schwab@redhat.com>
* string/strxfrm_l.c (STRXFRM): Fix alloca accounting.
diff --git a/resolv/res_query.c b/resolv/res_query.c
index 26daf0d..2f7cfaa 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -543,7 +543,7 @@ __libc_res_nquerydomain(res_state statp,
{
char nbuf[MAXDNAME];
const char *longname = nbuf;
- int n, d;
+ size_t n, d;
#ifdef DEBUG
if (statp->options & RES_DEBUG)
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=680b74830af43c5ff4391d9f7dc8f2e1a3a939d7
commit 680b74830af43c5ff4391d9f7dc8f2e1a3a939d7
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Jul 19 15:03:57 2011 -0400
Fix alloca accounting in strxfm
(cherry picked from commit e0e722848005e335132015a64a09cad7f7a12073)
diff --git a/ChangeLog b/ChangeLog
index d774296..4beefb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-19 Andreas Schwab <schwab@redhat.com>
+
+ * string/strxfrm_l.c (STRXFRM): Fix alloca accounting.
+
2011-07-19 Ulrich Drepper <drepper@gmail.com>
* nscd/nscd.c (termination_handler): Don't do anything for a database
diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
index 351b426..220253c 100644
--- a/string/strxfrm_l.c
+++ b/string/strxfrm_l.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995-1997,2002,2004-2006,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995-1997,2002,2004-2006,2010,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@gnu.org>, 1995.
@@ -150,7 +151,7 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
values. But since there is no limit on the length of the string
we have to use `malloc' if the string is too long. We should be
very conservative here. */
- if (! __libc_use_alloca (srclen))
+ if (! __libc_use_alloca ((srclen + 1) * (sizeof (int32_t) + 1)))
{
idxarr = (int32_t *) malloc ((srclen + 1) * (sizeof (int32_t) + 1));
rulearr = (unsigned char *) &idxarr[srclen];
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f6244abb8c68c705b8f8bfb3c8adb44dffe5a157
commit f6244abb8c68c705b8f8bfb3c8adb44dffe5a157
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Jul 19 13:59:57 2011 -0400
Avoid possible crashes in anormal nscd exits
(cherry picked from commit feb1eb0be78b40d53c71474f07d1b0517ba95586)
diff --git a/ChangeLog b/ChangeLog
index 22f63b1..d774296 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-19 Ulrich Drepper <drepper@gmail.com>
+
+ * nscd/nscd.c (termination_handler): Don't do anything for a database
+ if it has not yet been initialized.
+
2011-07-05 Andreas Jaeger <aj@suse.de>
[BZ#9696]
diff --git a/nscd/nscd.c b/nscd/nscd.c
index c3d9fe6..f50e814 100644
--- a/nscd/nscd.c
+++ b/nscd/nscd.c
@@ -477,7 +477,7 @@ termination_handler (int signum)
/* Synchronize memory. */
for (int cnt = 0; cnt < lastdb; ++cnt)
{
- if (!dbs[cnt].enabled)
+ if (!dbs[cnt].enabled || dbs[cnt].head == NULL)
continue;
/* Make sure nobody keeps using the database. */
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b3c34b4a97273baf7546cd85bc90621571eee7cd
commit b3c34b4a97273baf7546cd85bc90621571eee7cd
Author: Andreas Jaeger <aj@suse.de>
Date: Fri Jul 8 13:16:26 2011 -0400
Add test case strtod underflow
(cherry picked from commit 04d08991c4612450880eb55a1d3070597429b7cb)
diff --git a/ChangeLog b/ChangeLog
index af6de90..22f63b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-05 Andreas Jaeger <aj@suse.de>
+
+ [BZ#9696]
+ * stdlib/tst-strtod.c: Add testcase.
+
2011-07-07 Ulrich Drepper <drepper@gmail.com>
[BZ #12868]
diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c
index c30eb1e..1cb9a5c 100644
--- a/stdlib/tst-strtod.c
+++ b/stdlib/tst-strtod.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1996-2001,2003,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996-2001,2003,2009,2011 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
@@ -72,6 +72,7 @@ static const struct ltest tests[] =
{ "+InFiNiTy", HUGE_VAL, '\0', 0 },
#endif
{ "0x80000Ap-23", 0x80000Ap-23, '\0', 0 },
+ { "1e-324", 0, '\0', ERANGE },
{ NULL, 0, '\0', 0 }
};
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=51f8ca96484efa481e3c86d48560fd7061cfdbc1
commit 51f8ca96484efa481e3c86d48560fd7061cfdbc1
Author: Andreas Dilger <adilger@whamcloud.com>
Date: Thu Jul 7 00:20:32 2011 -0400
Handle Lustre filesystem
(cherry picked from commit de283087c74f720cf8a7171972e72b5fa2b45e79)
diff --git a/ChangeLog b/ChangeLog
index 4d7e1ba..af6de90 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-07 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #12868]
+ * sysdeps/unix/sysv/linux/linux_fsinfo.h: Define Lustre constants.
+ * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+ Handle Lustre.
+ * sysdeps/unix/sysv/linux/pathconf.c (__statfs_link_max): Likewise.
+ (__statfs_filesize_max): Likewise.
+ Patch mostly by Andreas Dilger <adilger@whamcloud.com>.
+
2011-07-06 Ulrich Drepper <drepper@gmail.com>
[BZ #12922]
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 8288548..2ddec1e 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2006, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2006, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -115,6 +115,9 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
case CGROUP_SUPER_MAGIC:
fsname = "cgroup";
break;
+ case LUSTRE_SUPER_MAGIC:
+ fsname = "lustre";
+ break;
}
FILE *mtab = __setmntent ("/proc/mounts", "r");
diff --git a/sysdeps/unix/sysv/linux/linux_fsinfo.h b/sysdeps/unix/sysv/linux/linux_fsinfo.h
index a0e0700..55bc6e3 100644
--- a/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -1,5 +1,5 @@
/* Constants from kernel header for various FSes.
- Copyright (C) 1998-2003,2005,2010 Free Software Foundation, Inc.
+ Copyright (C) 1998-2003,2005,2010,2011 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
@@ -83,6 +83,9 @@
/* Constant that identifies the `logfs' filesystem. */
#define LOGFS_MAGIC_U32 0xc97e8168u
+/* Constant that identifies the `lustre' filesystem. */
+#define LUSTRE_SUPER_MAGIC 0x0BD00BD0
+
/* Constants that identify the `minix2' filesystem. */
#define MINIX2_SUPER_MAGIC 0x2468
#define MINIX2_SUPER_MAGIC2 0x2478
@@ -150,6 +153,8 @@
/* Maximum link counts. */
#define COH_LINK_MAX 10000
#define EXT2_LINK_MAX 32000
+#define EXT4_LINK_MAX 65000
+#define LUSTRE_LINK_MAX EXT4_LINK_MAX
#define MINIX2_LINK_MAX 65530
#define MINIX_LINK_MAX 250
#define REISERFS_LINK_MAX 64535
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index 52610a1..42b7b80 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -121,6 +121,9 @@ __statfs_link_max (int result, const struct statfs *fsbuf)
case XFS_SUPER_MAGIC:
return XFS_LINK_MAX;
+ case LUSTRE_SUPER_MAGIC:
+ return LUSTRE_LINK_MAX;
+
default:
return LINUX_LINK_MAX;
}
@@ -157,6 +160,7 @@ __statfs_filesize_max (int result, const struct statfs *fsbuf)
case JFS_SUPER_MAGIC:
case VXFS_SUPER_MAGIC:
case CGROUP_SUPER_MAGIC:
+ case LUSTRE_SUPER_MAGIC:
return 64;
case MSDOS_SUPER_MAGIC:
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=77b2540f78e4c97ffded2c0600012cc48c4670fd
commit 77b2540f78e4c97ffded2c0600012cc48c4670fd
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Jul 6 21:27:14 2011 -0400
Handle W; without long options in getopt
(cherry picked from commit 01636b2140cd1281202b89f7103249ed598065c4)
diff --git a/ChangeLog b/ChangeLog
index b11f5ee..4d7e1ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-06 Ulrich Drepper <drepper@gmail.com>
+
+ [BZ #12922]
+ * posix/getopt.c (_getopt_internal_r): When "W;" is in short options
+ but no long options are defined, just return 'W'.
+
2011-06-22 Marek Polacek <mpolacek@redhat.com>
[BZ #9696]
diff --git a/posix/getopt.c b/posix/getopt.c
index db89abf..3fa5a4d 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -871,6 +871,9 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
/* Convenience. Treat POSIX -W foo same as long option --foo */
if (temp[0] == 'W' && temp[1] == ';')
{
+ if (longopts == NULL)
+ goto no_longs;
+
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
@@ -1086,8 +1089,10 @@ _getopt_internal_r (int argc, char *const *argv, const char *optstring,
}
return pfound->val;
}
- d->__nextchar = NULL;
- return 'W'; /* Let the application handle it. */
+
+ no_longs:
+ d->__nextchar = NULL;
+ return 'W'; /* Let the application handle it. */
}
if (temp[1] == ':')
{
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=af6207d5391d434d6f2951da4c8f57d1f3a2a762
commit af6207d5391d434d6f2951da4c8f57d1f3a2a762
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Jul 6 20:57:55 2011 -0400
Change error code for underflows in strtod
(cherry picked from commit 9895c8bc62759a2d7abf95654fb2aefe5677a930)
diff --git a/ChangeLog b/ChangeLog
index 534ac2c..b11f5ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-22 Marek Polacek <mpolacek@redhat.com>
+
+ [BZ #9696]
+ * stdlib/strtod_l.c (round_and_return): Set ERANGE instead of EDOM.
+
2011-06-30 Andreas Schwab <schwab@redhat.com>
* sysdeps/posix/getaddrinfo.c (gaih_inet): Make sure RES_USE_INET6
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 537d1fb..b3380fd 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -1,5 +1,5 @@
/* Convert string representing a number to float value, using given locale.
- Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009,2010
+ Copyright (C) 1997,1998,2002,2004,2005,2006,2007,2008,2009,2010,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -185,7 +185,7 @@ round_and_return (mp_limb_t *retval, int exponent, int negative,
if (shift > MANT_DIG)
{
- __set_errno (EDOM);
+ __set_errno (ERANGE);
return 0.0;
}
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 51 ++++++++++++++++++++++++++++
nscd/nscd.c | 2 +-
posix/getopt.c | 9 ++++-
posix/glob.c | 42 ++++++++++++++++++----
resolv/res_query.c | 2 +-
stdlib/strtod_l.c | 4 +-
stdlib/tst-strtod.c | 3 +-
string/strxfrm_l.c | 5 ++-
sysdeps/unix/sysv/linux/internal_statvfs.c | 5 ++-
sysdeps/unix/sysv/linux/linux_fsinfo.h | 7 +++-
sysdeps/unix/sysv/linux/pathconf.c | 4 ++
sysdeps/x86_64/bits/link.h | 7 ++--
12 files changed, 119 insertions(+), 22 deletions(-)
hooks/post-receive
--
GNU C Library master sources
More information about the Glibc-cvs
mailing list