diff options
author | Arnd Bergmann <[email protected]> | 2023-02-15 14:00:56 +0100 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-02-20 12:46:16 -0800 |
commit | 9701c9ff8311fed118fd09d962a90e254e761d97 (patch) | |
tree | fcbc371a04a2cfc0c1630bf8685d8431f489a834 | |
parent | f7a449f779608efe1941a0e0c4bd7b5f57000be7 (diff) |
kasan: mark addr_has_metadata __always_inline
Patch series "objtool warning fixes", v2.
These are three of the easier fixes for objtool warnings around
kasan/kmsan/kcsan. I dropped one patch since Peter had come up with a
better fix, and adjusted the changelog text based on feedback.
This patch (of 3):
When the compiler decides not to inline this function, objtool complains
about incorrect UACCESS state:
mm/kasan/generic.o: warning: objtool: __asan_load2+0x11: call to addr_has_metadata() with UACCESS enabled
Link: https://lore.kernel.org/all/[email protected]/
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Marco Elver <[email protected]>
Reviewed-by: Andrey Konovalov <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Josh Poimboeuf <[email protected]>
Cc: Kuan-Ying Lee <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/kasan/kasan.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h index 308fb70fd40a..8fae87ab99cc 100644 --- a/mm/kasan/kasan.h +++ b/mm/kasan/kasan.h @@ -297,7 +297,7 @@ static inline const void *kasan_shadow_to_mem(const void *shadow_addr) << KASAN_SHADOW_SCALE_SHIFT); } -static inline bool addr_has_metadata(const void *addr) +static __always_inline bool addr_has_metadata(const void *addr) { return (kasan_reset_tag(addr) >= kasan_shadow_to_mem((void *)KASAN_SHADOW_START)); @@ -316,7 +316,7 @@ bool kasan_check_range(unsigned long addr, size_t size, bool write, #else /* CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS */ -static inline bool addr_has_metadata(const void *addr) +static __always_inline bool addr_has_metadata(const void *addr) { return (is_vmalloc_addr(addr) || virt_addr_valid(addr)); } |