All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: George Dunlap <george.dunlap@citrix.com>, xen-devel@lists.xenproject.org
Cc: Ian Jackson <ian.jackson@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v3 09/12] fuzz/x86_emulate: Make input more compact
Date: Tue, 10 Oct 2017 18:31:03 +0100	[thread overview]
Message-ID: <25d23288-0203-3db6-998c-1045219b8cf9@citrix.com> (raw)
In-Reply-To: <49646fb3-c5bf-91fe-8ee7-a8ca5fcea68f@citrix.com>

On 10/10/17 18:13, George Dunlap wrote:
> On 10/10/2017 06:11 PM, Andrew Cooper wrote:
>> On 10/10/17 18:01, George Dunlap wrote:
>>> On 10/10/2017 05:59 PM, Andrew Cooper wrote:
>>>> On 10/10/17 17:20, George Dunlap wrote:
>>>>> At the moment, AFL reckons that for any given input, 87% of it is
>>>>> completely irrelevant: that is, it can change it as much as it wants
>>>>> but have no impact on the result of the test; and yet it can't remove
>>>>> it.
>>>>>
>>>>> This is largely because we interpret the blob handed to us as a large
>>>>> struct, including CR values, MSR values, segment registers, and a full
>>>>> cpu_user_regs.
>>>>>
>>>>> Instead, modify our interpretation to have a "set state" stanza at the
>>>>> front.  Begin by reading a 16-bit value; if it is lower than a certain
>>>>> threshold, set some state according to what byte it is, and repeat.
>>>>> Continue until the byte is above a certain threshold.
>>>>>
>>>>> This allows AFL to compact any given test case much smaller; to the
>>>>> point where now it reckons there is not a single byte of the test file
>>>>> which becomes irrelevant.  Testing have shown that this option both
>>>>> allows AFL to reach coverage much faster, and to have a total coverage
>>>>> higher than with the old format.
>>>>>
>>>>> Make this an option (rather than a unilateral change) to enable
>>>>> side-by-side performance comparison of the old and new formats.
>>>>>
>>>>> Signed-off-by: George Dunlap <george.dunlap@citrix.com>
>>>> I am still of the opinion that this is a waste of effort, which would be
>>>> better spent actually removing the irrelevant state in the first place;
>>>> not building an obfuscation algorithm.
>>>>
>>>> I'm not going to nack the patch because that is probably over the top,
>>>> but I'm not in favour if this change going in.
>>> Did you look at the evidence I presented, demonstrating that this
>>> significantly increases the effectiveness of AFL?
>> I can easily believe that you've found an obfucation algorithm which
>> does better than the current state layout.
>>
>> I do not believe that any amount of obfuscation will be better than
>> actually fixing the root cause of the problem; that the current state
>> really is mostly irrelevant, and can easily be shrunk.
> Right; well I've already explained why I don't think "obfuscation" is
> the right term.

How else would describe it?  You are purposefully hiding the structure
of the data by doing conditional initialisation based on earlier values.

> For the time being, we have something which improves
> efficiency;

How much of this measured efficiently is actually ALF finding paths
around setup_state() rather than finding new paths in the emulator
itself?  I can't think of a test which would isolate this properly.

> let's check it in now, and in the future if you or someone
> else finds a way to fix it "properly" we can do that.

I wouldn't really mind so much if this change didn't make it harder to
fix the root cause.  As it is, your prerequisite patch prohibits any
ability to overlay a minimal structure over the fuzzing corpus.

~Andrew

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

  reply	other threads:[~2017-10-11  2:39 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10 16:20 [PATCH v3 01/12] fuzz/x86_emulate: Clear errors after each iteration George Dunlap
2017-10-10 16:20 ` [PATCH v3 02/12] fuzz/x86_emulate: Improve failure descriptions in x86_emulate harness George Dunlap
2017-10-10 16:20 ` [PATCH v3 03/12] fuzz/x86_emulate: Implement input_read() and input_avail() George Dunlap
2017-10-10 16:52   ` Andrew Cooper
2017-10-10 17:24   ` Ian Jackson
2017-10-10 16:20 ` [PATCH v3 04/12] fuzz/x86_emulate: Rename the file containing the wrapper code George Dunlap
2017-10-11  9:03   ` Jan Beulich
2017-10-10 16:20 ` [PATCH v3 05/12] fuzz/x86_emulate: Add 'afl-cov' target George Dunlap
2017-10-10 16:53   ` Andrew Cooper
2017-10-10 16:20 ` [PATCH v3 06/12] fuzz/x86_emulate: Take multiple test files for inputs George Dunlap
2017-10-10 16:56   ` Andrew Cooper
2017-10-10 16:58     ` George Dunlap
2017-10-10 17:56       ` Andrew Cooper
2017-10-10 16:20 ` [PATCH v3 07/12] fuzz/x86_emulate: Move all state into fuzz_state George Dunlap
2017-10-10 18:20   ` Andrew Cooper
2017-10-11 11:30     ` George Dunlap
2017-10-11 14:50       ` George Dunlap
2017-10-10 16:20 ` [PATCH v3 08/12] fuzz/x86_emulate: Move definitions into a header George Dunlap
2017-10-10 17:25   ` Ian Jackson
2017-10-11  9:09     ` Jan Beulich
2017-10-10 16:20 ` [PATCH v3 09/12] fuzz/x86_emulate: Make input more compact George Dunlap
2017-10-10 16:59   ` Andrew Cooper
2017-10-10 17:01     ` George Dunlap
2017-10-10 17:11       ` Andrew Cooper
2017-10-10 17:13         ` George Dunlap
2017-10-10 17:31           ` Andrew Cooper [this message]
2017-10-10 20:55             ` George Dunlap
2017-10-10 17:26   ` Ian Jackson
2017-10-10 18:57     ` George Dunlap
2017-10-11  9:18   ` Jan Beulich
2017-10-10 16:20 ` [PATCH v3 10/12] fuzz/x86_emulate: Add --rerun option to try to track down instability George Dunlap
2017-10-10 18:44   ` Andrew Cooper
2017-10-11  9:20     ` Jan Beulich
2017-10-11 15:56     ` George Dunlap
2017-10-10 16:20 ` [PATCH v3 11/12] fuzz/x86_emulate: Set and fuzz more CPU state George Dunlap
2017-10-11  9:31   ` Jan Beulich
2017-10-11 16:52     ` George Dunlap
2017-10-12  9:58       ` Jan Beulich
2017-10-10 16:20 ` [PATCH v3 12/12] fuzz/x86_emulate: Add an option to limit the number of instructions executed George Dunlap
2017-10-11  9:34   ` Jan Beulich
2017-10-10 16:47 ` [PATCH v3 01/12] fuzz/x86_emulate: Clear errors after each iteration George Dunlap
2017-10-10 16:47   ` Andrew Cooper
2017-10-11  8:59   ` Jan Beulich
2017-10-10 17:22 ` Ian Jackson
2017-10-11  9:00   ` Jan Beulich

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=25d23288-0203-3db6-998c-1045219b8cf9@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=jbeulich@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.