Received: by 10.223.164.202 with SMTP id h10csp2730360wrb; Mon, 27 Nov 2017 23:51:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMagfUq4Lb7c3JsqQ8TPuiYtCavUntoMxtn+oytLQ7GhRaY1FFQbGPW8Ax8/NibuATYeaBtZ X-Received: by 10.99.152.68 with SMTP id l4mr40288057pgo.208.1511855473314; Mon, 27 Nov 2017 23:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511855473; cv=none; d=google.com; s=arc-20160816; b=uGLpcVgpvmScSAGmv+nnHAhuaKdueFKxFZDhP2O8sr5HrpCQabxCjxx51/EGoKpUGY IRfn69jjd3g63VZhTO3DavDrL+J0gjCYNHxCGdMALfCSfDgkanP751yTiQO0y02x1vyD w4LDs9XzRcfhM1CRJ8p02qu4od1Nc7y8CvWT9kba+TUE+lk9uO6pExJ0SE6+FluuGiry AOqgbDJX/OJ/mJQ+LJfpiAsJyerUxN1W8llQSXgplqgArpYUmsYHm/PEY9+1/wMfqmV8 n1iC77mYPIEqs7NfptCKuwQBo/wp+b17XQ+Yp1A3MT5y44TqsNWlnMkRZTYIvqA07qkQ JiDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=uHMsLiDGD7XKHfeuQTq3fjSm5LFE9TtAzHiKnSxJiG8=; b=FUznAN+LvrxZaOVH34fwR7To4yDK4xmuQAurlvh01pi1c+hvmmxsRQZo67exGZS6wb or7TnBbBS6WucwAvdeZqxj0uL4YJiWV3U3FY2mspJvzOlAwx2bIUo9yXITXh/cKQCBqV 7CzZjyzMVxjSCSHzNREC1oTVV2jFdg9kQli8836hoKV+WeEUfEELAeVNmhR5CvGwq9Ew SEVP0wSuX7FReMMcv+ke3C6ccB7xA/YJjJEu6NPIi+7ydRaeIGmlXycNxXy3TlUeDx44 RMPKpN5sfyK7z1zit1UWVHztcOtOthbYwLZ0obSb2mCOv6+JD3WU7IeWX2rO+rODgDcr XZAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L0BmPQW6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si26826004pff.45.2017.11.27.23.51.02; Mon, 27 Nov 2017 23:51:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L0BmPQW6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752405AbdK1HuI (ORCPT + 78 others); Tue, 28 Nov 2017 02:50:08 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:46913 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbdK1HuE (ORCPT ); Tue, 28 Nov 2017 02:50:04 -0500 Received: by mail-pg0-f65.google.com with SMTP id z184so19912381pgd.13 for ; Mon, 27 Nov 2017 23:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uHMsLiDGD7XKHfeuQTq3fjSm5LFE9TtAzHiKnSxJiG8=; b=L0BmPQW654qf60/u9IJzbB6M7FaKs/2TsIaCbSuVWVe7BUhJy6SRAt6fxWeqlucmj3 S6TzAij3LGX47MyBzlPGHzy3UWxMmrEjq8j9IIxl8Og3K6gutWoXNk/G8hISUfUuHvBu 2fB4sbsXpr3VI0ft+kxaaZ75P+6hTGfs5bhSE+HDkL5F5kZsOG4bAATseHoqt0aWJ1Dp 5oUEfhduTHmqwSX04HITalqTyZdSWwgZ6ZJgfiA44C9Xp852SUvWq8qfLHMNzNlT1L3s fej3VK+nKJ4LEdLov+RZVAsOdKfLju4UMAm8l3Ks/aeHr/s+5XOpy91G1bCB4cRR+eFJ tSww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uHMsLiDGD7XKHfeuQTq3fjSm5LFE9TtAzHiKnSxJiG8=; b=hsl/OAyQFAKWLJJUiY1KNfk3V1Kt4yAjyBD0Kpa2uIqiONvsl/+SAN1lP1znLqaiO2 w6yHXvoCA757u/Y5YBW6cKFjNyfGd2siMxfCGgWwJf3AuDCQpwYYTPD2lxDg+6tqocXC bNOdTjUk8K8iXQSE5QZ4XflcrGvJxfI4V2NxCx6NNzsaU5yW07zFnkv3YPhxNV0Cqyv/ 1ccsU7as864gMJFCI+QwpMGpif27uBAUTLBrRSlm56+KC5CRgQYb/ek+84SeNocPLUT8 Nq2wzCMlBlvxIbEk7ecGPd52E93foQwR/0O0qDMo8sypT7j2mvhp4jKXPsc7a/8dju4I YH0g== X-Gm-Message-State: AJaThX4NdqTDmHy3F7e9y0oGGME2O88NEWQ8yNTfGAQ0IZ5NfNaYf+Ra 3iE9wNgEdMaQBiNrpFogNv0= X-Received: by 10.99.119.73 with SMTP id s70mr39092388pgc.451.1511855404029; Mon, 27 Nov 2017 23:50:04 -0800 (PST) Received: from localhost.localdomain ([124.56.155.17]) by smtp.gmail.com with ESMTPSA id 67sm39403946pfz.171.2017.11.27.23.50.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Nov 2017 23:50:03 -0800 (PST) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Namhyung Kim , Wengang Wang , Joonsoo Kim Subject: [PATCH 13/18] mm/vchecker: support inline KASAN build Date: Tue, 28 Nov 2017 16:48:48 +0900 Message-Id: <1511855333-3570-14-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511855333-3570-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1511855333-3570-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joonsoo Kim There is no reason not to support inline KASAN build. Support it. Note that vchecker_check() function is now placed on kasan report function to support inline build because gcc generates the inline check code and then directly jump to kasan report function when poisoned value is found. Name is somewhat misleading but there is no problem in the view of implementation. Signed-off-by: Joonsoo Kim --- lib/Kconfig.kasan | 1 - mm/kasan/report.c | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 51c0a05..d3552f3 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -63,6 +63,5 @@ config VCHECKER happens at the area. depends on KASAN && DEBUG_FS - select KASAN_OUTLINE endif diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 6c83631..3d002aa 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -413,6 +413,8 @@ void kasan_report(unsigned long addr, size_t size, #define DEFINE_ASAN_REPORT_LOAD(size) \ void __asan_report_load##size##_noabort(unsigned long addr) \ { \ + if (vchecker_check(addr, size, false, _RET_IP_)) \ + return; \ kasan_report(addr, size, false, _RET_IP_); \ } \ EXPORT_SYMBOL(__asan_report_load##size##_noabort) @@ -420,6 +422,8 @@ EXPORT_SYMBOL(__asan_report_load##size##_noabort) #define DEFINE_ASAN_REPORT_STORE(size) \ void __asan_report_store##size##_noabort(unsigned long addr) \ { \ + if (vchecker_check(addr, size, true, _RET_IP_)) \ + return; \ kasan_report(addr, size, true, _RET_IP_); \ } \ EXPORT_SYMBOL(__asan_report_store##size##_noabort) @@ -437,12 +441,16 @@ DEFINE_ASAN_REPORT_STORE(16); void __asan_report_load_n_noabort(unsigned long addr, size_t size) { + if (vchecker_check(addr, size, false, _RET_IP_)) + return; kasan_report(addr, size, false, _RET_IP_); } EXPORT_SYMBOL(__asan_report_load_n_noabort); void __asan_report_store_n_noabort(unsigned long addr, size_t size) { + if (vchecker_check(addr, size, true, _RET_IP_)) + return; kasan_report(addr, size, true, _RET_IP_); } EXPORT_SYMBOL(__asan_report_store_n_noabort); -- 2.7.4 From 1585306355741834207@xxx Tue Nov 28 10:45:55 +0000 2017 X-GM-THRID: 1585306355741834207 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread