Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1314948
| From | Dmitry Vyukov <dvyukov@google.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] kernel: add kcov code coverage |
| Date | 2016-01-22 13:20 +0100 |
| Message-ID | <qTIR5-3TR-33@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <qRdeG-7bt-15@gated-at.bofh.it> <qSiP0-1Nw-11@gated-at.bofh.it> <qSnYm-5eq-21@gated-at.bofh.it> <qSoro-5DG-13@gated-at.bofh.it> <qTIxI-3xw-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Jan 22, 2016 at 12:55 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> On Mon, Jan 18, 2016 at 09:09:43PM +0100, Dmitry Vyukov wrote:
>> On Mon, Jan 18, 2016 at 8:44 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>> > I've got several comments regarding the 4-byte compressed PCs. We've
>> > also discussed this internally.
>> > As the result in v4 I made it possible to export both compressed
>> > 4-byte PCs and full 8-byte PCs.
>> > Now init ioctl accepts the following struct and kernel can say whether
>> > it will export 4- or 8-byte PCs:
>> >
>> > struct kcov_init_trace {
>> > unsigned long flags; /* In: reserved, must be 0. */
>> > unsigned long size; /* In: trace buffer size. */
>> > unsigned long version; /* Out: trace format, currently 1. */
>> > /*
>> > * Output.
>> > * pc_size can be 4 or 8. If pc_size = 4 on a 64-bit arch,
>> > * returned PCs are compressed by subtracting pc_base and then
>> > * truncating to 4 bytes.
>> > */
>> > unsigned long pc_size;
>> > unsigned long pc_base;
>> > };
>> >
>> > So for KASLR or other archs we can just export full 8-byte PCs.
>> >
>> > Regarding KASLR and dynamically loaded modules. I've looked at my
>> > use-case and concluded
>> > that most of the time I can work with "non-stable" PCs within a single
>> > VM. Whenever I need to
>> > store PCs persistently or send to another machine, I think I can
>> > "canonicalize" PCs using
>> > /proc/modules and /proc/kallsyms to something like (module hash,
>> > module offset). So kernel does
>> > not need to do this during coverage collection.
>>
>> On second though, maybe it's better to just always export unsigned long PCs...
>> Need to measure how much memory coverage information consumes,
>> and how much slower it is with uint64 PCs. Maybe I can live with large PCs,
>> or maybe I can make syzkaller require !KASLR and compress PCs in user-space...
>> Need to think about this more.
>
> I can imagine we might keep the expanded module range even in the
> absence of full KASLR, though I don't know how realistic that thought
> is.
The last version of the patch just exposes PCs as unsigned longs
without any compression. So it should not be a problem (at least for
kernel, now it's user responsibility to make sense out of the PCs).
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v2] kernel: add kcov code coverage Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-01-15 14:10 +0100
Re: [PATCH v2] kernel: add kcov code coverage Will Deacon <will.deacon@arm.com> - 2016-01-15 14:50 +0100
Re: [PATCH v2] kernel: add kcov code coverage Dmitry Vyukov <dvyukov@google.com> - 2016-01-15 15:10 +0100
Re: [PATCH v2] kernel: add kcov code coverage Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2016-01-18 14:40 +0100
Re: [PATCH v2] kernel: add kcov code coverage Dmitry Vyukov <dvyukov@google.com> - 2016-01-18 20:40 +0100
Re: [PATCH v2] kernel: add kcov code coverage Mark Rutland <mark.rutland@arm.com> - 2016-01-18 15:20 +0100
Re: [PATCH v2] kernel: add kcov code coverage Dmitry Vyukov <dvyukov@google.com> - 2016-01-18 20:50 +0100
Re: [PATCH v2] kernel: add kcov code coverage Dmitry Vyukov <dvyukov@google.com> - 2016-01-18 21:20 +0100
Re: [PATCH v2] kernel: add kcov code coverage Mark Rutland <mark.rutland@arm.com> - 2016-01-22 13:00 +0100
Re: [PATCH v2] kernel: add kcov code coverage Dmitry Vyukov <dvyukov@google.com> - 2016-01-22 13:20 +0100
Re: [PATCH v2] kernel: add kcov code coverage Mark Rutland <mark.rutland@arm.com> - 2016-01-22 14:00 +0100
csiph-web