From patchwork Fri Mar 12 14:24:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 12134793 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=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham 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 66C70C433E6 for ; Fri, 12 Mar 2021 14:24:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02A7B64FAD for ; Fri, 12 Mar 2021 14:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02A7B64FAD 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 5F6558D035E; Fri, 12 Mar 2021 09:24:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CBF68D0346; Fri, 12 Mar 2021 09:24:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 382C08D0360; Fri, 12 Mar 2021 09:24:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0116.hostedemail.com [216.40.44.116]) by kanga.kvack.org (Postfix) with ESMTP id 1E85E8D0346 for ; Fri, 12 Mar 2021 09:24:49 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A61318784 for ; Fri, 12 Mar 2021 14:24:48 +0000 (UTC) X-FDA: 77911443456.07.CF1E34E Received: from mail-qv1-f73.google.com (mail-qv1-f73.google.com [209.85.219.73]) by imf28.hostedemail.com (Postfix) with ESMTP id 83F2420003A1 for ; Fri, 12 Mar 2021 14:24:49 +0000 (UTC) Received: by mail-qv1-f73.google.com with SMTP id i1so17662999qvu.12 for ; Fri, 12 Mar 2021 06:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=JZTsOk7rsE4y13QJJB2MKSWKMrX5Hi5qHr1bAz5AyQ0=; b=hTQLmWZFaN/2EBaaI1leaS+J+FqsNZbjnWkVy379obcmHmGy4TQ2Qbw+Y7mvRXWIOi aFMAit90SAHGfQvCfuLLb1QQIkmF2K3wiDzHPkHBtIgwtWRMrjV8BpwlSXV5K+R9LF7Y JqlKASAtwLSGMb1Xf+nxvRmQbuukKW23nwcI6FsgqoPDYyeGMj0l2+9+3OESihxuNoRV hGV0SpTMfQTwvi9S3K1Q+splEsfmPHDbYJouBLP6t1DXCggHaXMnKHuO6dh7/h7H08Gg jjlRbOXFzrTqOunGygqBtdhDs9ZbTwGVikayQ6Wx6EIDDOssRaphq6B5Z4yZv2bNLeI1 IKFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=JZTsOk7rsE4y13QJJB2MKSWKMrX5Hi5qHr1bAz5AyQ0=; b=fqUQfugz1E+W2R9AMaFTftiC/QBk5FstABnqzZEa0pDYtYexIAOQMJKC0IUF6S+TIj HamByjGBx7ArdWYZ4IGDtiZNjt6jnpbZm24IYAXDAY9JyPAWV7S6/PAGa7ynIDBDGZr5 YRoGInSDXacZhVvNKnOQUWGLo4j918ZZvBdQ5yGP2QrclRKo3nf0MFJhxXX+ET4T3/te tn5MGWLgPlPTG92SSGezBx1rQBkAg5/x7vWYO72fcnZGzeOSvK7ScWPpLN1nxK4JEILl c501qUYNe/gdFpX8r1thiLLLS5Ue4iONHvLTKRJcn+AEWHWv7YpE7d7VmKT7h2xD7HNq Y1Tg== X-Gm-Message-State: AOAM532zBmkbUkgx0YQJZKDoHNEerrcKoWCKmH5Yf3FofFs3nP/OFapA BGNNmOpvbbcdWmyX9pppYrDA7j2uRKOM75Zk X-Google-Smtp-Source: ABdhPJx1bwhGX9ABp6J/tmttc6zDPEbbnnDx7Uu8xLNlXSBuRHDH9zhu1klIP97uHVF7sDyQHYaVpjPHUSBTP3uw X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:95a:d8a8:4925:42be]) (user=andreyknvl job=sendgmr) by 2002:ad4:51c1:: with SMTP id p1mr12931323qvq.39.1615559087508; Fri, 12 Mar 2021 06:24:47 -0800 (PST) Date: Fri, 12 Mar 2021 15:24:28 +0100 In-Reply-To: Message-Id: <01364952f15789948f0627d6733b5cdf5209f83a.1615559068.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH v2 05/11] kasan: docs: update boot parameters section From: Andrey Konovalov To: Andrew Morton , Alexander Potapenko , Marco Elver Cc: Andrey Ryabinin , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 83F2420003A1 X-Stat-Signature: phih35bpxbf6qfmgp3r888dxxs94iew3 Received-SPF: none (flex--andreyknvl.bounces.google.com>: No applicable sender policy available) receiver=imf28; identity=mailfrom; envelope-from="<3r3lLYAoKCNg4H7L8SEHPFAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--andreyknvl.bounces.google.com>"; helo=mail-qv1-f73.google.com; client-ip=209.85.219.73 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615559089-571815 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: Update the "Boot parameters" section in KASAN documentation: - Mention panic_on_warn. - Mention kasan_multi_shot and its interaction with panic_on_warn. - Clarify kasan.fault=panic interaction with panic_on_warn. - A readability clean-up. Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver --- Documentation/dev-tools/kasan.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index cd12c890b888..1189be9b4cb5 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -174,10 +174,16 @@ call_rcu() and workqueue queuing. Boot parameters ~~~~~~~~~~~~~~~ +KASAN is affected by the generic ``panic_on_warn`` command line parameter. +When it is enabled, KASAN panics the kernel after printing a bug report. + +By default, KASAN prints a bug report only for the first invalid memory access. +With ``kasan_multi_shot``, KASAN prints a report on every invalid access. This +effectively disables ``panic_on_warn`` for KASAN reports. + Hardware tag-based KASAN mode (see the section about various modes below) is intended for use in production as a security mitigation. Therefore, it supports -boot parameters that allow to disable KASAN competely or otherwise control -particular KASAN features. +boot parameters that allow disabling KASAN or controlling its features. - ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``). @@ -185,8 +191,8 @@ particular KASAN features. traces collection (default: ``on``). - ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN - report or also panic the kernel (default: ``report``). Note, that tag - checking gets disabled after the first reported bug. + report or also panic the kernel (default: ``report``). The panic happens even + if ``kasan_multi_shot`` is enabled. Implementation details ----------------------