mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: Maninder Singh <maninder1.s@samsung.com>,
	Alexander Potapenko <glider@google.com>,
	Jonathan Corbet <corbet@lwn.net>, Michal Marek <mmarek@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	kasan-dev <kasan-dev@googlegroups.com>,
	<linux-doc@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	"open list:KERNEL BUILD + fi..." <linux-kbuild@vger.kernel.org>,
	PANKAJ MISHRA <pankaj.m@samsung.com>,
	Ajeet Kumar Yadav <ajeet.y@samsung.com>,
	Vaneet narang <v.narang@samsung.com>
Subject: Re: [PATCH v2] kasan: Support for r/w instrumentation control
Date: Tue, 13 Dec 2016 16:59:37 +0300	[thread overview]
Message-ID: <e08cfce3-ef28-3c34-4cef-9ebca8769050@virtuozzo.com> (raw)
In-Reply-To: <CACT4Y+Zu9QAYNh3=nnwiRNd6C5sxS1WGR=93ovmZs0hWkucPow@mail.gmail.com>

On 12/13/2016 12:38 PM, Dmitry Vyukov wrote:
> On Tue, Dec 13, 2016 at 10:20 AM, Andrey Ryabinin
> <aryabinin@virtuozzo.com> 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.

Yeah, this is soooooo convenient...

Seriously speaking, per-file instrumentation is absolutely irrelevant to this patch and should have been
addressed from a different angle. E.g. see how UBSAN/GCOV/KCOV do that.

As for this patch, I'd say only one option would be enough - KASAN_DONT_SANITIZE_READS.
Nobody wants to sanitize only reads without writes, right? Writes are fewer and more dangerous. 



 

  reply	other threads:[~2016-12-13 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  5:57 Maninder Singh
2016-12-13  8:58 ` Dmitry Vyukov
2016-12-13  9:20   ` Andrey Ryabinin
2016-12-13  9:38     ` Dmitry Vyukov
2016-12-13 13:59       ` Andrey Ryabinin [this message]
2016-12-13 14:13         ` Dmitry Vyukov
2016-12-13 15:29           ` Andrey Ryabinin
     [not found]           ` <CGME20161213152904epcas3p15f600392fd9f54fe1f68ed9f87d9f03b@epcas3p1.samsung.com>
     [not found]             ` <20161216102902epcms5p1acc3482dea59a0eb85523ed082a31841@epcms5p1>
2016-12-16 10:46               ` Dmitry Vyukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e08cfce3-ef28-3c34-4cef-9ebca8769050@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=ajeet.y@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=mmarek@suse.com \
    --cc=pankaj.m@samsung.com \
    --cc=v.narang@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®