Open dvyukov opened 5 years ago
A related issue #197
Some more repro quality complaints:
I'll note that some of the unnecessary garbage, such as setting up and tearing
down a wireguard tunnel, or some other irrelevant cgroup setup, seems to be
templated code. Why can't it be well-commented code which uses real variables
and structures, as opposed to filling in a char * array and passing a pointer
to an ioctl using a number as opposed to a symbolic name? Since it's
auto-generated code, surely it wouldn't be that hard to have the template be in
human-readable C as opposed to only-a-step-above-machine-language C code?
It also looks like our minimization does not always reliably remove unnecessary calls.
I have very often removed things such as a wireguard networking tunnel
setup/teardown when the stack trace was in ext4, and the bug turned out to be
not some kind of race or locking deadlock, but just a badly corrupted metadata
block for which the file system wasn't sufficiently paranoid. Why couldn't
automation have figured this out for me?
Could it be related to the cases when the repro is not 100% reliable? Even if it's 90% reliable, it could already prevent normal minimization from happening.
Maybe repeat each test run during minimization several times and go forward if it's crashed at least once?
We remove the network device setup in very coarse-grained way (either remove all of it, or leave all of it). Likely 1 bit of it was needed and we kept all of it. Currently it's quite hard to make it finer-grained (also non-scalable and each new piece worsens the code). I've attempted to rework features support in syzkaller, but never managed to finish: https://github.com/dvyukov/syzkaller/commits/dvyukov-features-prepare https://github.com/dvyukov/syzkaller/commit/fc4b8fb553764bcbaabfbca4fbff806d4c558b12
cc @FlorentRevest
Other possible improvements for C reproducers:
Move test syscalls to the top of the reproducer (may require some forward declarations). The syscalls is the varying part, these are usually more interesting than large static template parts.
Move large binary blobs out-of-line. Namely, instead of memcpy(0x..., huge binary blob here)
, do something like:
const char image1[123456];
...
memcpy(0x..., image1, sizeof(image1));
...
// at the bottom of the file:
const char image1[] = "...huge binary blob here...";
Some suggestions from the mailing list by Eric and Tetsuo: