mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Konstantin Serebryany <konstantin.s.serebryany@gmail.com>
To: Konstantin Serebryany <konstantin.s.serebryany@gmail.com>,
	Rich Felker <dalias@libc.org>,
	 musl@lists.openwall.com
Subject: Re: buffer overflow in regcomp and a way to find more of those
Date: Mon, 23 Mar 2015 08:56:32 -0700	[thread overview]
Message-ID: <CAGQ9bdwFPUtWY-Wg5g93oNmSJst+tZmw=75C3jP5aD3aaMJ+jw@mail.gmail.com> (raw)
In-Reply-To: <20150323122553.GO16260@port70.net>

On Mon, Mar 23, 2015 at 5:25 AM, Szabolcs Nagy <nsz@port70.net> wrote:
> * Konstantin Serebryany <konstantin.s.serebryany@gmail.com> [2015-03-22 22:02:48 -0700]:
>> On Sat, Mar 21, 2015 at 2:03 PM, Szabolcs Nagy <nsz@port70.net> wrote:
>> > i wrote some trivial test cases for
>> >
>> > __dn_expand
>> > __dns_parse
>> > __pleval
>> > fnmatch
>> > inet_pton
>> > strptime
>>
>> Cool! Is there something you plan to have in the repository or share
>> some other way?
>>
>
> (musl does not have extra tools/docs/tests in the main repo,
> this is what you want eg for toolchain builds and packaging)
>
> but i plan to release the tests somewhere
> (currently they just trivial calls into the relevant libc function)
>
> i don't know what's the best way to fuzz more than one argument
> eg fnmatch(pattern, string, flags)

Yes, splitting the input bytes between the args is the most
straightforward way.
Although sharing the input bytes (e.g. fnmatch(X, X, X[0])) was
surprisingly interesting too.

>
> is it ok to just split the input data between the args?
> (i havent looked under the hood how the fuzzer mutates the input)
>
>> > #27461772       NEW: 548 B: 0 L: 16 S: 22 I: 0  8283::2:2.8.83.3        16: 56 50 56 51 58 58 50 58 50 46 56 46 56 51 46 51
>> > #27469404       NEW: 549 B: 0 L: 24 S: 23 I: 2  8283::2:283:2.8.83.2.833        24: 56 50 56 51 58 58 50 58 50 56 51 58 50 46 56 46 56 51 46 50 46 56 51 51
>> > Bus error (core dumped)
>> >
>> > is there a way to get a reproducer after such a crash?
>> >
>>
>> the fuzzer relies on asan to call at-crash handler -- this is what
>> __sanitizer_set_death_callback is for.
>> w/o asan you can set up a signal handler that will print
>> fuzzer::Fuzzer::CurrentUnit.
>> If everything else fails you can of course re-rerun the fuzzer with
>> the same seed.
>>
>
> thanks, sounds good
>


  reply	other threads:[~2015-03-23 15:56 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 20:17 Konstantin Serebryany
2015-03-20 20:40 ` Rich Felker
2015-03-20 21:28 ` Szabolcs Nagy
2015-03-20 23:48   ` Szabolcs Nagy
2015-03-20 22:32 ` Rich Felker
2015-03-20 23:52 ` Szabolcs Nagy
2015-03-21  0:06   ` Konstantin Serebryany
2015-03-21  0:26     ` Szabolcs Nagy
2015-03-21  0:46       ` Rich Felker
2015-03-21  0:54         ` Konstantin Serebryany
2015-03-21  1:00           ` Rich Felker
2015-03-21  1:05             ` Konstantin Serebryany
2015-03-21  1:10               ` Konstantin Serebryany
2015-03-21  1:23                 ` Szabolcs Nagy
2015-03-21  1:30                   ` Rich Felker
2015-03-21  2:10                     ` Szabolcs Nagy
2015-03-21  2:17                       ` Rich Felker
2015-03-21  1:32               ` Rich Felker
2015-03-21  1:37                 ` Konstantin Serebryany
2015-03-21  1:56                   ` Rich Felker
2015-03-21  2:14                     ` Konstantin Serebryany
2015-03-21  2:20                       ` Rich Felker
2015-03-21  6:05                         ` Konstantin Serebryany
2015-03-21 13:28                           ` Szabolcs Nagy
2015-03-21 21:03                             ` Szabolcs Nagy
2015-03-21 21:38                               ` Szabolcs Nagy
2015-03-21 22:13                                 ` Szabolcs Nagy
2015-03-22  6:36                                   ` Justin Cormack
2015-03-23  5:02                               ` Konstantin Serebryany
2015-03-23 12:25                                 ` Szabolcs Nagy
2015-03-23 15:56                                   ` Konstantin Serebryany [this message]
2015-03-23  4:55                             ` Konstantin Serebryany
2015-03-23 12:35                               ` Szabolcs Nagy
2015-03-23 14:40                                 ` stephen Turner
2015-03-23 14:53                                   ` Szabolcs Nagy
2015-03-23 15:46                                     ` stephen Turner
2015-03-23 16:28                                       ` Rich Felker
2015-03-23 17:21                                         ` Nathan McSween
2015-03-28 22:00                                 ` Szabolcs Nagy
2015-03-28 22:32                                   ` Konstantin Serebryany
2015-03-28 22:38                                     ` Rich Felker
2015-03-28 23:15                                       ` Szabolcs Nagy

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='CAGQ9bdwFPUtWY-Wg5g93oNmSJst+tZmw=75C3jP5aD3aaMJ+jw@mail.gmail.com' \
    --to=konstantin.s.serebryany@gmail.com \
    --cc=dalias@libc.org \
    --cc=musl@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).