glibc/locale
Aurelien Jarno cbab7f7268 localedef: check magic value on archive load [BZ #28650]
localedef currently blindly trust the archive header. When passed an
archive file with the wrong endianess, this leads to a segmentation
fault:

  $ localedef --big-endian --list-archive /usr/lib/locale/locale-archive
  Segmentation fault (core dumped)

When passed non-archive files, asserts are reported on the best case,
but sometimes it can lead to a segmentation fault:

  $ localedef --list-archive /bin/true
  localedef: programs/locarchive.c:1643: show_archive_content: Assertion `used < GET (head->namehash_used)' failed.
  Aborted (core dumped)

  $ localedef --list-archive /usr/lib/locale/C.utf8/LC_COLLATE
  Segmentation fault (core dumped)

This patch improves the user experience by looking at the magic value,
which is always written, but never checked. It should still be possible
to trigger a segmentation fault with crafted files, but this already
catch many cases.
2021-12-07 23:32:53 +01:00
..
bits Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
programs localedef: check magic value on archive load [BZ #28650] 2021-12-07 23:32:53 +01:00
tst-localedef-path-norm.root localedef: Add verbose messages for failure paths. 2020-04-26 13:55:58 -04:00
broken_cur_max.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C_name.c Update. 2001-04-06 17:49:18 +00:00
C-address.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-collate-seq.c locale: Add missing second argument to _Static_assert in C-collate-seq.c 2021-09-06 19:43:37 +02:00
C-collate.c Add 'codepoint_collation' support for LC_COLLATE. 2021-09-06 11:06:45 -04:00
C-ctype.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-identification.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-measurement.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-messages.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-monetary.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-name.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-numeric.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-paper.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-telephone.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-time.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
C-translit.h.in Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
categories.def Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
coll-lookup.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
coll-lookup.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
duplocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
elem-hash.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
findlocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
freelocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
gen-translit.py get-translit.py: Fix typo 2021-05-11 12:55:45 +05:30
global-locale.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
hashval.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
indigits.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
indigitswc.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
iso-639.def Add mnw language code [BZ #25139] 2019-11-06 08:15:16 +01:00
iso-3166.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
iso-4217.def Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
langinfo.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-address.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-collate.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-ctype.c locale: Use compat_symbol_reference in _nl_postload_ctype 2021-03-25 11:06:58 +01:00
lc-identification.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-measurement.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-messages.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-monetary.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-name.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-numeric.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-paper.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-telephone.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
lc-time.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
loadarchive.c Use 64 bit time_t stat internally 2021-06-22 12:09:52 -03:00
loadlocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
locale.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
localeconv.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
localeinfo.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
localename.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
locarchive.h Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Makefile Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
mb_cur_max.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
newlocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
nl_langinfo_l.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
nl_langinfo.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
outdigits.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
outdigitswc.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
setlocale.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
strlen-hash.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
SYS_libc.c [BZ #284, BZ #721] 2005-02-17 01:19:55 +00:00
tst-C-locale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
tst-duplocale.c Add missing test files. 2009-11-17 16:23:57 -08:00
tst-locale-locpath.sh Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-localedef-path-norm.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
tst-locname.c Add missing test files. 2009-11-17 16:23:57 -08:00
uselocale.c Update copyright dates with scripts/update-copyrights 2021-01-02 12:17:34 -08:00
Versions * sysdeps/ia64/dl-fptr.c (__ia64_make_fptr): Revert last change. 2003-03-03 09:45:25 +00:00
weight.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
weightwc.h Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30
xlocale.c Remove "Contributed by" lines 2021-09-03 22:06:44 +05:30