Skip to content

Commit

Permalink
core: asan: fix check_access()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jenswi-linaro committed Sep 14, 2017
1 parent 140d70d commit c1c91d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/kernel/asan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c1c91d1

Please sign in to comment.