Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934140AbcCNKov (ORCPT ); Mon, 14 Mar 2016 06:44:51 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33604 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934106AbcCNKoL (ORCPT ); Mon, 14 Mar 2016 06:44:11 -0400 From: Alexander Potapenko To: adech.fo@gmail.com, cl@linux.com, dvyukov@google.com, akpm@linux-foundation.org, ryabinin.a.a@gmail.com, rostedt@goodmis.org, iamjoonsoo.kim@lge.com, js1304@gmail.com, kcc@google.com Cc: kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v7 6/7] kasan: Test fix: Warn if the UAF could not be detected in kmalloc_uaf2 Date: Mon, 14 Mar 2016 11:43:44 +0100 Message-Id: <86fff773633f3c97df852f440be455e171efea59.1457949315.git.glider@google.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 515 Lines: 21 Signed-off-by: Alexander Potapenko Acked-by: Andrey Ryabinin --- 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