Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357146

[PATCH v7 6/7] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2

From Alexander Potapenko <glider@google.com>
Newsgroups linux.kernel
Subject [PATCH v7 6/7] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2
Date 2016-03-14 11:50 +0100
Message-ID <rcyeu-2Bi-21@gated-at.bofh.it> (permalink)
References <rcyet-2Bi-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Alexander Potapenko <glider@google.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 lib/test_kasan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index 90ad74f..82169fb 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -294,6 +294,8 @@ static noinline void __init kmalloc_uaf2(void)
 	}
 
 	ptr1[40] = 'x';
+	if (ptr1 == ptr2)
+		pr_err("Could not detect use-after-free: ptr1 == ptr2\n");
 	kfree(ptr2);
 }
 
-- 
2.7.0.rc3.207.g0ac5344

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 0/7] SLAB support for KASAN Alexander Potapenko <glider@google.com> - 2016-03-14 11:50 +0100
  [PATCH v7 7/7] mm: kasan: Initial memory quarantine implementation Alexander Potapenko <glider@google.com> - 2016-03-14 11:50 +0100
  [PATCH v7 4/7] arch, ftrace: For KASAN put hard/soft IRQ entries into separate sections Alexander Potapenko <glider@google.com> - 2016-03-14 11:50 +0100
  [PATCH v7 6/7] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2 Alexander Potapenko <glider@google.com> - 2016-03-14 11:50 +0100
  [PATCH v7 2/7] mm, kasan: SLAB support Alexander Potapenko <glider@google.com> - 2016-03-14 11:50 +0100

csiph-web