Thread (51 messages) flat view 51 messages, 7 authors, 2021-01-15

Re: [PATCH 10/11] kasan: fix bug detection via ksize for HW_TAGS mode

From: Andrey Konovalov <hidden>
Date: 2021-01-07 01:59:44
Also in: oe-kbuild-all

On Thu, Jan 7, 2021 at 1:02 AM Andrew Morton [off-list ref] wrote:
quoted hunk ↗ jump to hunk
On Wed, 6 Jan 2021 08:09:00 +0800 kernel test robot [off-list ref] wrote:
quoted
Hi Andrey,
   In file included from arch/x86/boot/compressed/cmdline.c:2:
   In file included from arch/x86/boot/compressed/misc.h:30:
   In file included from include/linux/acpi.h:14:
   In file included from include/linux/resource_ext.h:11:
   In file included from include/linux/slab.h:136:
quoted
quoted
include/linux/kasan.h:314:77: warning: non-void function does not return a value [-Wreturn-type]
   static inline bool kasan_check_byte(const void *address, unsigned long ip) {}
                                                                               ^
   1 warning generated.
This?
--- a/include/linux/kasan.h~kasan-fix-bug-detection-via-ksize-for-hw_tags-mode-fix
+++ a/include/linux/kasan.h
@@ -311,7 +311,10 @@ static inline void *kasan_krealloc(const
        return (void *)object;
 }
 static inline void kasan_kfree_large(void *ptr, unsigned long ip) {}
-static inline bool kasan_check_byte(const void *address, unsigned long ip) {}
+static inline bool kasan_check_byte(const void *address, unsigned long ip)
+{
+       return true;
+}

 #endif /* CONFIG_KASAN */
Yes.
btw, "kasan_check_byte" isn't a good function name.  Check for what?
Does it return true for a check which passed, or for a check which
failed?  Something like "kasan_byte_valid" would be better - the name
explains the return value.
Sounds good, will fix in v2 along with the warning.

Thank you!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help