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=-23.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_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 881F8C433E0 for ; Tue, 12 Jan 2021 07:40:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0E39721707 for ; Tue, 12 Jan 2021 07:40:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0E39721707 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 5BB218D006C; Tue, 12 Jan 2021 02:40:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 51CF38D0051; Tue, 12 Jan 2021 02:40:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 40C538D006C; Tue, 12 Jan 2021 02:40:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 240A78D0051 for ; Tue, 12 Jan 2021 02:40:56 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E7C4833C4 for ; Tue, 12 Jan 2021 07:40:55 +0000 (UTC) X-FDA: 77696326470.17.shoe75_13123ff27513 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id CB2B8180D0185 for ; Tue, 12 Jan 2021 07:40:55 +0000 (UTC) X-HE-Tag: shoe75_13123ff27513 X-Filterd-Recvd-Size: 6170 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Jan 2021 07:40:55 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id c7so1150961qke.1 for ; Mon, 11 Jan 2021 23:40:55 -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:content-transfer-encoding; bh=BKnokxRD1I6llLoX7662tW98pzgHQdpcOb6fgDSpfGE=; b=CPW6waRy7HCf0fFBnkmtF16rAs1YeatzlNS9Mu/UB63AttABUkS4rlk6uf4jJmN+q6 dz25S1JgoXSJay6ZrrjWmMGqzWvw/TUAEaXHG1ryK07eG1LkS1LD39n9IQWw8fs83xP3 ccvrva9Dz165V0PkkR4iYoziBND5Vpjdf85cZebSD3K+djperjQG8ZFlBKSENHGpGIJu CDVe2xNORIwrfV/vitXk35/Vx3R9IudeY7lAN+1ScgJJaCNTJ7V6hHY83mfSAM2d2LAW f+9TFSStJzkornSFgs+GbXH9Gv23BePE9KkwI0EjtpouvGqm5TUL4bOR9U5wLfzvp+xO 0iWQ== 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:content-transfer-encoding; bh=BKnokxRD1I6llLoX7662tW98pzgHQdpcOb6fgDSpfGE=; b=a7Q1nlDAXFIDyPjD2A7H2VXjF6TA8ayfkFVDfCMzTPK3ZpOR+DawrpiVv8m62NkXTl 12xYHnuPnuY+PxSfLeiJGh/lRgZ4EPSorTLiSn6lYGy4dAD5fiih+9wEvkX+nDpWmCJK UO6nyd1QMo2Vv7ixh+5Cl96MCwh70hlU2/yHXlidyU0bbdvC8aHTdEVXtMmsJqgb4d/7 VEZ9TzWqIv30/qTyN6k4zLOjfEIEHmcVrd7ZZsNuB13IodJoLB0ogbyPNwde+ZVRqkNK kJY3fAoYSN4Xyer36mNeQtk/u/FjI7RjF1fH3Z95P1cAHMsuFDU6X9DCdq5ubJHGMV/M TrXQ== X-Gm-Message-State: AOAM531RsTy1mvyVnbeqwbe0TYcyIyumylC7KvB7gUCfTfNR71EKSqFx WrG2P0Y39y6dWaQGx85XL5JdssSL7VhRBs2QVjhUzQ== X-Google-Smtp-Source: ABdhPJwnDenEpJQwgyHM2/JdCNJ81bm+LlTg1WMoKkD9MoAviJRmD3yhcTCqZGcs+L8RB+N7HB8UrwbsnQ/9yS147cE= X-Received: by 2002:a37:a747:: with SMTP id q68mr3196410qke.352.1610437254475; Mon, 11 Jan 2021 23:40:54 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Alexander Potapenko Date: Tue, 12 Jan 2021 08:40:41 +0100 Message-ID: Subject: Re: [PATCH 02/11] kasan: clarify HW_TAGS impact on TBI To: Andrey Konovalov Cc: Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Marco Elver , Andrew Morton , Will Deacon , Andrey Ryabinin , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev , Linux ARM , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Jan 5, 2021 at 7:28 PM Andrey Konovalov wro= te: > > Mention in the documentation that enabling CONFIG_KASAN_HW_TAGS > always results in in-kernel TBI (Top Byte Ignore) being enabled. > > Also do a few minor documentation cleanups. > > Signed-off-by: Andrey Konovalov > Link: https://linux-review.googlesource.com/id/Iba2a6697e3c6304cb53f89ec6= 1dedc77fa29e3ae Reviewed-by: Alexander Potapenko > --- > Documentation/dev-tools/kasan.rst | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/= kasan.rst > index 0fc3fb1860c4..26c99852a852 100644 > --- a/Documentation/dev-tools/kasan.rst > +++ b/Documentation/dev-tools/kasan.rst > @@ -147,15 +147,14 @@ negative values to distinguish between different ki= nds of inaccessible memory > like redzones or freed memory (see mm/kasan/kasan.h). > > In the report above the arrows point to the shadow byte 03, which means = that > -the accessed address is partially accessible. > - > -For tag-based KASAN this last report section shows the memory tags aroun= d the > -accessed address (see `Implementation details`_ section). > +the accessed address is partially accessible. For tag-based KASAN modes = this > +last report section shows the memory tags around the accessed address > +(see the `Implementation details`_ section). > > Boot parameters > ~~~~~~~~~~~~~~~ > > -Hardware tag-based KASAN mode (see the section about different mode belo= w) is > +Hardware tag-based KASAN mode (see the section about various modes below= ) is > intended for use in production as a security mitigation. Therefore it su= pports > boot parameters that allow to disable KASAN competely or otherwise contr= ol > particular KASAN features. > @@ -305,6 +304,13 @@ reserved to tag freed memory regions. > Hardware tag-based KASAN currently only supports tagging of > kmem_cache_alloc/kmalloc and page_alloc memory. > > +If the hardware doesn't support MTE (pre ARMv8.5), hardware tag-based KA= SAN > +won't be enabled. In this case all boot parameters are ignored. > + > +Note, that enabling CONFIG_KASAN_HW_TAGS always results in in-kernel TBI= being > +enabled. Even when kasan.mode=3Doff is provided, or when the hardware do= esn't > +support MTE (but supports TBI). > + > What memory accesses are sanitised by KASAN? > -------------------------------------------- > > -- > 2.29.2.729.g45daf8777d-goog > --=20 Alexander Potapenko Software Engineer Google Germany GmbH Erika-Mann-Stra=C3=9Fe, 33 80636 M=C3=BCnchen Gesch=C3=A4ftsf=C3=BChrer: Paul Manicle, Halimah DeLaine Prado Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg