Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932371AbcLLJiI (ORCPT ); Mon, 12 Dec 2016 04:38:08 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:37727 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754103AbcLLJiC (ORCPT ); Mon, 12 Dec 2016 04:38:02 -0500 X-AuditID: cbfee61b-f796f6d000004092-60-584e6ff8fa90 From: Maninder Singh To: mmarek@suse.com, aryabinin@virtuozzo.com, glider@google.com, dvyukov@google.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, kasan-dev@googlegroups.com, pankaj.m@samsung.com, ajeet.y@samsung.com, Maninder Singh , Vaneet narang Subject: [PATCH 1/1] kasan: Support for r/w instrumentation control Date: Mon, 12 Dec 2016 15:02:37 +0530 Message-id: <1481535157-24628-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsVy+t9jQd0f+X4RBhO2Klu8eDWBxWLO+jVs Fl8mvWO3mPCwjd2i/eNeZosVz+4zWfzZtYPJ4vKuOWwWh+e3AdW1zmKzuPdmK5PFoZNzGR14 PBZsKvXYM/Ekm8eJGb9ZPPq2rGL0WL/lKovH501yHq/3H2IMYI9ys8lITUxJLVJIzUvOT8nM S7dVCg1x07VQUshLzE21VYrQ9Q0JUlIoS8wpBfKMDNCAg3OAe7CSvl2CW8bEu28ZCxbyVsz8 8pW5gfEZVxcjJ4eEgIlE97LVjBC2mMSFe+vZuhi5OIQEZjFKnOj9wAjh/GSUuPdjAxtIFZuA nsSqXXtYQGwRgQKJtaffM4EUMQvcBOq42AKWEBZwlljXfJYZxGYRUJV4tm4D0CQODl4Bd4nz JzMhtslJnDw2mXUCI/cCRoZVjBKpBckFxUnpuUZ5qeV6xYm5xaV56XrJ+bmbGMGB/kx6B+Ph Xe6HGAU4GJV4eB1SfSOEWBPLiitzDzFKcDArifB6ZPlFCPGmJFZWpRblxxeV5qQWH2I0Bdo/ kVlKNDkfGIV5JfGGJuYm5sYGFuaWliZGSuK8jbOfhQsJpCeWpGanphakFsH0MXFwSjUw1v9c G/Bveva24Iro62fVJE63nlj98renhsIzpsO6Dtq7vGQz26buVUtf7bu48HuB1a4HLuzMhl8k 7u1dXOJXxBVt+vXd0c1Jyy9kLlibHGbTzB47/2dJg1Tk6ez8g0pJD08anl3eOr+75/6treI7 ZlfwSIrulubvsK/jfrVhss2KG+FlV1ujlFiKMxINtZiLihMBD2gKhooCAAA= X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1638 Lines: 57 This provide option to control sanity of read and write operations Both read and write instrumentation increase size of uImage, So using this option read or write instrumentation can be avoided if not required. Useful in case of module sanity, using this uImage sanity can be avoided. Also user space ASAN provides this support for read/write instrumentation control. Signed-off-by: Vaneet narang Signed-off-by: Maninder Singh Reviewed-by: Ajeet Yadav --- lib/Kconfig.kasan | 16 ++++++++++++++++ scripts/Makefile.kasan | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index bd38aab..6f0f774 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -45,6 +45,22 @@ config KASAN_INLINE endchoice +config KASAN_READS + prompt "Read instrumentation" + bool + default y + depends on KASAN + help + This configuration controls the sanity of memory read. + +config KASAN_WRITES + prompt "Write instrumentation" + bool + default y + depends on KASAN + help + This configuration controls the sanity of memory write. + config TEST_KASAN tristate "Module for testing kasan for bug detection" depends on m && KASAN diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 37323b0..a61b18e 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan @@ -29,3 +29,7 @@ else endif endif endif + +CFLAGS_KASAN += $(call cc-option, \ + $(if $(CONFIG_KASAN_READS),, --param asan-instrument-reads=0) \ + $(if $(CONFIG_KASAN_WRITES),, --param asan-instrument-writes=0)) -- 1.9.1