Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp619773pxb; Thu, 12 Nov 2020 11:55:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzn2l4vp1gPPumyMsosHvLhx8JF94pMMEsNnVoGBn/JyUpUTOkji3dQhtikVIQwT+Sz2Gv X-Received: by 2002:a17:906:cc4f:: with SMTP id mm15mr914177ejb.267.1605210931353; Thu, 12 Nov 2020 11:55:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605210931; cv=none; d=google.com; s=arc-20160816; b=S4jYH7bcpbY1deMBiIFiwck2jEguq+xhqJiDWgxx4sjL2UUktS4ghCZZOv9TFg2doB +J1NCkjUYEWC763ZPcG5ykMVvEHKzQxiVVCh/uzYcQKeJgoNQFTeF/I+eI8DZhozZ8CK bvHXkQFGjwyGSLo0wF+eSeVfTy0thsyBdENmZHQIh9+S9Kg9R4ohEY02mgVfrTjIFaxm +sQn+iHKZAygVasyp1V6eYei3JjzT+kbMUndkQkIktrbnH9qrkjlJKAGCYy/U3NQkCzS se8u4qrjIs4sLbi4U3oYO/rdxE1OB9/RpsAyXbo2EesfKluiMyCDzAw6PTYKGBBjsA50 ojUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=R1iBhmRyOD1cXj7AK8WZ6mc3iAS43Zf94bygMHusk1g=; b=mx5J6d6NIciGBJJ8x0KB7+5ujNlsUUCqh6jhakih5ioH89gJePbwvzjBAq4AsNAXsf Ao6QbvoH0goZMmrId/kr/sEx+T6UPbrCRJ8vbqWAmdpwtl7J1ATlMWv5/bFzY7XJG3bE s2iFZn4Dq9UglCecZ9QQa0EsgRaev9lBzhvrs/oS5GQmqLMK4qinDHQzxDwvyY5h3/Rb JNUfdRCSeYfdhjldzmKEdsdiPI6HTnGnnNmF/ojsuMOkb4GCxIdS/613olJpzLr6KhIF vaJy54BMz/CFhoXzETMRnyY+OEunc3lYR2LhqhA5EZJiVjCVAZE0QapDKX6OJdIj2FEN 5dEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VD7H2eMa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id u27si4675052edi.588.2020.11.12.11.55.07; Thu, 12 Nov 2020 11:55:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VD7H2eMa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726925AbgKLTxI (ORCPT + 99 others); Thu, 12 Nov 2020 14:53:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbgKLTxH (ORCPT ); Thu, 12 Nov 2020 14:53:07 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83907C0613D1 for ; Thu, 12 Nov 2020 11:53:07 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id 10so5532861pfp.5 for ; Thu, 12 Nov 2020 11:53:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=R1iBhmRyOD1cXj7AK8WZ6mc3iAS43Zf94bygMHusk1g=; b=VD7H2eMaolEM2hAy6QbrMYmG2SMAZvr4V2YF0vvFBOOA+pCrg35xj4TBH0hYECKWMt WtETE9ep/pTbK6GLtgdntTy2rCOmZXQEa72PeOULVYBttI/N/dpaIv5uFijvzll6MALS jPhWCFan9DlX2baRLytvpIJY5Ci4xCKV2GcT0dOXUCBC9rLBBJJAKd+168mlnGgxPLYh oOHGlj+nnDHjTMeX/vwGawzJxCfokUm/+eEbEjrsmr36+j3tJzzhJGq9s+rKofUPbvV1 cv4O0FqvUsaYe8jI7JVgp3XNPI6BE+vtC9Ovv/hGcgBvkkG/iRElLxxKckSvJzyRVrUn OepQ== 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=R1iBhmRyOD1cXj7AK8WZ6mc3iAS43Zf94bygMHusk1g=; b=SEywotXq+bmQSUv/etz/bcDT4s1ciffOoqXSeffMCWPCFXz4DXfS+0gdrVE+A02wR9 6/S+ikf4nw3vIhhSifdn5K52qO1iyZdPzrRa01Hzg6m/EFcAWL5KeexlN6hg96RjHjX8 6Jj8wqYBXIAFvUl8NMH6CvgOjn6zDBG4P6VV/2zJbDi7M5X3IfW9PC5lLPzzWr7AKGb6 r+B5HG/Z9pGDOCpoZib0PLyhVJ3p2Zf4yazbXFhHbWkgm3bH4f+JlLIrU1j6oiScrl0G jNwOf19M7qmDhj0uaqqyZkgwAq//WUjY1WfdrL4IZZXZ6iPREJ8SJ8qip4xgExn9gcOu orDA== X-Gm-Message-State: AOAM531fpRXrGlpk3oO0dkvxpg19k4gQaqc3To8uqss17DXnB6dumx5+ YwVboVrpCaKErBrNnAR5mzZ2aQr2Bd7eAh+C8z0KJg== X-Received: by 2002:a17:90b:3111:: with SMTP id gc17mr842079pjb.41.1605210786958; Thu, 12 Nov 2020 11:53:06 -0800 (PST) MIME-Version: 1.0 References: <20201112113541.GK29613@gaia> <20201112125453.GM29613@gaia> In-Reply-To: <20201112125453.GM29613@gaia> From: Andrey Konovalov Date: Thu, 12 Nov 2020 20:52:55 +0100 Message-ID: Subject: Re: [PATCH v2 11/20] kasan: add and integrate kasan boot parameters To: Catalin Marinas Cc: Marco Elver , Dmitry Vyukov , Alexander Potapenko , Will Deacon , Vincenzo Frascino , Evgenii Stepanov , Andrey Ryabinin , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 1:55 PM Catalin Marinas wrote: > > On Thu, Nov 12, 2020 at 12:53:58PM +0100, Marco Elver wrote: > > On Thu, 12 Nov 2020 at 12:35, Catalin Marinas wrote: > > > > > > On Tue, Nov 10, 2020 at 11:20:15PM +0100, Andrey Konovalov wrote: > > > > Hardware tag-based KASAN mode is intended to eventually be used in > > > > production as a security mitigation. Therefore there's a need for finer > > > > control over KASAN features and for an existence of a kill switch. > > > > > > > > This change adds a few boot parameters for hardware tag-based KASAN that > > > > allow to disable or otherwise control particular KASAN features. > > > > > > > > The features that can be controlled are: > > > > > > > > 1. Whether KASAN is enabled at all. > > > > 2. Whether KASAN collects and saves alloc/free stacks. > > > > 3. Whether KASAN panics on a detected bug or not. > > > > > > > > With this change a new boot parameter kasan.mode allows to choose one of > > > > three main modes: > > > > > > > > - kasan.mode=off - KASAN is disabled, no tag checks are performed > > > > - kasan.mode=prod - only essential production features are enabled > > > > - kasan.mode=full - all KASAN features are enabled > > > > > > Alternative naming if we want to avoid "production" (in case someone > > > considers MTE to be expensive in a production system): > > > > > > - kasan.mode=off > > > - kasan.mode=on > > > - kasan.mode=debug > > > > I believe this was what it was in RFC, and we had a long discussion on > > what might be the most intuitive options. Since KASAN is still a > > debugging tool for the most part, an "on" mode might imply we get all > > the debugging facilities of regular KASAN. However, this is not the > > case and misleading. Hence, we decided to be more explicit and avoid > > "on". > > Even better, kasan.mode=fast ;). Well, it uses sync, so technically it's not as fast as it could be with async :)