From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 673FEC55ABD for ; Thu, 12 Nov 2020 19:53:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C953C2085B for ; Thu, 12 Nov 2020 19:53:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VD7H2eMa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C953C2085B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 264FA6B006E; Thu, 12 Nov 2020 14:53:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 239F06B0070; Thu, 12 Nov 2020 14:53:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 151B76B0071; Thu, 12 Nov 2020 14:53:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id DE5676B006E for ; Thu, 12 Nov 2020 14:53:08 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 86D19181AEF10 for ; Thu, 12 Nov 2020 19:53:08 +0000 (UTC) X-FDA: 77476814856.27.geese73_2717bc427309 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 533E43D66B for ; Thu, 12 Nov 2020 19:53:08 +0000 (UTC) X-HE-Tag: geese73_2717bc427309 X-Filterd-Recvd-Size: 5331 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Nov 2020 19:53:07 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id h6so5108910pgk.4 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=eihZNCa5rxaEEYKc8aFbNyT5MQMeVxKXO1qpq/ZRDRfpxAERhnz1J4b8pNzZjtYKYw WJxI96nqiEFLtpkerEgBjwXWjO8y4yPs+dfOzM2UhJKvu2KH06KoSm11jnfiL6C3wTJJ SZ5xSls+3BU0f1CVlxcMM6r/UvtRrHEcpwBseQMVyAtw5Kr6z60XbpD5qk/n68NnIWUd IkwSeaE5S8+uJfUkTIwxXqbJyEFveXBJFBpnVjAE6YLxRCX00B7jAYGX/eNZ+ifB+mEK ryw9lPe3PZzQxvvXMvCmt7j82J7EtX3JOjjVgls35XxkFiQx7hU2NtjJ9bZElK/T2xPe WwIg== X-Gm-Message-State: AOAM531WAj+S9pTtWRkToRTs332kMu9yrUJmnli8NGK5KDGWL/2Lny6F TKx6qDTnLZR4SbNKeEFYn9O9gVqd6Ho2UWgAvksWRw== X-Google-Smtp-Source: ABdhPJxL01n8kb3FhPoY/cSroYBZ2T8yNmnlPc4OiqROq5zV4v83LT8bLUfiz1kIShZ4SP7Ij5O69gyoNXOImDV726s= 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 :)