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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74C77C433FE for ; Tue, 10 May 2022 11:58:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 024296B0073; Tue, 10 May 2022 07:58:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F185F6B0074; Tue, 10 May 2022 07:58:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DB7D26B0075; Tue, 10 May 2022 07:58:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CF00A6B0073 for ; Tue, 10 May 2022 07:58:09 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AC95A21892 for ; Tue, 10 May 2022 11:58:09 +0000 (UTC) X-FDA: 79449685098.13.D824C6D Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by imf24.hostedemail.com (Postfix) with ESMTP id 53BF61800B7 for ; Tue, 10 May 2022 11:58:01 +0000 (UTC) Received: by mail-wm1-f41.google.com with SMTP id m2-20020a1ca302000000b003943bc63f98so1261767wme.4 for ; Tue, 10 May 2022 04:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fGBBzJMSY58ZqJQmQlHeFlOhEyr8JQc2d5kb0lSfqro=; b=R6G+qM4kBuKqVaT1XytJvW3yEUzzXtSj5dKK6loIx1swrFZ/Tj0+pWoIpY2dA/Zz65 JPm1P357XPMzFFro5TKbBVY1rKOiMgQSEmE8CbpivobX5BL9+/16kpeu5dxX4TWgho6l fPfoJB4OzQcJfZysMQVsSGZbybyfdA5Uc5NJezzzRzTGb1uM8T1PM+9rYpnSv/Q9DI0o 2gDuUqP03JK95S0ZWWiyhzSsTkYdqElWzkg7KeAG7KbOHaPdoC6uSYJRKgYg/3sx1V9j sg4MY1JVGl047E6fth1W2e2iAOUg0xwnc8iIUKDqv2/xRMYDqNHedDOl2Wo6eVj/DzBL YklQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fGBBzJMSY58ZqJQmQlHeFlOhEyr8JQc2d5kb0lSfqro=; b=F93l80420w/6c3DNw82+M/TlnlyXkNype4XEr8lWzB3Ib5vwJk6hyDVirhTJ/UZKs+ qJeWRHMmotFK4v1ugMH2w6MAaGdNKHdIX1aeUtXYn179kSldP63vLda0vJcOocQHy8nN jjlKIzzrjB+RfvMsp8MQzIin6CvWN5Wtr1dP/CKjBRMKgINNmb+qg1JqFvfN+4cO7obi MkQEZDS8wqf7pTrtBfGKbBMcXKqNvoWTqSmVYlWkxL3/MAAZcwsH6y1VtXKijiHr/lEj mPrEGroBTliPQV21zKsybuI6JFFa4MpDTM33oxsJ05RHcrAGB3uDzohZMlmhW9i1EuFN 7TEQ== X-Gm-Message-State: AOAM531T1GPK+1nUuteWVDx+cryz6CzyWImWwnabgglQs6FCSA/Ne6rG NrGlULXBp7TzV3wCs6PMO5j6oQ== X-Google-Smtp-Source: ABdhPJxaot0xxKsppG574C+OJUI7+QbwDO9wD7GpaSgIuhTnvgsz2bfmx0Zyc+cT6zXhVbQfrvfafw== X-Received: by 2002:a05:600c:220e:b0:394:2695:ce9b with SMTP id z14-20020a05600c220e00b003942695ce9bmr21325260wml.64.1652183887631; Tue, 10 May 2022 04:58:07 -0700 (PDT) Received: from elver.google.com ([2a00:79e0:15:13:640f:aa66:3ec8:cbb6]) by smtp.gmail.com with ESMTPSA id o23-20020a5d58d7000000b0020c635ca28bsm13557898wrf.87.2022.05.10.04.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 May 2022 04:58:07 -0700 (PDT) Date: Tue, 10 May 2022 13:58:01 +0200 From: Marco Elver To: andrey.konovalov@linux.dev Cc: Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH 2/3] kasan: move boot parameters section in documentation Message-ID: References: <5bd58ebebf066593ce0e1d265d60278b5f5a1874.1652123204.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.1.4 (2021-12-11) X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 53BF61800B7 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=R6G+qM4k; spf=pass (imf24.hostedemail.com: domain of elver@google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=elver@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Stat-Signature: ijtf4mccqowzjtusyz7ikrwgchnr3xms X-HE-Tag: 1652183881-45255 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 Mon, May 09, 2022 at 09:07PM +0200, andrey.konovalov@linux.dev wrote: > From: Andrey Konovalov > > Move the "Boot parameters" section in KASAN documentation next to the > section that describes KASAN build options. > > No content changes. > > Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver > --- > Documentation/dev-tools/kasan.rst | 82 +++++++++++++++---------------- > 1 file changed, 41 insertions(+), 41 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst > index aca219ed1198..7f103e975ac2 100644 > --- a/Documentation/dev-tools/kasan.rst > +++ b/Documentation/dev-tools/kasan.rst > @@ -94,6 +94,47 @@ To include alloc and free stack traces of affected slab objects into reports, > enable ``CONFIG_STACKTRACE``. To include alloc and free stack traces of affected > physical pages, enable ``CONFIG_PAGE_OWNER`` and boot with ``page_owner=on``. > > +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. > + > +Alternatively, independent of ``panic_on_warn``, the ``kasan.fault=`` boot > +parameter can be used to control panic and reporting behaviour: > + > +- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN > + report or also panic the kernel (default: ``report``). The panic happens even > + if ``kasan_multi_shot`` is enabled. > + > +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 > +additional boot parameters that allow disabling KASAN or controlling features: > + > +- ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``). > + > +- ``kasan.mode=sync``, ``=async`` or ``=asymm`` controls whether KASAN > + is configured in synchronous, asynchronous or asymmetric mode of > + execution (default: ``sync``). > + Synchronous mode: a bad access is detected immediately when a tag > + check fault occurs. > + Asynchronous mode: a bad access detection is delayed. When a tag check > + fault occurs, the information is stored in hardware (in the TFSR_EL1 > + register for arm64). The kernel periodically checks the hardware and > + only reports tag faults during these checks. > + Asymmetric mode: a bad access is detected synchronously on reads and > + asynchronously on writes. > + > +- ``kasan.vmalloc=off`` or ``=on`` disables or enables tagging of vmalloc > + allocations (default: ``on``). > + > +- ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack > + traces collection (default: ``on``). > + > Error reports > ~~~~~~~~~~~~~ > > @@ -208,47 +249,6 @@ traces point to places in code that interacted with the object but that are not > directly present in the bad access stack trace. Currently, this includes > 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. > - > -Alternatively, independent of ``panic_on_warn``, the ``kasan.fault=`` boot > -parameter can be used to control panic and reporting behaviour: > - > -- ``kasan.fault=report`` or ``=panic`` controls whether to only print a KASAN > - report or also panic the kernel (default: ``report``). The panic happens even > - if ``kasan_multi_shot`` is enabled. > - > -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 > -additional boot parameters that allow disabling KASAN or controlling features: > - > -- ``kasan=off`` or ``=on`` controls whether KASAN is enabled (default: ``on``). > - > -- ``kasan.mode=sync``, ``=async`` or ``=asymm`` controls whether KASAN > - is configured in synchronous, asynchronous or asymmetric mode of > - execution (default: ``sync``). > - Synchronous mode: a bad access is detected immediately when a tag > - check fault occurs. > - Asynchronous mode: a bad access detection is delayed. When a tag check > - fault occurs, the information is stored in hardware (in the TFSR_EL1 > - register for arm64). The kernel periodically checks the hardware and > - only reports tag faults during these checks. > - Asymmetric mode: a bad access is detected synchronously on reads and > - asynchronously on writes. > - > -- ``kasan.vmalloc=off`` or ``=on`` disables or enables tagging of vmalloc > - allocations (default: ``on``). > - > -- ``kasan.stacktrace=off`` or ``=on`` disables or enables alloc and free stack > - traces collection (default: ``on``). > - > Implementation details > ---------------------- > > -- > 2.25.1 > > -- > You received this message because you are subscribed to the Google Groups "kasan-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an email to kasan-dev+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/kasan-dev/ec9c923f35e7c5312836c4624a7f317dc1ee2c1c.1652123204.git.andreyknvl%40google.com.