Compare commits

...

3 Commits
master ... f14

Author SHA1 Message Date
Jeff Law
b11f27e53f - Check values from TZ file header (#767696) 2011-12-19 05:10:31 +00:00
Andreas Schwab
1efe5c5ba4 2.13-2 2011-08-05 13:01:14 +02:00
Dennis Gilmore
bc7b0f9f79 * Sat May 04 2011 Dennis Gilmore <dennis@ausil.us> - 2.13-2
- build for redhat-linux-gnueabi on arm arches
2011-05-14 18:26:49 -05:00
5 changed files with 344 additions and 279 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
/glibc-2.13-fedora.tar.xz
/glibc-2.13.tar.xz
/glibc-ports-2.12-54-gbd44238.tar.xz
/glibc-2.13-13-g943515f-fedora.tar.xz
/glibc-2.13-13-g943515f.tar.xz
/glibc-ports-2.13-5-g4f32a56.tar.xz

File diff suppressed because it is too large Load Diff

82
glibc-rh767696.patch Normal file
View File

@ -0,0 +1,82 @@
commit 97ac2654b2d831acaa18a2b018b0736245903fd2
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sat Dec 17 20:18:42 2011 -0500
Check values from TZ file header
[BZ #13506]
* time/tzfile.c (__tzfile_read): Check values from file header.
diff --git a/time/tzfile.c b/time/tzfile.c
index 144e20b..402389c 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -234,23 +234,58 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
goto read_again;
}
+ if (__builtin_expect (num_transitions
+ > ((SIZE_MAX - (__alignof__ (struct ttinfo) - 1))
+ / (sizeof (time_t) + 1)), 0))
+ goto lose;
total_size = num_transitions * (sizeof (time_t) + 1);
total_size = ((total_size + __alignof__ (struct ttinfo) - 1)
& ~(__alignof__ (struct ttinfo) - 1));
types_idx = total_size;
- total_size += num_types * sizeof (struct ttinfo) + chars;
+ if (__builtin_expect (num_types
+ > (SIZE_MAX - total_size) / sizeof (struct ttinfo), 0))
+ goto lose;
+ total_size += num_types * sizeof (struct ttinfo);
+ if (__builtin_expect (chars > SIZE_MAX - total_size, 0))
+ goto lose;
+ total_size += chars;
+ if (__builtin_expect (__alignof__ (struct leap) - 1
+ > SIZE_MAX - total_size, 0))
+ goto lose;
total_size = ((total_size + __alignof__ (struct leap) - 1)
& ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size;
+ if (__builtin_expect (num_leaps
+ > (SIZE_MAX - total_size) / sizeof (struct leap), 0))
+ goto lose;
total_size += num_leaps * sizeof (struct leap);
- tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
- ? st.st_size - (ftello (f)
- + num_transitions * (8 + 1)
- + num_types * 6
- + chars
- + num_leaps * 12
- + num_isstd
- + num_isgmt) - 1 : 0);
+ tzspec_len = 0;
+ if (sizeof (time_t) == 8 && trans_width == 8)
+ {
+ off_t rem = st.st_size - ftello (f);
+ if (__builtin_expect (rem < 0
+ || (size_t) rem < (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars), 0))
+ goto lose;
+ tzspec_len = (size_t) rem - (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars);
+ if (__builtin_expect (num_leaps > SIZE_MAX / 12
+ || tzspec_len < num_leaps * 12, 0))
+ goto lose;
+ tzspec_len -= num_leaps * 12;
+ if (__builtin_expect (tzspec_len < num_isstd, 0))
+ goto lose;
+ tzspec_len -= num_isstd;
+ if (__builtin_expect (tzspec == 0 || tzspec_len - 1 < num_isgmt, 0))
+ goto lose;
+ tzspec_len -= num_isgmt + 1;
+ if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))
+ goto lose;
+ }
+ if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0))
+ goto lose;
/* Allocate enough memory including the extra block requested by the
caller. */

View File

