[arch-commits] Commit in glibc/trunk (5 files)
Allan McRae
allan at archlinux.org
Mon Oct 19 13:10:24 UTC 2009
Date: Monday, October 19, 2009 @ 09:10:24
Author: allan
Revision: 56088
upgpkg: glibc 2.10.1-5
binutils-2.20 toolchain rebuild, grab upstream patchset for proposed future stable release, fix overflow bug (FS#16253), patch to build against latest binutils
Added:
glibc/trunk/binutils-2.20.patch
glibc/trunk/formatting-integer-overflow.patch
Modified:
glibc/trunk/PKGBUILD
Deleted:
glibc/trunk/ChangeLog
glibc/trunk/signalfd-compat.patch
-----------------------------------+
ChangeLog | 62 ---------------
PKGBUILD | 34 +++++---
binutils-2.20.patch | 52 +++++++++++++
formatting-integer-overflow.patch | 144 ++++++++++++++++++++++++++++++++++++
signalfd-compat.patch | 106 --------------------------
5 files changed, 217 insertions(+), 181 deletions(-)
Deleted: ChangeLog
===================================================================
--- ChangeLog 2009-10-19 12:53:18 UTC (rev 56087)
+++ ChangeLog 2009-10-19 13:10:24 UTC (rev 56088)
@@ -1,62 +0,0 @@
-glibc-2.10.1-2
-- readd bz4781 patch
-
-glibc-2.10.1-1
-- bump to 2.10 branch
-- switch checkout to git
-- remove patches for nss and gdb
-
-glibc 2.9-7
-- actually apply patch "applied" in 2.9-6...
-
-glibc 2.9-6
-- apply upstream patch to fix gdb issue
- due to gcc optimization
-
-glibc 2.9-5
-- gcc-4.4 toolchain build
-- new CVS checkout
-- removed glibc-2.5-localedef_segfault-1.patch
-- removed glibc-2.7-bz4781.patch
-- compress info pages
-- update handling
-
-glibc 2.9-3
-- remove texinfo dep
-- only call install-info when needed
-
-glibc 2.9-2
-- apply Fedora10 changes to fix
- name resolving issues
-
-glibc 2.9-1
-- bump to new 2.9 branch
-
-glibc 2.8-2
-- fix an old memory issue again
-
-glibc 2.8-1
-- no more tarballs
-- we checkout the current release branch incl. libidn
-- cleanup the patches
-
-glibc 2.7-6
-- fix broken locales with upstream changes
-- disable the whole weekday patch, fixes #8530
-
-glibc 2.7-5
-- fix a regression: http://sourceware.org/bugzilla/show_bug.cgi?id=4781
- mainly for x86_64 where using gcc-gcj eats all memory
-
-glibc 2.7-4
-- extract /etc/locale.gen from sources to have all new locales supported
-- mask other broken locales / added a comment to post.install message
-- apply changes from Debian 2.7-exp7 pkg
- to fix some broken locales
-
-glibc 2.7-3
-- removed locale/check-unknown-symbols.diff
- localedata/tailor-iso14651_t1.diff partly
- to fix broken et_EE locale
-- switch to compressed patches
-- added ChangeLog
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2009-10-19 12:53:18 UTC (rev 56087)
+++ PKGBUILD 2009-10-19 13:10:24 UTC (rev 56088)
@@ -2,12 +2,12 @@
# Maintainer: Jan de Groot <jgc at archlinux.org>
# Maintainer: Allan McRae <allan at archlinux.org>
-# toolchain build order: kernel-headers->glibc->binutils->gcc-libs->gcc->binutils->glibc
+# toolchain build order: kernel-headers->glibc->binutils->gcc->binutils->glibc
pkgname=glibc
pkgver=2.10.1
-pkgrel=4
-_glibcdate=20090511
+pkgrel=5
+_glibcdate=20091018
install=glibc.install
backup=(etc/locale.gen
etc/nscd.conf)
@@ -16,20 +16,22 @@
license=('GPL' 'LGPL')
url="http://www.gnu.org/software/libc"
groups=('base')
-depends=('kernel-headers>=2.6.30.5' 'tzdata')
+depends=('kernel-headers>=2.6.31.4' 'tzdata')
makedepends=('gcc>=4.4')
replaces=('glibc-xen')
source=(ftp://ftp.archlinux.org/other/glibc/${pkgname}-${pkgver}_${_glibcdate}.tar.bz2
glibc-2.10-dont-build-timezone.patch
glibc-2.10-bz4781.patch
- signalfd-compat.patch
+ formatting-integer-overflow.patch
+ binutils-2.20.patch
nscd
locale.gen.txt
locale-gen)
-md5sums=('7a34595abeeedb9aab758aa51d09ed88'
+md5sums=('87e9009100427505ef1a0091ae4f4eaa'
'4dadb9203b69a3210d53514bb46f41c3'
'0c5540efc51c0b93996c51b57a8540ae'
- '48996ab265324683704b72d5522cae4b'
+ '977f3323b51008604acb5297ee76a470'
+ '3011eb913d9807bc3fbb72ebff3ae136'
'b587ee3a70c9b3713099295609afde49'
'07ac979b6ab5eeb778d55f041529d623'
'476e9113489f93b348b21e144b6a8fcf')
@@ -41,7 +43,8 @@
#cd ${srcdir}/glibc-${pkgver}_${_glibcdate}
#git clone git://sourceware.org/git/glibc.git
#pushd glibc
- #git checkout --track -b glibc-${pkgver} origin/cvs/glibc-2_10-branch
+ #git checkout -b glibc-2.10-arch origin/cvs/glibc-2_10-branch
+ #git merge origin/release/2.10/master #proposed 2.10 maintenance branch
#popd
#tar -cvjf ${startdir}/glibc-${pkgver}_${_glibcdate}.tar.bz2 glibc/*
#return 1
@@ -54,9 +57,13 @@
# http://sources.redhat.com/bugzilla/show_bug.cgi?id=4781
patch -Np1 -i ${srcdir}/glibc-2.10-bz4781.patch || return 1
- #Compatibility with older kernels that have no signalfd4 but do have signalfd
- patch -Np1 -i "${srcdir}/signalfd-compat.patch" || return 1
+ #Fix integer overflow vulnerability in formatting functions
+ #http://sources.redhat.com/bugzilla/show_bug.cgi?id=10600
+ patch -Np1 -i ${srcdir}/formatting-integer-overflow.patch || return 1
+ #Fix detection of binutils-2.20
+ patch -Np1 -i ${srcdir}/binutils-2.20.patch || return 1
+
install -dm755 ${pkgdir}/etc
touch ${pkgdir}/etc/ld.so.conf
@@ -80,8 +87,11 @@
make || return 1
make install_root=${pkgdir} install || return 1
- rm -f ${pkgdir}/etc/ld.so.cache ${pkgdir}/etc/ld.so.conf ${pkgdir}/etc/localtime
+ # provided by kernel-headers
+ rm ${pkgdir}/usr/include/scsi/scsi.h
+ rm ${pkgdir}/etc/ld.so.cache ${pkgdir}/etc/ld.so.conf ${pkgdir}/etc/localtime
+
install -dm755 ${pkgdir}/etc/rc.d
install -dm755 ${pkgdir}/usr/sbin
install -dm755 ${pkgdir}/usr/lib/locale
@@ -108,6 +118,4 @@
ln -v -s ../lib/ld* .
fi
- rm -f ${pkgdir}/usr/share/info/dir
- gzip -9 ${pkgdir}/usr/share/info/*
}
Added: binutils-2.20.patch
===================================================================
--- binutils-2.20.patch (rev 0)
+++ binutils-2.20.patch 2009-10-19 13:10:24 UTC (rev 56088)
@@ -0,0 +1,52 @@
+From 4c14c8c348ee3e9a5fea3608cabcabdb275b6141 Mon Sep 17 00:00:00 2001
+From: H.J. Lu <hongjiu.lu at intel.com>
+Date: Sat, 5 Sep 2009 07:06:19 -0700
+Subject: [PATCH] Support binutils 2.20.
+
+---
+ configure | 4 ++--
+ configure.in | 4 ++--
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 48e6952..b1d84d7 100755
+--- a/configure
++++ b/configure
+@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; }
+ ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 2.1[3-9]*)
++ 2.1[3-9]*|[2-9].[2-9]*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; }
+ ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
+ case $ac_prog_version in
+ '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+- 2.1[3-9]*)
++ 2.1[3-9]*|[2-9].[2-9]*)
+ ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+ *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
+
+diff --git a/configure.in b/configure.in
+index 4584afe..7c4f71f 100644
+--- a/configure.in
++++ b/configure.in
+@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
+ # Accept binutils 2.13 or newer.
+ AC_CHECK_PROG_VER(AS, $AS, --version,
+ [GNU assembler.* \([0-9]*\.[0-9.]*\)],
+- [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
++ [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
+ AC_CHECK_PROG_VER(LD, $LD, --version,
+ [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
+- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
++ [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
+
+ # We need the physical current working directory. We cannot use the
+ # "pwd -P" shell builtin since that's not portable. Instead we try to
+--
+1.6.4
+
Added: formatting-integer-overflow.patch
===================================================================
--- formatting-integer-overflow.patch (rev 0)
+++ formatting-integer-overflow.patch 2009-10-19 13:10:24 UTC (rev 56088)
@@ -0,0 +1,144 @@
+From 199eb0de8d673fb23aa127721054b4f1803d61f3 Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab at redhat.com>
+Date: Tue, 29 Sep 2009 06:11:59 -0700
+Subject: [PATCH] Check for integer overflows in formatting functions
+
+---
+ stdio-common/printf_fp.c | 11 ++++++++-
+ stdio-common/vfprintf.c | 49 +++++++++++++++++++++++++++++----------------
+ 3 files changed, 45 insertions(+), 20 deletions(-)
+
+diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
+index cd3ada6..b60ddec 100644
+--- a/stdio-common/printf_fp.c
++++ b/stdio-common/printf_fp.c
+@@ -891,8 +891,15 @@ ___printf_fp (FILE *fp,
+ it is possible that we need two more characters in front of all the
+ other output. If the amount of memory we have to allocate is too
+ large use `malloc' instead of `alloca'. */
+- size_t wbuffer_to_alloc = (2 + (size_t) chars_needed) * sizeof (wchar_t);
+- buffer_malloced = ! __libc_use_alloca (chars_needed * 2 * sizeof (wchar_t));
++ if (__builtin_expect (chars_needed >= (size_t) -1 / sizeof (wchar_t) - 2
++ || chars_needed < fracdig_max, 0))
++ {
++ /* Some overflow occurred. */
++ __set_errno (ERANGE);
++ return -1;
++ }
++ size_t wbuffer_to_alloc = (2 + chars_needed) * sizeof (wchar_t);
++ buffer_malloced = ! __libc_use_alloca (wbuffer_to_alloc);
+ if (__builtin_expect (buffer_malloced, 0))
+ {
+ wbuffer = (wchar_t *) malloc (wbuffer_to_alloc);
+diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
+index 38ba8ff..6e0e85c 100644
+--- a/stdio-common/vfprintf.c
++++ b/stdio-common/vfprintf.c
+@@ -1439,23 +1439,29 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+ left = 1;
+ }
+
+- if (width + 32 >= (int) (sizeof (work_buffer)
+- / sizeof (work_buffer[0])))
++ if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
++ {
++ __set_errno (ERANGE);
++ done = -1;
++ goto all_done;
++ }
++
++ if (width >= sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
+ {
+ /* We have to use a special buffer. The "32" is just a safe
+ bet for all the output which is not counted in the width. */
+- if (__libc_use_alloca ((width + 32) * sizeof (CHAR_T)))
+- workend = ((CHAR_T *) alloca ((width + 32) * sizeof (CHAR_T))
+- + (width + 32));
++ size_t needed = ((size_t) width + 32) * sizeof (CHAR_T);
++ if (__libc_use_alloca (needed))
++ workend = (CHAR_T *) alloca (needed) + width + 32;
+ else
+ {
+- workstart = (CHAR_T *) malloc ((width + 32) * sizeof (CHAR_T));
++ workstart = (CHAR_T *) malloc (needed);
+ if (workstart == NULL)
+ {
+ done = -1;
+ goto all_done;
+ }
+- workend = workstart + (width + 32);
++ workend = workstart + width + 32;
+ }
+ }
+ }
+@@ -1465,22 +1471,29 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+ LABEL (width):
+ width = read_int (&f);
+
+- if (width + 32 >= (int) (sizeof (work_buffer) / sizeof (work_buffer[0])))
++ if (__builtin_expect (width >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
++ {
++ __set_errno (ERANGE);
++ done = -1;
++ goto all_done;
++ }
++
++ if (width >= sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
+ {
+ /* We have to use a special buffer. The "32" is just a safe
+ bet for all the output which is not counted in the width. */
+- if (__libc_use_alloca ((width + 32) * sizeof (CHAR_T)))
+- workend = ((CHAR_T *) alloca ((width + 32) * sizeof (CHAR_T))
+- + (width + 32));
++ size_t needed = ((size_t) width + 32) * sizeof (CHAR_T);
++ if (__libc_use_alloca (needed))
++ workend = (CHAR_T *) alloca (needed) + width + 32;
+ else
+ {
+- workstart = (CHAR_T *) malloc ((width + 32) * sizeof (CHAR_T));
++ workstart = (CHAR_T *) malloc (needed);
+ if (workstart == NULL)
+ {
+ done = -1;
+ goto all_done;
+ }
+- workend = workstart + (width + 32);
++ workend = workstart + width + 32;
+ }
+ }
+ if (*f == L_('$'))
+@@ -1510,18 +1523,18 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+ else
+ prec = 0;
+ if (prec > width
+- && prec + 32 > (int)(sizeof (work_buffer) / sizeof (work_buffer[0])))
++ && prec > sizeof (work_buffer) / sizeof (work_buffer[0]) - 32)
+ {
+- if (__builtin_expect (prec > ~((size_t) 0) / sizeof (CHAR_T) - 31,
+- 0))
++ if (__builtin_expect (prec >= (size_t) -1 / sizeof (CHAR_T) - 32, 0))
+ {
++ __set_errno (ERANGE);
+ done = -1;
+ goto all_done;
+ }
+ size_t needed = ((size_t) prec + 32) * sizeof (CHAR_T);
+
+ if (__libc_use_alloca (needed))
+- workend = (((CHAR_T *) alloca (needed)) + ((size_t) prec + 32));
++ workend = (CHAR_T *) alloca (needed) + prec + 32;
+ else
+ {
+ workstart = (CHAR_T *) malloc (needed);
+@@ -1530,7 +1543,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+ done = -1;
+ goto all_done;
+ }
+- workend = workstart + ((size_t) prec + 32);
++ workend = workstart + prec + 32;
+ }
+ }
+ JUMP (*f, step2_jumps);
+--
+1.6.4
+
Deleted: signalfd-compat.patch
===================================================================
--- signalfd-compat.patch 2009-10-19 12:53:18 UTC (rev 56087)
+++ signalfd-compat.patch 2009-10-19 13:10:24 UTC (rev 56088)
@@ -1,106 +0,0 @@
-From: Ulrich Drepper <drepper at redhat.com>
-Date: Sun, 26 Jul 2009 19:55:03 +0000 (-0700)
-Subject: Compatibility of signalfd/eventfd with older kernels.
-X-Git-Tag: fedora/glibc-2.10.90-9~1^2~4
-X-Git-Url: http://repo.or.cz/w/glibc.git?a=commitdiff_plain;h=aa7492d2
-
-Compatibility of signalfd/eventfd with older kernels.
----
-
-diff --git a/sysdeps/unix/sysv/linux/eventfd.c b/sysdeps/unix/sysv/linux/eventfd.c
-index 4cd5579..7f69ecd 100644
---- a/sysdeps/unix/sysv/linux/eventfd.c
-+++ b/sysdeps/unix/sysv/linux/eventfd.c
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+/* Copyright (C) 2007, 2008, 2009 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
-@@ -19,14 +19,21 @@
- #include <errno.h>
- #include <sys/eventfd.h>
- #include <sysdep.h>
-+#include <kernel-features.h>
-
-
- int
- eventfd (int count, int flags)
- {
- #ifdef __NR_eventfd2
-- return INLINE_SYSCALL (eventfd2, 2, count, flags);
--#else
-+ int res = INLINE_SYSCALL (eventfd2, 2, count, flags);
-+# ifndef __ASSUME_EVENTFD2
-+ if (res != -1 || errno != ENOSYS)
-+# endif
-+ return res;
-+#endif
-+
-+#ifndef __ASSUME_EVENTFD2
- /* The old system call has no flag parameter which is bad. So we have
- to wait until we have to support to pass additional values to the
- kernel (sys_indirect) before implementing setting flags like
-@@ -43,5 +50,7 @@ eventfd (int count, int flags)
- __set_errno (ENOSYS);
- return -1;
- # endif
-+#elif !defined __NR_eventfd2
-+# error "__ASSUME_EVENTFD2 defined but not __NR_eventfd2"
- #endif
- }
-diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
-index 4562515..ff065ef 100644
---- a/sysdeps/unix/sysv/linux/kernel-features.h
-+++ b/sysdeps/unix/sysv/linux/kernel-features.h
-@@ -516,6 +516,8 @@
- # define __ASSUME_SOCK_CLOEXEC 1
- # define __ASSUME_IN_NONBLOCK 1
- # define __ASSUME_PIPE2 1
-+# define __ASSUME_EVENTFD2 1
-+# define __ASSUME_SIGNALFD4 1
- #endif
-
- /* Support for the accept4 syscall was added in 2.6.28. */
-diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c
-index 9898f29..c2d974a 100644
---- a/sysdeps/unix/sysv/linux/signalfd.c
-+++ b/sysdeps/unix/sysv/linux/signalfd.c
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
-+/* Copyright (C) 2007, 2008, 2009 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
-@@ -20,14 +20,21 @@
- #include <signal.h>
- #include <sys/signalfd.h>
- #include <sysdep.h>
-+#include <kernel-features.h>
-
-
- int
- signalfd (int fd, const sigset_t *mask, int flags)
- {
- #ifdef __NR_signalfd4
-- return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
--#else
-+ int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
-+# ifndef __ASSUME_SIGNALFD4
-+ if (res != -1 || errno != ENOSYS)
-+# endif
-+ return res;
-+#endif
-+
-+#ifndef __ASSUME_SIGNALFD4
- /* The old system call has no flag parameter which is bad. So we have
- to wait until we have to support to pass additional values to the
- kernel (sys_indirect) before implementing setting flags like
-@@ -44,5 +51,7 @@ signalfd (int fd, const sigset_t *mask, int flags)
- __set_errno (ENOSYS);
- return -1;
- # endif
-+#elif !defined __NR_signalfd4
-+# error "__ASSUME_SIGNALFD4 defined but not __NR_signalfd4"
- #endif
- }
More information about the arch-commits
mailing list