linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Andrey Konovalov <andreyknvl@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	Marco Elver <elver@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linuxppc-dev@lists.ozlabs.org, christophe.leroy@csgroup.eu,
	aneesh.kumar@linux.ibm.com, bsingharora@gmail.com
Subject: Re: [PATCH v15 2/4] kasan: allow architectures to provide an outline readiness check
Date: Wed, 23 Jun 2021 19:25:12 +1000	[thread overview]
Message-ID: <878s31hr0n.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <CA+fCnZdJ=HHn1Y=UDiYJ2NagNF9d-bJfjQa0jmiDaLiqneB_rA@mail.gmail.com>

>> diff --git a/mm/kasan/common.c b/mm/kasan/common.c
>> index 10177cc26d06..0ad615f3801d 100644
>> --- a/mm/kasan/common.c
>> +++ b/mm/kasan/common.c
>> @@ -331,6 +331,10 @@ static inline bool ____kasan_slab_free(struct kmem_cache *cache, void *object,
>>         u8 tag;
>>         void *tagged_object;
>>
>> +       /* Bail if the arch isn't ready */
>
> This comment brings no value. The fact that we bail is clear from the
> following line. The comment should explain why we bail.
>
>> +       if (!kasan_arch_is_ready())
>> +               return false;

Fair enough, I've just dropped the comments as I don't think there's
really a lot of scope for the generic/core comment to explain why a
particular architecture might not be ready.

> Have you considered including these checks into the high-level
> wrappers in include/linux/kasan.h? Would that work?

I don't think those wrappers will catch the outline check functions
like __asan_load*, which also need guarding.

Kind regards,
Daniel


  reply	other threads:[~2021-06-23  9:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:30 [PATCH v15 0/4] KASAN core changes for ppc64 radix KASAN Daniel Axtens
2021-06-17  9:30 ` [PATCH v15 1/4] kasan: allow an architecture to disable inline instrumentation Daniel Axtens
2021-06-20 11:15   ` Andrey Konovalov
2021-06-17  9:30 ` [PATCH v15 2/4] kasan: allow architectures to provide an outline readiness check Daniel Axtens
2021-06-20 11:16   ` Andrey Konovalov
2021-06-23  9:25     ` Daniel Axtens [this message]
2021-06-17  9:30 ` [PATCH v15 3/4] mm: define default MAX_PTRS_PER_* in include/pgtable.h Daniel Axtens
2021-06-20 11:17   ` Andrey Konovalov
2021-06-17  9:30 ` [PATCH v15 4/4] kasan: use MAX_PTRS_PER_* for early shadow tables Daniel Axtens
2021-06-20 11:17   ` Andrey Konovalov
2021-06-17 14:04 ` [PATCH v15 0/4] KASAN core changes for ppc64 radix KASAN Balbir Singh

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=878s31hr0n.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=bsingharora@gmail.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox