LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Marco Elver <elver@google.com>
To: Andrey Konovalov <andreyknvl@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Alexander Potapenko <glider@google.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	kasan-dev@googlegroups.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/11] kasan: docs: update ignoring accesses section
Date: Fri, 12 Mar 2021 12:02:45 +0100	[thread overview]
Message-ID: <YEtKVYVeUycUKySP@elver.google.com> (raw)
In-Reply-To: <c0f6a95b0fa59ce0ef502f4ea11522141e3c8faf.1615498565.git.andreyknvl@google.com>

On Thu, Mar 11, 2021 at 10:37PM +0100, Andrey Konovalov wrote:
[...]  
> +Other parts of the kernel might access metadata for allocated objects. Normally,
> +KASAN detects and reports such accesses, but in certain cases (e.g., in memory
> +allocators) these accesses are valid. Disabling instrumentation for memory
> +allocators files helps with accesses that happen directly in that code for
> +software KASAN modes. But it does not help when the accesses happen indirectly
> +(through generic function calls) or with the hardware tag-based mode that does
> +not use compiler instrumentation.
> +
> +To disable KASAN reports in a certain part of the kernel code:
> +
> +- For software modes, add a
> +  ``kasan_disable_current()``/``kasan_enable_current()`` critical section.

Should we mention function attribute __no_sanitize_address (and noinstr,
which just applies to any kind of instrumentation) here? Perhaps with
the note that called functions may still be instrumented, and in such
cases would require combining with kasan_{disable,enable}_current().

> +- For tag-based modes, use ``kasan_reset_tag()`` or ``page_kasan_tag_reset()``.


  reply	other threads:[~2021-03-12 11:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 21:37 [PATCH 01/11] kasan: docs: clean up sections Andrey Konovalov
2021-03-11 21:37 ` [PATCH 02/11] kasan: docs: update overview section Andrey Konovalov
2021-03-12 10:17   ` Marco Elver
2021-03-12 13:51     ` Andrey Konovalov
2021-03-11 21:37 ` [PATCH 03/11] kasan: docs: update usage section Andrey Konovalov
2021-03-11 21:37 ` [PATCH 04/11] kasan: docs: update error reports section Andrey Konovalov
2021-03-11 21:37 ` [PATCH 05/11] kasan: docs: update boot parameters section Andrey Konovalov
2021-03-11 21:37 ` [PATCH 06/11] kasan: docs: update GENERIC implementation details section Andrey Konovalov
2021-03-11 21:37 ` [PATCH 07/11] kasan: docs: update SW_TAGS " Andrey Konovalov
2021-03-11 21:37 ` [PATCH 08/11] kasan: docs: update HW_TAGS " Andrey Konovalov
2021-03-11 21:37 ` [PATCH 09/11] kasan: docs: update shadow memory section Andrey Konovalov
2021-03-12 10:52   ` Marco Elver
2021-03-12 13:52     ` Andrey Konovalov
2021-03-11 21:37 ` [PATCH 10/11] kasan: docs: update ignoring accesses section Andrey Konovalov
2021-03-12 11:02   ` Marco Elver [this message]
2021-03-12 14:07     ` Andrey Konovalov
2021-03-11 21:37 ` [PATCH 11/11] kasan: docs: update tests section Andrey Konovalov
2021-03-12 10:47   ` Marco Elver
2021-03-12 13:53     ` Andrey Konovalov

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=YEtKVYVeUycUKySP@elver.google.com \
    --to=elver@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --subject='Re: [PATCH 10/11] kasan: docs: update ignoring accesses section' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).