@ -1,6 +1,6 @@
%define glibcsrcdir glibc-2.13
%define glibcsrcdir glibc-2.13-13-g943515f
%define glibcversion 2.13
%define glibcportsdir glibc-ports-2.12-54-gbd44238
%define glibcportsdir glibc-ports-2.13-5-g4f32a56
### glibc.spec.in follows:
%define run_glibc_tests 1
%define auxarches athlon alphaev6
@ -24,7 +24,7 @@
Summary: The GNU libc libraries
Name: glibc
Version: %{glibcversion}
Release: 1
Release: 3
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
# Things that are linked directly into dynamically linked programs
# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@ -38,6 +38,8 @@ Source1: %{?glibc_release_url}%{glibcportsdir}.tar.xz
Source2: %{glibcsrcdir}-fedora.tar.xz
Patch0: %{name}-fedora.patch
Patch1: %{name}-ia64-lib64.patch
Patch2: %{name}-rh767696.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Obsoletes: glibc-profile < 2.4
Provides: ldconfig
@ -56,10 +58,9 @@ BuildRequires: /bin/ps, /bin/kill, /bin/awk
BuildRequires: gcc >= 3.2
%define enablekernel 2.6.32
Conflicts: kernel < %{enablekernel}
%ifarch i386
%define nptl_target_cpu i486
%else
%define nptl_target_cpu %{_target_cpu}
%define target %{_target_cpu}-redhat-linux
%ifarch %{arm}
%define target %{_target_cpu}-redhat-linuxeabi
%endif
%ifarch %{multiarcharches}
# Need STT_IFUNC support
@ -251,6 +252,7 @@ rm -rf %{glibcportsdir}
%patch1 -p1
%endif
%endif
%patch2 -p1
# A lot of programs still misuse memcpy when they have to use
# memmove. The memcpy implementation below is not tolerant at
@ -277,7 +279,7 @@ touch locale/programs/*-kw.h
GCC=gcc
GXX=g++
%ifarch %{ix86}
BuildFlags="-march=%{nptl_target_cpu} -mtune=generic"
BuildFlags="-march=%{_target_cpu} -mtune=generic"
%endif
%ifarch i686
BuildFlags="-march=i686 -mtune=generic"
@ -337,10 +339,10 @@ AddOns=`echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkai
AddOns=,rtkaio$AddOns
%endif
build_nptl()
build()
{
builddir=build-%{nptl_target_cpu}-$1
shift
builddir=build-%{target}${1:+-$1}
${1+shift}
rm -rf $builddir
mkdir $builddir ; cd $builddir
build_CFLAGS="$BuildFlags -g -O3 $*"
@ -351,8 +353,7 @@ configure_CFLAGS="$build_CFLAGS -fno-asynchronous-unwind-tables"
--prefix=%{_prefix} \
--enable-add-ons=../%{glibcportsdir},nptl$AddOns \
--with-headers=%{_prefix}/include $EnableKernel --enable-bind-now \
--with-tls --with-__thread --build %{nptl_target_cpu}-redhat-linux \
--host %{nptl_target_cpu}-redhat-linux \
--with-tls --with-__thread --build=%{target} \
%ifarch %{multiarcharches}
--enable-multi-arch \
%endif
@ -364,10 +365,10 @@ make %{?_smp_mflags} -r CFLAGS="$build_CFLAGS" PARALLELMFLAGS=-s
cd ..
}
build_nptl linuxnptl
build
%if %{buildxen}
build_nptl linuxnptl-nosegneg -mno-tls-direct-seg-refs
build nosegneg -mno-tls-direct-seg-refs
%endif
%if %{buildpower6}
@ -387,11 +388,11 @@ fi
AddOns="$AddOns --with-cpu=power6"
GCC="$GCC -mcpu=power6"
GXX="$GXX -mcpu=power6"
build_nptl linuxnptl-power6
build power6
)
%endif
cd build-%{nptl_target_cpu}-linuxnptl
cd build-%{target}
$GCC -static -L. -Os -g ../fedora/glibc_post_upgrade.c -o glibc_post_upgrade.%{_target_cpu} \
-DNO_SIZE_OPTIMIZATION \
'-DLIBTLS="/%{_lib}/tls/"' \
@ -405,9 +406,9 @@ GCC=`cat Gcc`
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
make -j1 install_root=$RPM_BUILD_ROOT install -C build-%{nptl_target_cpu}-linuxnptl PARALLELMFLAGS=-s
make -j1 install_root=$RPM_BUILD_ROOT install -C build-%{target} PARALLELMFLAGS=-s
%ifnarch %{auxarches}
cd build-%{nptl_target_cpu}-linuxnptl && \
cd build-%{target} && \
make %{?_smp_mflags} install_root=$RPM_BUILD_ROOT install-locales -C ../localedata objdir=`pwd` && \
cd ..
%endif
@ -428,7 +429,7 @@ ln -sf `basename $RPM_BUILD_ROOT/%{_lib}/rtkaio/librtkaio-*.so` $RPM_BUILD_ROOT/
%define nosegneg_subdir_base i686
%define nosegneg_subdir i686/nosegneg
%define nosegneg_subdir_up ../..
cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
cd build-%{target}-nosegneg
destdir=$RPM_BUILD_ROOT/%{_lib}/%{nosegneg_subdir}
mkdir -p $destdir
for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
@ -436,7 +437,7 @@ do
libbase=${lib#*/}
libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so)
# Only install if different from base lib
if cmp -s ${lib}.so ../build-%{nptl_target_cpu}-linuxnptl/${lib}.so; then
if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then
ln -sf %{nosegneg_subdir_up}/$libbaseso $destdir/$libbaseso
else
cp -a ${lib}.so $destdir/$libbaseso
@ -447,7 +448,7 @@ done
destdir=$RPM_BUILD_ROOT/%{_lib}/rtkaio/%{nosegneg_subdir}
mkdir -p $destdir
librtkaioso=$(basename $RPM_BUILD_ROOT/%{_lib}/librt-*.so | sed s/librt-/librtkaio-/)
if cmp -s rtkaio/librtkaio.so ../build-%{nptl_target_cpu}-linuxnptl/rtkaio/librtkaio.so; then
if cmp -s rtkaio/librtkaio.so ../build-%{target}/rtkaio/librtkaio.so; then
ln -s %{nosegneg_subdir_up}/$librtkaioso $destdir/$librtkaioso
else
cp -a rtkaio/librtkaio.so $destdir/$librtkaioso
@ -458,7 +459,7 @@ cd ..
%endif
%if %{buildpower6}
cd build-%{nptl_target_cpu}-linuxnptl-power6
cd build-%{target}-power6
destdir=$RPM_BUILD_ROOT/%{_lib}/power6
mkdir -p ${destdir}
for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
@ -536,7 +537,7 @@ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
chmod 644 $RPM_BUILD_ROOT%{_prefix}/%{_lib}/gconv/gconv-modules.cache
# Install the upgrade program
install -m 700 build-%{nptl_target_cpu}-linuxnptl/glibc_post_upgrade.%{_target_cpu} \
install -m 700 build-%{target}/glibc_post_upgrade.%{_target_cpu} \
$RPM_BUILD_ROOT/usr/sbin/glibc_post_upgrade.%{_target_cpu}
strip -g $RPM_BUILD_ROOT%{_prefix}/%{_lib}/*.o
@ -558,9 +559,9 @@ pushd ${RPM_BUILD_ROOT}%{_prefix}/lib/locale
rm locale-archive || :
# Intentionally we do not pass --alias-file=, aliases will be added
# by build-locale-archive.
$olddir/build-%{nptl_target_cpu}-linuxnptl/elf/ld.so \
--library-path $olddir/build-%{nptl_target_cpu}-linuxnptl/ \
$olddir/build-%{nptl_target_cpu}-linuxnptl/locale/localedef \
$olddir/build-%{target}/elf/ld.so \
--library-path $olddir/build-%{target}/ \
$olddir/build-%{target}/locale/localedef \
--prefix ${RPM_BUILD_ROOT} --add-to-archive \
*_*
rm -rf *_*
@ -688,13 +689,13 @@ touch -r sunrpc/etc.rpc $RPM_BUILD_ROOT/etc/rpc
cd fedora
$GCC -Os -g -static -o build-locale-archive build-locale-archive.c \
../build-%{nptl_target_cpu}-linuxnptl/locale/locarchive.o \
../build-%{nptl_target_cpu}-linuxnptl/locale/md5.o \
../build-%{target}/locale/locarchive.o \
../build-%{target}/locale/md5.o \
-DDATADIR=\"%{_datadir}\" -DPREFIX=\"%{_prefix}\" \
-L../build-%{nptl_target_cpu}-linuxnptl
-L../build-%{target}
install -m 700 build-locale-archive $RPM_BUILD_ROOT/usr/sbin/build-locale-archive
$GCC -Os -g -static -o tzdata-update tzdata-update.c \
-L../build-%{nptl_target_cpu}-linuxnptl
-L../build-%{target}
install -m 700 tzdata-update $RPM_BUILD_ROOT/usr/sbin/tzdata-update
cd ..
@ -726,7 +727,7 @@ ln -sf /%{_lib}/ld-linux-ia64.so.2 $RPM_BUILD_ROOT/lib/ld-linux-ia64.so.2
export TIMEOUTFACTOR=16
parent=$$
echo ====================TESTING=========================
cd build-%{nptl_target_cpu}-linuxnptl
cd build-%{target}
( make %{?_smp_mflags} -k check PARALLELMFLAGS=-s 2>&1
sleep 10s
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
@ -735,7 +736,7 @@ cd build-%{nptl_target_cpu}-linuxnptl
cd ..
%if %{buildxen}
echo ====================TESTING -mno-tls-direct-seg-refs=============
cd build-%{nptl_target_cpu}-linuxnptl-nosegneg
cd build-%{target}-nosegneg
( make %{?_smp_mflags} -k check PARALLELMFLAGS=-s 2>&1
sleep 10s
teepid="`ps -eo ppid,pid,command | awk '($1 == '${parent}' && $3 ~ /^tee/) { print $2 }'`"
@ -745,7 +746,7 @@ cd ..
%endif
%if %{buildpower6}
echo ====================TESTING -mcpu=power6=============
cd build-%{nptl_target_cpu}-linuxnptl-power6
cd build-%{target}-power6
( if [ -d ../power6emul ]; then
export LD_PRELOAD=`cd ../power6emul; pwd`/\$LIB/power6emul.so
fi
@ -1034,6 +1035,18 @@ rm -f *.filelist*
%endif
%changelog
* Sun Dec 19 2011 Jeff Law <law@redhat.com> - 2.13-3
- Check values from TZ file header (#767696)
* Thu Aug 4 2011 Andreas Schwab <schwab@redhat.com> - 2.13-2
- Update from 2.13 branch
- Fix static linking with checking x86/x86-64 memcpy (BZ#12653)
- Fix passing symbol value to pltexit callbacks when ld.so auditing
- Fix range error handling in sgetspent
- Fix ordering of DSO constructors and destructors (BZ#11724)
- Use eabi for arm
* Tue Jan 18 2011 Andreas Schwab <schwab@redhat.com> - 2.13-1
- Update to 2.13 release
- Define AT_NO_AUTOMOUNT

View File

@ -1,3 +1,3 @@
3d1e20fbe27dde9a14fd577e5e7d68dc glibc-2.13-fedora.tar.xz
cc5d8b1b994fb3b870222565c79853ca glibc-2.13.tar.xz
62a6f9e2a8d2afb66f7672a2b9a6315c glibc-ports-2.12-54-gbd44238.tar.xz
7007d80c5f3662144ed3c6b9c3b5ca7b glibc-2.13-13-g943515f-fedora.tar.xz
031fd2f729b8d82d785e4836ca3f1b11 glibc-2.13-13-g943515f.tar.xz
df0232b232d7f9b3b2e9882fb85b611c glibc-ports-2.13-5-g4f32a56.tar.xz