Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932916AbcLMJim (ORCPT ); Tue, 13 Dec 2016 04:38:42 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35500 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932826AbcLMJig (ORCPT ); Tue, 13 Dec 2016 04:38:36 -0500 MIME-Version: 1.0 In-Reply-To: <6cc0eadc-5204-ce36-f5e8-88ba76bb6826@virtuozzo.com> References: <1481608665-26941-1-git-send-email-maninder1.s@samsung.com> <6cc0eadc-5204-ce36-f5e8-88ba76bb6826@virtuozzo.com> From: Dmitry Vyukov Date: Tue, 13 Dec 2016 10:38:14 +0100 Message-ID: Subject: Re: [PATCH v2] kasan: Support for r/w instrumentation control To: Andrey Ryabinin Cc: Maninder Singh , Alexander Potapenko , Jonathan Corbet , Michal Marek , Andrew Morton , kasan-dev , linux-doc@vger.kernel.org, LKML , "open list:KERNEL BUILD + fi..." , PANKAJ MISHRA , Ajeet Kumar Yadav , Vaneet narang Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1214 Lines: 29 On Tue, Dec 13, 2016 at 10:20 AM, Andrey Ryabinin wrote: > > > On 12/13/2016 11:58 AM, Dmitry Vyukov wrote: > >> --- a/Documentation/dev-tools/kasan.rst >> +++ b/Documentation/dev-tools/kasan.rst >> @@ -40,6 +40,14 @@ similar to the following to the respective kernel Makefile: >> >> KASAN_SANITIZE := n >> >> +Sometimes it may be useful to disable instrumentation of reads, or writes >> +or both for the entire kernel. For example, if binary size is a concern, >> +it may be useful to disable instrumentation of reads to reduce binary size but >> +still catch more harmful bugs on writes. Or, if one is interested only in >> +sanitization of a particular module and performance is a concern, she can >> +disable instrumentation of both reads and writes for kernel code. >> +Instrumentation can be disabled with CONFIG_KASAN_READS and >> CONFIG_KASAN_WRITES. >> + > > I don't understand this. How this can be related to modules? Configs are global. > You can't just disable/enable config per module. Build everything without instrumentation. Then enable instrumentation and do "make lib/test_kasan.ko". Or build everything, copy out bzImage, change config, build everything again.