kasan: clean up is_kfence_address checks
authorAndrey Konovalov <andreyknvl@google.com>
Thu, 21 Dec 2023 20:04:48 +0000 (21:04 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 Dec 2023 19:58:44 +0000 (11:58 -0800)
commit99f3fe416c71aa3d5aba69174c274309ededfd42
tree3680ec7d995466a70a52f7675b69b7f6c853bd32
parent1a55836a1b002298714dc84032b3d19d9bbc2d66
kasan: clean up is_kfence_address checks

1. Do not untag addresses that are passed to is_kfence_address: it
   tolerates tagged addresses.

2. Move is_kfence_address checks from internal KASAN functions
   (kasan_poison/unpoison, etc.) to external-facing ones.

   Note that kasan_poison/unpoison are never called outside of KASAN/slab
   code anymore; the comment is wrong, so drop it.

3. Simplify/reorganize the code around the updated checks.

Link: https://lkml.kernel.org/r/1065732315ef4e141b6177d8f612232d4d5bc0ab.1703188911.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Marco Elver <elver@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/kasan/common.c
mm/kasan/kasan.h
mm/kasan/shadow.c