lkml.org 
[lkml]   [2023]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] kasan:fix access invalid shadow address when input is illegal
Date
> On Fri, Sep 15, 2023 at 4:46 AM 'Haibo Li' via kasan-dev
> <kasan-dev@googlegroups.com> wrote:
> >
> > The patch checks each shadow address,so it introduces extra overhead.
>
> Ack. Could still be fine, depends on the overhead.
>
I do a simple test by reading memory.
Read 4096 memory by loop and the reading unit is 8 bytes.
__hwasan_load8_noabort is called 512(4096/8) times.
Measure the time of memory read.
Here is the result on ARM CA7X(repeat 100 times):
---------------min-------max-----avg----
before patch | 77.3ms | 80.6ms | 79.2ms|
after patch | 77.2ms | 80.7ms | 79.2ms|
----------------------------------------

There is no obvious drop in this scenario.
It may differ in different arch.
just for information if you are intrested in it.

> But if the message printed by kasan_non_canonical_hook is good enough
> for your use case, I would rather stick to that.

\
 
 \ /
  Last update: 2023-09-18 09:27    [W:0.091 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site