Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp322714pxb; Thu, 12 Nov 2020 04:57:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOi6Rc+XlkwNEKCG+iVUNWb6vo2+UNzPTOFiQP/zSbk72fKG6HOFFTKK/381HudyOciLYC X-Received: by 2002:a50:9fe6:: with SMTP id c93mr4935511edf.30.1605185841031; Thu, 12 Nov 2020 04:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605185841; cv=none; d=google.com; s=arc-20160816; b=Uas8RIDVYYrXYArqbbGc6WZH4r3LnWKPrklZHn+qFbayRCRCytMpN2eF4ybq2Cj9Wh KjTiKY72vwj9JHeFLtGSmErLce8CFUSElPBjAReTEiePQm5iWIMjW7Gdoco/q6CooWfw FyGW0CtiJemZNVaEFhMpHZXholO5P7ZXpQU53F6I28FoQ3fhtTl9faoCIWkdlnCfZNXX 3nsPJ8NPKmNxM+1kg+mmjfgWNDkoMGsQ0MPuR/l9Lz7bsBDWf173JtpgZQWKQhDhtV9i e7VYydP5ij/dHsYvPfJ2HB9dHyIL8VUwXJlvId5akccSwf/Hc6qgFDHE+y4i1no7K8IV Vebg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UdDP3pjZtrznljrlHAECnZTmEmit63VYkxxHUeKD2dc=; b=mi0OAvI1ukS9UlZiCiX15ZJ8mp15iMkt04ONALYAdC10DuJ9lQKYSdvrh1ewCAEAQA 6oXBLj9hPI5OXfCvOqyCpV23Js6+dsH024hQgoal/DmR+onumsXSHdhym6dvQVmpKdea XjY2Pf+ZJ8QQKLLVCuyEjRllE8kl+HG9/6+RRCAmsHoQ6mA5/CgcfJcBmabuxD5n37Z0 doRHteA6h29SQTad/UT9jQ9phineeWIDiL1FPp9LZ/LavqpyERLd+0h1qAJq/8LQGIxn ZRtL6EKQWmICu0kVU/5e++p6TyX/+qttr4DgIg+ojdB6XHgkhsBL9ve2PE/gJV/MU6ZL wVEA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si4025895eji.422.2020.11.12.04.56.58; Thu, 12 Nov 2020 04:57:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbgKLMzA (ORCPT + 99 others); Thu, 12 Nov 2020 07:55:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:41382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727223AbgKLMzA (ORCPT ); Thu, 12 Nov 2020 07:55:00 -0500 Received: from gaia (unknown [2.26.170.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B5E4521D7F; Thu, 12 Nov 2020 12:54:56 +0000 (UTC) Date: Thu, 12 Nov 2020 12:54:54 +0000 From: Catalin Marinas To: Marco Elver Cc: Andrey Konovalov , 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 Subject: Re: [PATCH v2 11/20] kasan: add and integrate kasan boot parameters Message-ID: <20201112125453.GM29613@gaia> References: <20201112113541.GK29613@gaia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;). -- Catalin