0001
0002 #ifndef _LINUX_KASAN_CHECKS_H
0003 #define _LINUX_KASAN_CHECKS_H
0004
0005 #include <linux/types.h>
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
0019 bool __kasan_check_read(const volatile void *p, unsigned int size);
0020 bool __kasan_check_write(const volatile void *p, unsigned int size);
0021 #else
0022 static inline bool __kasan_check_read(const volatile void *p, unsigned int size)
0023 {
0024 return true;
0025 }
0026 static inline bool __kasan_check_write(const volatile void *p, unsigned int size)
0027 {
0028 return true;
0029 }
0030 #endif
0031
0032
0033
0034
0035
0036 #ifdef __SANITIZE_ADDRESS__
0037 #define kasan_check_read __kasan_check_read
0038 #define kasan_check_write __kasan_check_write
0039 #else
0040 static inline bool kasan_check_read(const volatile void *p, unsigned int size)
0041 {
0042 return true;
0043 }
0044 static inline bool kasan_check_write(const volatile void *p, unsigned int size)
0045 {
0046 return true;
0047 }
0048 #endif
0049
0050 #endif