Re: [PATCH] kfence: unpoison pool region before use

2021-04-05 Thread Peter Collingbourne
On Sat, Apr 3, 2021 at 4:52 PM Andrey Konovalov wrote: > > On Sun, Apr 4, 2021 at 12:31 AM Marco Elver wrote: > > > > However, given the above, I think we need to explain this in the > > commit message (which also makes the dependency between these 2 > > patches clear) and add a comment above the

Re: [PATCH] kfence: unpoison pool region before use

2021-04-04 Thread Andrey Konovalov
On Sun, Apr 4, 2021 at 1:52 AM Andrey Konovalov wrote: > > On Sun, Apr 4, 2021 at 12:31 AM Marco Elver wrote: > > > > However, given the above, I think we need to explain this in the > > commit message (which also makes the dependency between these 2 > > patches clear) and add a comment above the

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Andrey Konovalov
On Sun, Apr 4, 2021 at 12:31 AM Marco Elver wrote: > > However, given the above, I think we need to explain this in the > commit message (which also makes the dependency between these 2 > patches clear) and add a comment above the new kasan_unpoison_range(). > That is, if we still think this is th

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Marco Elver
On Sat, 3 Apr 2021 at 22:40, Peter Collingbourne wrote: > On Sat, Apr 3, 2021 at 3:03 AM Marco Elver wrote: > > On Sat, 3 Apr 2021 at 07:13, Peter Collingbourne wrote: > > > If the memory region allocated by KFENCE had previously been poisoned, > > > any validity checks done using kasan_byte_acc

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Peter Collingbourne
On Sat, Apr 3, 2021 at 3:03 AM Marco Elver wrote: > > On Sat, 3 Apr 2021 at 07:13, Peter Collingbourne wrote: > > If the memory region allocated by KFENCE had previously been poisoned, > > any validity checks done using kasan_byte_accessible() will fail. Fix > > it by unpoisoning the memory befor

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Marco Elver
On Sat, 3 Apr 2021 at 16:05, Andrey Konovalov wrote: ... > Which kasan_byte_accessible() call fails? > > KASAN checks shouldn't be performed for KFENCE objects. We have a > number of is_kfence_address() checks in KASAN runtime, but maybe we're > missing some. Perhaps, we should even move those che

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Andrey Konovalov
On Sat, Apr 3, 2021 at 7:13 AM Peter Collingbourne wrote: > > If the memory region allocated by KFENCE had previously been poisoned, > any validity checks done using kasan_byte_accessible() will fail. Fix > it by unpoisoning the memory before using it as the pool region. Which kasan_byte_accessib

Re: [PATCH] kfence: unpoison pool region before use

2021-04-03 Thread Marco Elver
On Sat, 3 Apr 2021 at 07:13, Peter Collingbourne wrote: > If the memory region allocated by KFENCE had previously been poisoned, > any validity checks done using kasan_byte_accessible() will fail. Fix > it by unpoisoning the memory before using it as the pool region. > > Link: > https://linux-rev

[PATCH] kfence: unpoison pool region before use

2021-04-02 Thread Peter Collingbourne
If the memory region allocated by KFENCE had previously been poisoned, any validity checks done using kasan_byte_accessible() will fail. Fix it by unpoisoning the memory before using it as the pool region. Link: https://linux-review.googlesource.com/id/I0af99e9f1c25eaf7e1ec295836b5d148d76940c5 Si