All of lore.kernel.org
 help / color / mirror / Atom feed
From: dvyukov@google.com (Dmitry Vyukov)
To: linux-arm-kernel@lists.infradead.org
Subject: how can KAsan support arm32?
Date: Thu, 1 Jun 2017 19:14:29 +0200	[thread overview]
Message-ID: <CACT4Y+YK60tYjb0hgVtDv9xcF4Ou+7FtpttY-n-zobLaOJG-ng@mail.gmail.com> (raw)
In-Reply-To: <20170601164209.GD22219@n2100.armlinux.org.uk>

On Thu, Jun 1, 2017 at 6:42 PM, Russell King - ARM Linux
<linux@armlinux.org.uk> wrote:
> 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.


KASAN shadow is not bit-per-byte, it's more elaborate. We can increase
shadow scale from 1:8 to 1:32 without loss of precision. This was
recently discussed here:
https://groups.google.com/d/msg/kasan-dev/JKYk2uUBriY/s5aH0bCaAwAJ

      reply	other threads:[~2017-06-01 17:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d202a49e-ee0f-4864-b24b-b185255c7f11@googlegroups.com>
     [not found] ` <CACT4Y+aEW+CNH40mwY_i-mzL3cRYHc8EdMyhQj6dAiS+=0TpXg@mail.gmail.com>
     [not found]   ` <20170601112424.GA8718@leverpostej>
     [not found]     ` <CACT4Y+b5OiNrQqK-A2qHquZo266eXykWROLP=qj_BW__S2Wi5w@mail.gmail.com>
     [not found]       ` <ba9fb499-98c5-4cfe-b68e-48a8df8d4ca9@googlegroups.com>
2017-06-01 16:37         ` how can KAsan support arm32? Andrey Ryabinin
2017-06-01 16:42           ` Russell King - ARM Linux
2017-06-01 17:14             ` Dmitry Vyukov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACT4Y+YK60tYjb0hgVtDv9xcF4Ou+7FtpttY-n-zobLaOJG-ng@mail.gmail.com \
    --to=dvyukov@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.