Re: perf_fuzzer compiled for x32 causes reboot

From: Vince Weaver
Date: Mon Feb 24 2014 - 10:33:43 EST


On Sun, 23 Feb 2014, H. Peter Anvin wrote:

> So we do a write to the buffer rather immediately before this happens,
> and in particular that will update the head:
>
> rb->user_page->data_head = head;
>
> However, that doesn't explain what is going on and in particular the
> write to whatever address was in %rbp. The rest pretty much seems to be
> the page fault logic.

It turns out you don't even have to over-write rb->user_page->data_head.
Just touching the mmap page with a write of a single byte (it doesn't
matter where) is enough to trigger the bug.

This is a pain to track down, it would be easier if I could get a
replayable syscall trace, but even though the segfault is very
reproducible with my fuzzer, it's very sensitive to extra syscalls in the
trace path and the fuzzer logger/replayer path has a different number of
write syscalls and won't trigger the problem.

> Incidentally, I doubt that this is x32-related in any way; there seems
> to be absolutely no difference between x86-64 perf and x32 perf; more
> likely it just makes the error more reproducible because the address
> space is so much smaller.

quite possibly. I only began chasing the problem because when compiled
for x32 this bug apparently will reboot the machine now and then (not just
segfault the program). I never saw that failure mode with x86_64, but
again maybe it's just easier to hit with the reduced address space as you
say.

Vince
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/