Skip to content

Commit

Permalink
kasan: adjust kasan_stack_oob for tag-based mode
Browse files Browse the repository at this point in the history
Use OOB_TAG_OFF as access offset to land the access into the next granule.

Suggested-by: Walter Wu <[email protected]>
Signed-off-by: Andrey Konovalov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Alexander Potapenko <[email protected]>
Cc: Andrey Ryabinin <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Dmitry Vyukov <[email protected]>
Cc: Elena Petrova <[email protected]>
Cc: Marco Elver <[email protected]>
Cc: Vincenzo Frascino <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Link: http://lkml.kernel.org/r/403b259f1de49a7a3694531c851ac28326a586a8.1596199677.git.andreyknvl@google.com
Link: http://lkml.kernel.org/r/3063ab1411e92bce36061a96e25b651212e70ba6.1596544734.git.andreyknvl@google.com
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
xairy authored and torvalds committed Aug 7, 2020
1 parent cae9dc3 commit 51dcc81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_kasan.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static noinline void __init kasan_global_oob(void)
static noinline void __init kasan_stack_oob(void)
{
char stack_array[10];
volatile int i = 0;
volatile int i = OOB_TAG_OFF;
char *p = &stack_array[ARRAY_SIZE(stack_array) + i];

pr_info("out-of-bounds on stack\n");
Expand Down

0 comments on commit 51dcc81

Please sign in to comment.