aboutsummaryrefslogtreecommitdiff
path: root/core/kernel
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2017-09-08 10:37:57 +0200
committerJérôme Forissier <jerome.forissier@linaro.org>2017-09-14 08:42:20 -0500
commit726ce13ed5a218e55d4dbebe2ae5e25e16e4b564 (patch)
tree1701fc9e143231165dae676ca3b09394fbaaa54f /core/kernel
parente103c301ffc0e1393834c45cc64c6978ddb6ad8f (diff)
core: asan: fix check_access()
Prior to this patch the for loop in check_access() that checks the access in the shadow area is skipping accesses smaller than a ASAN block (8 bytes). This patch fixes that problem and checks also smaller accesses. Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/kernel')
-rw-r--r--core/kernel/asan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/kernel/asan.c b/core/kernel/asan.c
index 86dff1ba..c1008887 100644
--- a/core/kernel/asan.c
+++ b/core/kernel/asan.c
@@ -182,8 +182,8 @@ static void check_access(vaddr_t addr, size_t size)
if (!va_range_inside_shadow(begin, end))
panic();
- e = va_to_shadow(end);
- for (a = va_to_shadow(begin); a != e; a++)
+ e = va_to_shadow((void *)(addr + size - 1));
+ for (a = va_to_shadow(begin); a <= e; a++)
if (*a < 0)
panic();