Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp527716pxb; Thu, 14 Jan 2021 11:40:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDXZP8u0K7fpIih0IubNF7jU+kPfTtQF2Jl2x2nigf2mpWHckCJ5nF2jUYdZMOsJgg7p0p X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr6551020ejn.484.1610653214309; Thu, 14 Jan 2021 11:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610653214; cv=none; d=google.com; s=arc-20160816; b=prrIWfvrW6pWABVZiYqLew2V6YGmAnmcvsOXPi/9qtfXYSgjQ5BBtcokPluSy/4Riz dNmJegztvC3vhTCujw2ftnS8Zc8DcF9AJE8S0uWEKYxTudmbT4vqs4vqXg8Rm5c1MWwc rLag8FcqBKlrbRqf8bM0cySYYQHojjFfpYnOCb94eeDvGENrcfH3Y/kV69zpkUUAXBwB dx98eDEdTfPkxqC5bFDu674z+sjrneRfAEK0cfh1XW0W1P/1pg1YyCGWhcvMKbLpvMWK AuDnfGu/goPqNdGl5IuP8KEG89p3U1WuyXYu8v7njekEkFr4XYZ+IAJSmXZ8rmlZFm6r twTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=d+lRqXXla6mV/kMKnUzgl/DAB69C3QZUVHCf/SWSD4s=; b=CyNePBXh0NEAWgbq3PmoaylEyBUkmFTXSE6b5weuCI666Cor+yvcZsGcWxrtU+13k0 k09D9PWEegitp97KpuvTeWnaGH+pHxJurqVQQQniK1HPV0Bcyte9PbgtdE/OqgPVb4/w hTblj8+H4RczqvMdoDF6BHml4jiHuG/S6i1LFF+GTscElnBdGNT9dEeWOSFo7tQzOCIl BbURJ7gbET5fl57xjQQcVfLDur1u+lWLraREgletpQIApePW0P//yqLgmJ9cRIfM3D2H iGhzlzu1dtL16pandNak7Acp0dTILph5TqHKNjrZXafDw48z/n3sqjODTNH68y6RzTJk dLqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HqcwClnA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si3130491edi.83.2021.01.14.11.39.50; Thu, 14 Jan 2021 11:40:14 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=HqcwClnA; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730047AbhANThX (ORCPT + 99 others); Thu, 14 Jan 2021 14:37:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727063AbhANThU (ORCPT ); Thu, 14 Jan 2021 14:37:20 -0500 Received: from mail-wr1-x44a.google.com (mail-wr1-x44a.google.com [IPv6:2a00:1450:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F20AC0613C1 for ; Thu, 14 Jan 2021 11:36:40 -0800 (PST) Received: by mail-wr1-x44a.google.com with SMTP id i4so3053134wrm.21 for ; Thu, 14 Jan 2021 11:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=d+lRqXXla6mV/kMKnUzgl/DAB69C3QZUVHCf/SWSD4s=; b=HqcwClnACemM2BreGXjbZuHbh6LokgqSKM886rsXhYMs0v4uwRJA/1I64zVxzJOjLN 0dI01vPBjEImR5HaBOvV2GaFYeK7da2uzLOajZcjbp9ZVjEf0p8KiMcMO5/ag5qv/SLc BO+3zoUsJEZsaX8uA3f6J6eut+UmGtFPik3sWGDaCDXar5io/R7Kr1xIP5z+4xEf2JO7 YlMp1/UwDbbjGlycrk76vLmKAtCFCmCeFejImudBUceZcvxjkCmlTSDov7BYFHDymrwn lZisrTqwqpUJ8QgHmAaEG1Vzj9OVqFxk9FbyHYj8ePt8DqewkN3tr49f3NfolSHqvzON xDhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=d+lRqXXla6mV/kMKnUzgl/DAB69C3QZUVHCf/SWSD4s=; b=HPAm8/T5lyjJJMA/uCOET8Ixx/WYaI6AXnlMai4rbzy4s/yCxM8d+Oui5C0oQGcEA1 P/XyCMfQLpalBL2u/QZDB7iK+Vxi4DIpYxlEdbmtRjKqZsD+Ez7fbuLIKbq09vh9UlUR bJEKcLodc3IvjwlsQhGPb5Rkor4lek72OxqFVViAN8BjWgyoiNPKy869Ry9OVW4DxZpw +7dwtxvaIA2QY27sU1QnUuzrMlSoPb+/1nO98/qq7eK3H9fcwSdU5U0VCYXVQe/uKoO4 Lmt7nxWSqje71dpkABoew7mKjFrNdbnqtM3XKz4751tVpdup976tWPc34ldEEE+/AaHI Q2lw== X-Gm-Message-State: AOAM532dY2GG6jacEEpqNOz61B4ymdPmm3bsXZY34fJ/rKukNoKOUqso zRzVkWAib/FivmuJzNqIZjoV/bUu+2Bgak8U Sender: "andreyknvl via sendgmr" X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a7b:cf3a:: with SMTP id m26mr2355477wmg.55.1610652999318; Thu, 14 Jan 2021 11:36:39 -0800 (PST) Date: Thu, 14 Jan 2021 20:36:18 +0100 In-Reply-To: Message-Id: <2ae5e3db477b08bddfe36a5fc7fb10955cd49f95.1610652890.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH v3 02/15] kasan: clarify HW_TAGS impact on TBI From: Andrey Konovalov To: Andrew Morton , Catalin Marinas , Vincenzo Frascino , Dmitry Vyukov , Alexander Potapenko , Marco Elver Cc: Will Deacon , Andrey Ryabinin , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Link: https://linux-review.googlesource.com/id/Iba2a6697e3c6304cb53f89ec61dedc77fa29e3ae Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- 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 kinds 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 around 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 below) 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 supports boot parameters that allow to disable KASAN competely or otherwise control 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 KASAN +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=off is provided, or when the hardware doesn't +support MTE (but supports TBI). + What memory accesses are sanitised by KASAN? -------------------------------------------- -- 2.30.0.284.gd98b1dd5eaa7-goog