mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: oss-security@lists.openwall.com
Cc: musl@lists.openwall.com
Subject: Stack-based buffer overflow in musl libc 0.8.7 and earlier
Date: Wed, 18 Apr 2012 02:32:58 -0400	[thread overview]
Message-ID: <20120418063258.GA32320@brightrain.aerifal.cx> (raw)

Name: Stack-based buffer overflow in musl libc 0.8.7 and earlier
Software: musl 0.8.7 and earlier
Software link:  http://www.etalabs.net/musl
Vulnerability Type: Buffer overflow
Severity: Critical

Software Description:

musl is an implementation of the C/POSIX standard library for
Linux-based systems. musl aims to be lightweight, fast, simple, free,
and correct in the sense of standards-conformance and safety, and to
meet requirements ranging from embedded systems and initrd images to
desktop workstations, mobile devices, and high-load servers. Several
build-from-source mini-distributions use musl as their C library.

Vulnerability Details:

musl's implementation of [v]fprintf swaps in a temporary FILE buffer
on the stack when writing to unbuffered streams such as stderr. Under
certain conditions where the buffer end pointer has already been set
to the address of the internal degenerate buffer prior to the call to
[v]fprintf, stdio internals can fail to bound access to the temporary
buffer. Large writes will then overflow the temporary buffer and
clobber stack contents, including potentially the return address. Any
program linked to musl which includes potentially-large data from
untrusted sources in its output to stderr or other unbuffered streams
is affected.

Solution:

The vulnerability has been fixed in git, and the fix is to be included
in the upcoming 0.8.8 release. A patch which applies cleanly to all
recent releases is available on the musl mailing list:

http://www.openwall.com/lists/musl/2012/04/17/1

Credits:

This vulnerability was discovered and fixed by the author (myself,
Rich Felker) while debugging a crash occurring in test code written
for musl by Luka Marčetić as part of GSoC 2011.


             reply	other threads:[~2012-04-18  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18  6:32 Rich Felker [this message]
     [not found] ` <20120418063258.GA32320-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2012-04-18 17:06   ` Kurt Seifried

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120418063258.GA32320@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    --cc=oss-security@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).