Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-11 Thread Marco Elver
On Fri, 11 Sep 2020 at 15:33, Marco Elver wrote: > On Fri, 11 Sep 2020 at 15:10, Dmitry Vyukov wrote: > > On Fri, Sep 11, 2020 at 2:03 PM Marco Elver wrote: > > > On Fri, 11 Sep 2020 at 09:36, Dmitry Vyukov wrote: > [...] > > > > By "reasonable" I mean if the pool will last long enough to

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-11 Thread Marco Elver
On Fri, 11 Sep 2020 at 15:10, Dmitry Vyukov wrote: > On Fri, Sep 11, 2020 at 2:03 PM Marco Elver wrote: > > On Fri, 11 Sep 2020 at 09:36, Dmitry Vyukov wrote: [...] > > > By "reasonable" I mean if the pool will last long enough to still > > > sample something after hours/days? Have you tried

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-11 Thread Dmitry Vyukov
On Fri, Sep 11, 2020 at 2:03 PM Marco Elver wrote: > > On Fri, 11 Sep 2020 at 09:36, Dmitry Vyukov wrote: > > On Tue, Sep 8, 2020 at 5:56 PM Marco Elver wrote: > > > On Tue, Sep 08, 2020 at 05:36PM +0200, Vlastimil Babka wrote: > [...] > > > > Hmm did you observe that with this limit, a

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-11 Thread Marco Elver
On Fri, 11 Sep 2020 at 09:36, Dmitry Vyukov wrote: > On Tue, Sep 8, 2020 at 5:56 PM Marco Elver wrote: > > On Tue, Sep 08, 2020 at 05:36PM +0200, Vlastimil Babka wrote: [...] > > > Hmm did you observe that with this limit, a long-running system would > > > eventually > > > converge to KFENCE

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-11 Thread Dmitry Vyukov
On Tue, Sep 8, 2020 at 5:56 PM Marco Elver wrote: > > On Tue, Sep 08, 2020 at 05:36PM +0200, Vlastimil Babka wrote: > > On 9/8/20 5:31 PM, Marco Elver wrote: > > >> > > >> How much memory overhead does this end up having? I know it depends on > > >> the object size and so forth. But, could you

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Marco Elver
On Tue, Sep 08, 2020 at 04:40PM +0200, Vlastimil Babka wrote: > On 9/8/20 2:16 PM, Alexander Potapenko wrote: > >> Toggling a static branch is AFAIK quite disruptive (PeterZ will probably > >> tell > >> you better), and with the default 100ms sample interval, I'd think it's > >> not good > >> to

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Vlastimil Babka
On 9/8/20 2:16 PM, Alexander Potapenko wrote: >> Toggling a static branch is AFAIK quite disruptive (PeterZ will probably tell >> you better), and with the default 100ms sample interval, I'd think it's not >> good >> to toggle it so often? Did you measure what performance would you get, if the >>

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Vlastimil Babka
On 9/8/20 5:31 PM, Marco Elver wrote: >> >> How much memory overhead does this end up having? I know it depends on >> the object size and so forth. But, could you give some real-world >> examples of memory consumption? Also, what's the worst case? Say I >> have a ton of worst-case-sized (32b)

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Marco Elver
On Tue, Sep 08, 2020 at 07:52AM -0700, Dave Hansen wrote: > On 9/7/20 6:40 AM, Marco Elver wrote: > > KFENCE is designed to be enabled in production kernels, and has near > > zero performance overhead. Compared to KASAN, KFENCE trades performance > > for precision. > > Could you talk a little

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Alexander Potapenko
> Toggling a static branch is AFAIK quite disruptive (PeterZ will probably tell > you better), and with the default 100ms sample interval, I'd think it's not > good > to toggle it so often? Did you measure what performance would you get, if the > static key was only for long-term toggling the

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Marco Elver
On Tue, Sep 08, 2020 at 05:36PM +0200, Vlastimil Babka wrote: > On 9/8/20 5:31 PM, Marco Elver wrote: > >> > >> How much memory overhead does this end up having? I know it depends on > >> the object size and so forth. But, could you give some real-world > >> examples of memory consumption?

Re: [PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-08 Thread Vlastimil Babka
On 9/7/20 3:40 PM, Marco Elver wrote: > This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE is a > low-overhead sampling-based memory safety error detector of heap > use-after-free, invalid-free, and out-of-bounds access errors. This > series enables KFENCE for the x86 and arm64

[PATCH RFC 00/10] KFENCE: A low-overhead sampling-based memory safety error detector

2020-09-07 Thread Marco Elver
This adds the Kernel Electric-Fence (KFENCE) infrastructure. KFENCE is a low-overhead sampling-based memory safety error detector of heap use-after-free, invalid-free, and out-of-bounds access errors. This series enables KFENCE for the x86 and arm64 architectures, and adds KFENCE hooks to the