Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8794475imu; Tue, 4 Dec 2018 14:24:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/UAAr13TOF89qqBIACYQelSLJA+uZHNCMz510ueiJU7lKqSStvJlZ9wZjyk829Vl6vQUfyB X-Received: by 2002:a63:b81a:: with SMTP id p26mr18687490pge.433.1543962293366; Tue, 04 Dec 2018 14:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543962293; cv=none; d=google.com; s=arc-20160816; b=Qv0piCVE7pAoI98lKhLdAfNCfwnjdqV7z0qxmtW88woAYc9chOLJn2mL9czcdhMxjC ujnpyuTTFc+HgHdaohq8rwre0uR1Um1kkmtSueXoUHmS6tmm0lneYk6xhXTydlUsIHNZ 8EmxFCzDuA8FdCDn20hWnfLsSboSp4bj7kxi/WBz0sP5S9lC15VgIBxLxpqgty2mwQc7 ///1f4nxDe96SQ7tU2tem/b/oBmL7tJROseuaDG4IgixS1K9NLJ1uuIN6gprWpIvrBct SdAnAWbfbgc4rvlYoxcaWtZ0RngYCBmgttvETw66L1KT3laf6F63qwArFvJK0HYSiUOP dKBg== 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 :in-reply-to:references:mime-version:dkim-signature; bh=I6nCkMUwljQh49NXS/ClOKHkTPzJgolIuwBRZ+snpIQ=; b=Krs9oyL6c4pawBByXMlmM1iIxTtrgDh20ZlIOqAbna+QRLiJ5UqnSsz9PP83r+yK2G Z+zJHB+/0TJJiZXWPNNYQDDPBzr7z7Tg4DtOYP7oQLR/sxgzebRgsjZntt6DSSGa6j18 u8OiSKEanF0IcHWeQf2gp8H/66cuvRbBuHTZLRz51ig0XFgDVgr5uLyTOSwFaHh+Yg+j +Kj1Ju6j2capyCJeCQ9BdX36vU2eAeSxS4r5wWhTb8qEg2+CM8rKW7n0wg36tUEsevhI nTCmY/3LhwG1nhtJn8iG7i7804IbVZdm0akrVK32VHy3MIGdze9BTFK/jyJWVrw/FFUV A/ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Enwcx4nY; 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=QUARANTINE 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 q25si14504170pgv.541.2018.12.04.14.24.37; Tue, 04 Dec 2018 14:24:53 -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=Enwcx4nY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726031AbeLDWYC (ORCPT + 99 others); Tue, 4 Dec 2018 17:24:02 -0500 Received: from mail-yw1-f67.google.com ([209.85.161.67]:46041 "EHLO mail-yw1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbeLDWYB (ORCPT ); Tue, 4 Dec 2018 17:24:01 -0500 Received: by mail-yw1-f67.google.com with SMTP id d190so7671004ywd.12; Tue, 04 Dec 2018 14:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I6nCkMUwljQh49NXS/ClOKHkTPzJgolIuwBRZ+snpIQ=; b=Enwcx4nYi6WhkOZPYYFpuGKYYzpK/yoSpN8nn56gZf7MZ0teeS9Kh+AsO50EYX+MbC yGILzMN246CsVbcOXF01Lp8TD1shauDu559rocut2Dc8C5XY7Wh1Jga3Zh5J3i1G27V4 BJGKHtirxwU141ZTGyBhX6dWmjEckAdzQ7D9nieeuTaSGBNAcu6aptmZrcXiUf/xZmv0 uQChQeCGxi2vLclOK8zwp1IFOx9bRLx2aO43o3u0EjEBl45b4FYgguPs6a97WwgzW2BB VLEEqow8Qg7ACZaORuI7QUBewirpwuCT8zDcFlOyMoRRrtR8v24o9QW6HYnx/onW+NgK cO6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I6nCkMUwljQh49NXS/ClOKHkTPzJgolIuwBRZ+snpIQ=; b=to/kBQ0BeYTe1X4SNW+bbY7tFPydHf+7oGSY/yoTyvEf53Z9V1sH6ljx2DRbNy0Bhs JXZJ3H3VdqTK5wjNOZ1J4WxYlrOEmjGUqO1Uuw7ct74u+BVhkJucfp2oBXLha81pqCwY pexZCz9edRn8TaZyjjRENP4/jdcb8ZMR2sq7B3T8Rj9fxn3zG3S201Opbg2ZWNWurBoX w9LkXn3mXtG3bqM2DIVPOkMAVzSC3oNYguiQjY12LOqU5rqFWP4fRCmAmWTcfjitgOpS RK7x/uIedcBl2Zcut7TbA7J3KqxpFDRJXltkv6Q9G/g18aLFk+zXYEy4D+eG5I+nZba8 r87Q== X-Gm-Message-State: AA+aEWbridEZPSDpduksi3xNslld5cPV+yDn+TxVevjkHDXX4kdkcmXo TvsHQPcY+abUB2Wfzl3iR7+mm9bHtAxmTZItklw= X-Received: by 2002:a81:1fd4:: with SMTP id f203mr21520235ywf.422.1543962240420; Tue, 04 Dec 2018 14:24:00 -0800 (PST) MIME-Version: 1.0 References: <20728567aae93b5eb88a6636c94c1af73db7cdbc.1543337629.git.andreyknvl@google.com> In-Reply-To: <20728567aae93b5eb88a6636c94c1af73db7cdbc.1543337629.git.andreyknvl@google.com> From: Max Filippov Date: Tue, 4 Dec 2018 14:23:47 -0800 Message-ID: Subject: Re: [PATCH v12 05/25] kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS To: Andrey Konovalov Cc: Andrey Ryabinin , glider@google.com, Dmitry Vyukov , Catalin Marinas , Will Deacon , Christoph Lameter , Andrew Morton , Mark Rutland , ndesaulniers@google.com, marc.zyngier@arm.com, dave.martin@arm.com, Ard Biesheuvel , "Eric W. Biederman" , Ingo Molnar , paullawrence@google.com, Geert Uytterhoeven , Arnd Bergmann , "Kirill A. Shutemov" , Greg Kroah-Hartman , Kate Stewart , rppt@linux.vnet.ibm.com, kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, LKML , linux-arm-kernel@lists.infradead.org, linux-sparse@vger.kernel.org, linux-mm@kvack.org, linux-kbuild , kcc@google.com, eugenis@google.com, Lee.Smith@arm.com, Ramana.Radhakrishnan@arm.com, Jacob.Bramley@arm.com, Ruben.Ayrapetyan@arm.com, jannh@google.com, markbrand@google.com, cpandya@codeaurora.org, vishwath@google.com 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 Hello, On Tue, Nov 27, 2018 at 9:00 AM Andrey Konovalov wrote: > > This commit splits the current CONFIG_KASAN config option into two: > 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN mode (the one > that exists now); > 2. CONFIG_KASAN_SW_TAGS, that enables the software tag-based KASAN mode. [...] > --- a/lib/Kconfig.kasan > +++ b/lib/Kconfig.kasan > @@ -1,35 +1,95 @@ > +# This config refers to the generic KASAN mode. > config HAVE_ARCH_KASAN > bool > > +config HAVE_ARCH_KASAN_SW_TAGS > + bool > + > +config CC_HAS_KASAN_GENERIC > + def_bool $(cc-option, -fsanitize=kernel-address) > + > +config CC_HAS_KASAN_SW_TAGS > + def_bool $(cc-option, -fsanitize=kernel-hwaddress) > + > if HAVE_ARCH_KASAN > > 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. > + See Documentation/dev-tools/kasan.rst for details. Perhaps KASAN should depend on CC_HAS_KASAN_GENERIC || CC_HAS_KASAN_SW_TAGS, otherwise make all*config may enable KASAN for a compiler that does not have any -fsanitize=kernel-*address support, resulting in build failures like this: http://kisskb.ellerman.id.au/kisskb/buildresult/13606170/log/ -- Thanks. -- Max