diff options
author | Andrey Konovalov <andreyknvl@google.com> | 2022-03-25 04:12:43 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-25 05:06:49 +0300 |
commit | 9d7b7dd946924de43021f57a8bee122ff0744d93 (patch) | |
tree | f39a9c9427cc314fc7edf03fd492397bd16d5259 /mm/kasan/kasan.h | |
parent | 0a6e8a07dec75f7b013b70c2df3e69c64edf312f (diff) | |
download | linux-9d7b7dd946924de43021f57a8bee122ff0744d93.tar.xz |
kasan: split out print_report from __kasan_report
Split out the part of __kasan_report() that prints things into
print_report(). One of the subsequent patches makes another error handler
use print_report() as well.
Includes lower-level changes:
- Allow addr_has_metadata() accepting a tagged address.
- Drop the const qualifier from the fields of kasan_access_info to
avoid excessive type casts.
- Change the type of the address argument of __kasan_report() and
end_report() to void * to reduce the number of type casts.
Link: https://lkml.kernel.org/r/9be3ed99dd24b9c4e1c4a848b69a0c6ecefd845e.1646237226.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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/kasan/kasan.h')
-rw-r--r-- | mm/kasan/kasan.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index cc7162a9f304..40b863e289ec 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -128,8 +128,8 @@ static inline bool kasan_sync_fault_possible(void) #define META_ROWS_AROUND_ADDR 2 struct kasan_access_info { - const void *access_addr; - const void *first_bad_addr; + void *access_addr; + void *first_bad_addr; size_t access_size; bool is_write; unsigned long ip; @@ -239,7 +239,8 @@ static inline const void *kasan_shadow_to_mem(const void *shadow_addr) static inline bool addr_has_metadata(const void *addr) { - return (addr >= kasan_shadow_to_mem((void *)KASAN_SHADOW_START)); + return (kasan_reset_tag(addr) >= + kasan_shadow_to_mem((void *)KASAN_SHADOW_START)); } /** |