xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Semel <semelpaul@gmail.com>
To: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, wei.liu2@citrix.com, JBeulich@suse.com
Subject: Re: [PATCH] fuzz/x86_emulate: fix bounds for input size
Date: Fri, 23 Feb 2018 13:07:10 +0100	[thread overview]
Message-ID: <499e741c-f98d-6658-c479-5a9748d98c1a@gmail.com> (raw)
In-Reply-To: <ff5d4891-1e00-6e8b-aa7b-b874e60e422d@citrix.com>



On 02/23/2018 11:44 AM, George Dunlap wrote:
> Paul, thanks for reporting this!  A couple of comments...
> 
> On 02/22/2018 11:57 PM, Paul Semel wrote:
>> The minimum size for the input size was set to DATA_OFFSET + 1 which was meaning
>> that we were requesting at least one character of the data array to be filled.
>> This is not needed for the fuzzer to get working correctly.
> 
> Sure, but then the emulator will fail the first insn_fetch() callback.
> I understand there's a conceptual purity to testing such an input, but
> is it actually of practical value in finding bugs?
> 

Actually, if you really want to find bugs, you *really* want AFL to have 
control over the whole data field.

>> The maximum size for the input size was set to INPUT_SIZE, which is actually
>> the size of the data array inside the fuzz_corpus structure and so was not
>> abling user (or AFL) to fill in the whole structure. Changing to
>> sizeof(struct fuzz_corpus) correct this problem.
> 
> Good catch; actually INPUT_SIZE is a misnomer; this should really be
> DATA_SIZE.
> 
> I think it's arguable whether the better thing to do there would be to
> take your approach, of extending the accepted input size to fit the
> initial state + data size, or the other approach, of restricting the
> size of the data[] array such that the total structure size doesn't
> exceed our desired INPUT_SIZE (currently 4k).  The first bit of advice
> in `perf_tips.txt` for AFL is "Keep your test cases small", so I'd be
> inclined to go with the second.
> 

I would also go for the second, as I'm pretty sure we're not using the 
whole buffer in one run.

> But in any case, I'm in the process of reworking how the input works;
> you can see the last patch posted here:
> 
> https://marc.info/?l=xen-devel&m=150774448513434
> 

I took a look at your patch, it look really good. The only thing is that 
I think it might be more relevent to also have an option to get the 
maximum input, as I think it's the better way to find bugs as mentionned 
earlier ! 🙂

> I haven't taken a close look but I think it as a side effect it will fix
> this issue.
> 
>   -George
> 

-- 
Paul Semel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-02-23 12:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 12:39 [xen-devel] [fuzz] [x86 emulator] Input size Paul Semel
2018-02-22 18:00 ` Wei Liu
2018-02-22 23:57   ` [PATCH] fuzz/x86_emulate: fix bounds for input size Paul Semel
2018-02-23  8:20     ` Paul Semel
2018-02-23 10:44     ` George Dunlap
2018-02-23 12:07       ` Paul Semel [this message]
2018-02-23 16:30     ` Wei Liu
2018-02-23 16:33       ` George Dunlap
2018-02-23 16:37         ` Wei Liu
2018-02-23 22:41       ` Paul Semel
2018-02-23 22:48       ` [PATCH v2] " Paul Semel
2018-02-26 10:33         ` Wei Liu
2018-03-02 12:30           ` Wei Liu
2018-02-27 10:39         ` George Dunlap
2018-02-28 17:30           ` Paul Semel

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=499e741c-f98d-6658-c479-5a9748d98c1a@gmail.com \
    --to=semelpaul@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.
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).