Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4315030imm; Mon, 17 Sep 2018 11:43:00 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdaz/WAQFhnM20aVAcZN4zh/A1v9IOVQB9k+IV6Af/9RjyFngj5EQw4yAAeTnl3G8o+oiUk1 X-Received: by 2002:a62:da0b:: with SMTP id c11-v6mr27276874pfh.68.1537209780395; Mon, 17 Sep 2018 11:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537209780; cv=none; d=google.com; s=arc-20160816; b=mcRKQGpfqV9wHmUaoF0r4rZWkLsiud0HKvWuuwMbXFztKswvojcrk/2n6I3+PWMVFn Icz7ovsB1HGMKcZTHzZlTqYMZ65bqWfslteYLdXIFRfz5USNLuMGvwjvV9vWYkrgNz1P O93fOHxSvw6rULBl7Ne5uy4PPtkzpSVwrOGNq9LsXwahep0RHGiVR5Mgls80b2UonANS dH7q25sWKjh/UyhgcDE71rxEGYRVMgzqzH5RRgUt829ok91bQ1hgC5Nkr02fSrQ1aNyk n14aWIHjN8OEwQJM7x03lZdI9nwHkANtCJ5DhuOoI8jkd6iXmggcle1bjCbmZ8b7VbPm /Azw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=O5u7wMaeEk5fXb1J01fxLI6QHGCxyT5enhFPS6rHyRY=; b=woU/bXzUehruXZT3zZ0Zt0SYwjYbOuHsb2WDvmC8vMTtWBuZ4c7Bqu1LquSWdXN6Rs YP6NRKQFG0XNNSjNdAwsnvLJSCQ6HK9gMo5ZHZXrFXwl0O8Z4r55lt8h/uE93GxitLTr T3omac+XlIJSk+viv51rXXJykKUeDRcv9oPg0AOI3oW1dcTqHE+x7XledNWaLyB6m/YX 8EZ5OfJKp2RUSscvNzyAt0F+2kYU66Yxzk5KQNgxkZqfSjvxadyz0U8mfFP5FmDlJwi4 j3vD9hmOv/OFunXERKGbNGiXEj0hnGzyfR2ixjyLNuT/OrfNGb2KK/Ax1NFP+ubLxPQl RM+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=jd4FM5IS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y86-v6si17445902pfi.195.2018.09.17.11.42.44; Mon, 17 Sep 2018 11:43:00 -0700 (PDT) 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=@google.com header.s=20161025 header.b=jd4FM5IS; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbeIRALN (ORCPT + 99 others); Mon, 17 Sep 2018 20:11:13 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:36292 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727672AbeIRALN (ORCPT ); Mon, 17 Sep 2018 20:11:13 -0400 Received: by mail-io1-f65.google.com with SMTP id q5-v6so12350226iop.3 for ; Mon, 17 Sep 2018 11:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O5u7wMaeEk5fXb1J01fxLI6QHGCxyT5enhFPS6rHyRY=; b=jd4FM5IS7f0vh3csEHwSv5NUA9rtXE8KD/0+x/dX+blaJ/pXqQWvnWocszCWRJZBXi hndcTDC2awQIUnUZ1MTmL+mMNOQeAfV+izh37HjkSQikTpg2Uo5/17R4Ewx2avfgt1wt fHTsZ1b+jqs6ayOY0OrEyRGl8lttRhvBtheJh1c0bj8sfhmEbkEPZSlm2UJtnzQ2FW6H KaSDYmij4gIw28uvGEAJ1DkwDMj4pp0BKH3feLAgNIS252NtcFAqD6/QiW7ec2qZG59w 5nKdbV95/DByG5Qk1YlSh1RsHBaRiG1TPf/kvBlxPuZRZQy7VSPOPTWb8VnttqG/Nd4t G5Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O5u7wMaeEk5fXb1J01fxLI6QHGCxyT5enhFPS6rHyRY=; b=CreVpwvzUeTiaFLEfMKPtwII+rkXphHD6oVZ4AQ4faC/4vlTF1b7XnukgK4CAxT0mu eBZZOvvbpK+2EKQXAD0Bc00u0mbTMcZkliQOwQ38+5oevrfwHKPnb9prUizbiqneWHpV 5/7QOOoQd7JG3qOFaNjPNfyS579faHijz5NY8Z6V460QMJ/R8IT1nL3B+tecPOazY2hR pamLM7Bf9Gn5yNeHyOPHJMqbN7DTZifN970FqD885RjhnASJ3kSYKkND7IHjsMzbr1oZ PwxGe+nUmQxy7jSuL7JJ6jTmea3zs7uQibGvWsY1s6Jwo9HT/p1lsD9OGVn/wxva9ewV dFTg== X-Gm-Message-State: APzg51AV/LD7zPEX06yva1W6vZpI84mGIRuIsF6in60DHTYjrxuOlKC5 yl2d6QLEwxK0rHxOp09tqksTnN8ZUuwbSx/S+v26/A== X-Received: by 2002:a6b:2147:: with SMTP id h68-v6mr21760951ioh.192.1537209757392; Mon, 17 Sep 2018 11:42:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:c54e:0:0:0:0:0 with HTTP; Mon, 17 Sep 2018 11:42:36 -0700 (PDT) In-Reply-To: References: <868c9168481ff5103034ac1e37b830d28ed5f4ee.1535462971.git.andreyknvl@google.com> From: Andrey Konovalov Date: Mon, 17 Sep 2018 20:42:36 +0200 Message-ID: Subject: Re: [PATCH v6 03/18] khwasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_HW To: Dmitry Vyukov Cc: Andrey Ryabinin , Alexander Potapenko , Catalin Marinas , Will Deacon , Christoph Lameter , Andrew Morton , Mark Rutland , Nick Desaulniers , Marc Zyngier , Dave Martin , Ard Biesheuvel , "Eric W . Biederman" , Ingo Molnar , Paul Lawrence , Geert Uytterhoeven , Arnd Bergmann , "Kirill A . Shutemov" , Greg Kroah-Hartman , Kate Stewart , Mike Rapoport , kasan-dev , "open list:DOCUMENTATION" , LKML , Linux ARM , linux-sparse@vger.kernel.org, Linux-MM , "open list:KERNEL BUILD + fi..." , Kostya Serebryany , Evgeniy Stepanov , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Jann Horn , Mark Brand , Chintan Pandya , Vishwath Mohan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 12, 2018 at 4:47 PM, Dmitry Vyukov wrote: > On Wed, Aug 29, 2018 at 1:35 PM, Andrey Konovalov wrote: >> >> #define __no_sanitize_address __attribute__((no_sanitize("address"))) >> +#define __no_sanitize_hwaddress __attribute__((no_sanitize("hwaddress"))) > > It seems that it would be better to have just 1 attribute for both types. > Currently __no_sanitize_address is used just in a single place. But if > it ever used more, people will need to always spell both which looks > unnecessary, or, worse will only fix asan but forget about khwasan. > > If we do just: > > #define __no_sanitize_address __attribute__((no_sanitize("address", > "hwaddress"))) > > Then we don't need any changes in compiler-gcc.h nor in compiler.h, > and no chance or forgetting one of them. Will do in v7. >> config KASAN >> - bool "KASan: runtime memory debugger" >> + bool "KASAN: runtime memory debugger" >> + help >> + Enables KASAN (KernelAddressSANitizer) - runtime memory debugger, >> + designed to find out-of-bounds accesses and use-after-free bugs. > > Perhaps also give link to Documentation/dev-tools/kasan.rst while we are here. Will do in v7. > >> + >> +choice >> + prompt "KASAN mode" >> + depends on KASAN >> + default KASAN_GENERIC >> + help >> + KASAN has two modes: KASAN (a classic version, similar to userspace > > In these few sentences we call the old mode with 3 different terms: > "generic", "classic" and "KASAN" :) > This is somewhat confusing. Let's call it "generic" throughout (here > and in the docs patch). "Generic" as in "supported on multiple arch > and not-dependent on hardware features". "Classic" makes sense for > people who knew KASAN before, but for future readers in won't make > sense. Will use "generic" in v7. >> >> +if HAVE_ARCH_KASAN_HW > > This choice looks somewhat weird on non-arm64. It's kinda a choice > menu, but one can't really choose anything. Should we put the whole > choice under HAVE_ARCH_KASAN_HW, and just select KASAN_GENERIC > otherwise? I don't know what't the practice here. Andrey R? I think having one option that is auto selected is fine. >> +config KASAN_HW >> + bool "KHWASAN: the hardware assisted mode" Do we need a hyphen here? hardware-assisted? Yes, will fix in v7.