aboutsummaryrefslogtreecommitdiffstats
path: root/mm/kasan/generic.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2020-04-13 09:44:39 +0200
committerIngo Molnar <mingo@kernel.org>2020-04-13 09:44:39 +0200
commit3b02a051d25d9600e9d403ad3043aed7de00160e (patch)
tree5b8f58b79328c04654bf5ab6286401057edeca8f /mm/kasan/generic.c
parentkcsan, trace: Make KCSAN compatible with tracing (diff)
parentLinux 5.7-rc1 (diff)
downloadlinux-dev-3b02a051d25d9600e9d403ad3043aed7de00160e.tar.xz
linux-dev-3b02a051d25d9600e9d403ad3043aed7de00160e.zip
Merge tag 'v5.7-rc1' into locking/kcsan, to resolve conflicts and refresh
Resolve these conflicts: arch/x86/Kconfig arch/x86/kernel/Makefile Do a minor "evil merge" to move the KCSAN entry up a bit by a few lines in the Kconfig to reduce the probability of future conflicts. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'mm/kasan/generic.c')
-rw-r--r--mm/kasan/generic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c
index 616f9dd82d12..56ff8885fe2e 100644
--- a/mm/kasan/generic.c
+++ b/mm/kasan/generic.c
@@ -173,17 +173,18 @@ static __always_inline bool check_memory_region_inline(unsigned long addr,
if (unlikely(size == 0))
return true;
+ if (unlikely(addr + size < addr))
+ return !kasan_report(addr, size, write, ret_ip);
+
if (unlikely((void *)addr <
kasan_shadow_to_mem((void *)KASAN_SHADOW_START))) {
- kasan_report(addr, size, write, ret_ip);
- return false;
+ return !kasan_report(addr, size, write, ret_ip);
}
if (likely(!memory_is_poisoned(addr, size)))
return true;
- kasan_report(addr, size, write, ret_ip);
- return false;
+ return !kasan_report(addr, size, write, ret_ip);
}
bool check_memory_region(unsigned long addr, size_t size, bool write,