[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230918072545.87653-1-haibo.li@mediatek.com>
Date: Mon, 18 Sep 2023 15:25:45 +0800
From: Haibo Li <haibo.li@...iatek.com>
To: <andreyknvl@...il.com>
CC: <akpm@...ux-foundation.org>,
<angelogioacchino.delregno@...labora.com>, <dvyukov@...gle.com>,
<glider@...gle.com>, <haibo.li@...iatek.com>, <jannh@...gle.com>,
<kasan-dev@...glegroups.com>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>, <linux-mm@...ck.org>,
<mark.rutland@....com>, <matthias.bgg@...il.com>,
<ryabinin.a.a@...il.com>, <vincenzo.frascino@....com>,
<xiaoming.yu@...iatek.com>
Subject: Re: [PATCH] kasan:fix access invalid shadow address when input is illegal
> On Fri, Sep 15, 2023 at 4:46 AM 'Haibo Li' via kasan-dev
> <kasan-dev@...glegroups.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.
Powered by blists - more mailing lists