Skip to content

Commit 51dcc81

Browse files
xairytorvalds
authored andcommitted
kasan: adjust kasan_stack_oob for tag-based mode
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]>
1 parent cae9dc3 commit 51dcc81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/test_kasan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static noinline void __init kasan_global_oob(void)
488488
static noinline void __init kasan_stack_oob(void)
489489
{
490490
char stack_array[10];
491-
volatile int i = 0;
491+
volatile int i = OOB_TAG_OFF;
492492
char *p = &stack_array[ARRAY_SIZE(stack_array) + i];
493493

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

0 commit comments

Comments
 (0)