how can KAsan support arm32?

Russell King - ARM Linux linux at armlinux.org.uk
Thu Jun 1 09:42:09 PDT 2017


On Thu, Jun 01, 2017 at 07:37:26PM +0300, Andrey Ryabinin wrote:
> kasan needs at least 1/8 of the total memory, so it will be 32MB in
> your case.

Is that really the case?  It is if we want to account for every byte,
but I don't think that's necessary.

Memory is allocated not on a per-byte basis, but on a larger granule,
mainly determined by L1_CACHE_BYTES / ARCH_SLAB_MINALIGN etc.  While
it means that we would lose the ability to capture accesses that
happen strictly over the size requested from kmalloc() etc, if we
implemented this, it would at least allow the more seriously wrong
accesses to be trapped, while being cheaper.

So, for 1GB of kernel virtual space, we'd only need 4MB for the bitmap
for a 32-byte cache line system, which is much less of a problem.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.



More information about the linux-arm-kernel mailing list