public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug locale/28650] New: localedef(1) aborts or crashes on wrong locale-archive
@ 2021-12-05 14:45 aurelien at aurel32 dot net
  2021-12-09 22:33 ` [Bug locale/28650] " aurelien at aurel32 dot net
  0 siblings, 1 reply; 2+ messages in thread
From: aurelien at aurel32 dot net @ 2021-12-05 14:45 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28650

            Bug ID: 28650
           Summary: localedef(1) aborts or crashes on wrong locale-archive
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: locale
          Assignee: unassigned at sourceware dot org
          Reporter: aurelien at aurel32 dot net
  Target Milestone: ---

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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug locale/28650] localedef(1) aborts or crashes on wrong locale-archive
  2021-12-05 14:45 [Bug locale/28650] New: localedef(1) aborts or crashes on wrong locale-archive aurelien at aurel32 dot net
@ 2021-12-09 22:33 ` aurelien at aurel32 dot net
  0 siblings, 0 replies; 2+ messages in thread
From: aurelien at aurel32 dot net @ 2021-12-09 22:33 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28650

Aurelien Jarno <aurelien at aurel32 dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
            Version|unspecified                 |2.35
             Status|NEW                         |RESOLVED

--- Comment #1 from Aurelien Jarno <aurelien at aurel32 dot net> ---
Fixed for 2.35 by:

commit cbab7f726877badc5059316e7248be7c3bff9d96
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Dec 5 11:51:17 2021 +0100

    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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-05 14:45 [Bug locale/28650] New: localedef(1) aborts or crashes on wrong locale-archive aurelien at aurel32 dot net
2021-12-09 22:33 ` [Bug locale/28650] " aurelien at aurel32 dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).