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

Bug#772705: libc6: buffer overflow in tzset



Package: libc6
Version: 2.19-13

The attached crafted timezone file makes tzset(3) crash:

$ TZ=$PWD/crashtz date
*** Error in `date': free(): invalid next size (fast): 0x0916b160 ***
Aborted


Valgrind says:

==7754== Invalid write of size 1
==7754==    at 0x40F7D7D: __tzfile_read (tzfile.c:379)
==7754==    by 0x40F71D1: tzset_internal (tzset.c:447)
==7754==    by 0x40F749E: __tz_convert (tzset.c:632)
==7754==    by 0x40F5BDC: localtime (localtime.c:42)
==7754==    by 0x8049B94: ??? (in /bin/date)
==7754==    by 0x8049885: ??? (in /bin/date)
==7754==    by 0x4069A62: (below main) (libc-start.c:287)
==7754==  Address 0x41fe816 is 6 bytes after a block of size 0 alloc'd
==7754==    at 0x40291CC: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==7754==    by 0x40F79A1: __tzfile_read (tzfile.c:278)
==7754==    by 0x40F71D1: tzset_internal (tzset.c:447)
==7754==    by 0x40F749E: __tz_convert (tzset.c:632)
==7754==    by 0x40F5BDC: localtime (localtime.c:42)
==7754==    by 0x8049B94: ??? (in /bin/date)
==7754==    by 0x8049885: ??? (in /bin/date)
==7754==    by 0x4069A62: (below main) (libc-start.c:287)
==7754== ==7754== Invalid write of size 1
==7754==    at 0x40F7DDD: __tzfile_read (tzfile.c:389)
==7754==    by 0x40F71D1: tzset_internal (tzset.c:447)
==7754==    by 0x40F749E: __tz_convert (tzset.c:632)
==7754==    by 0x40F5BDC: localtime (localtime.c:42)
==7754==    by 0x8049B94: ??? (in /bin/date)
==7754==    by 0x8049885: ??? (in /bin/date)
==7754==    by 0x4069A62: (below main) (libc-start.c:287)
==7754==  Address 0x41fe817 is 7 bytes after a block of size 0 alloc'd
==7754==    at 0x40291CC: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==7754==    by 0x40F79A1: __tzfile_read (tzfile.c:278)
==7754==    by 0x40F71D1: tzset_internal (tzset.c:447)
==7754==    by 0x40F749E: __tz_convert (tzset.c:632)
==7754==    by 0x40F5BDC: localtime (localtime.c:42)
==7754==    by 0x8049B94: ??? (in /bin/date)
==7754==    by 0x8049885: ??? (in /bin/date)
==7754==    by 0x4069A62: (below main) (libc-start.c:287)


This bug was found using American fuzzy lop:
http://lcamtuf.coredump.cx/afl/


-- System Information:
Debian Release: 8.0
 APT prefers unstable
 APT policy: (990, 'unstable'), (500, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6:i386 depends on:
ii  libgcc1  1:4.9.2-6

Versions of packages libc6:i386 recommends:
ii  libc6-i686  2.19-13

--
Jakub Wilk

Attachment: crashtz
Description: Binary data


Reply to: