Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp737367pxf; Thu, 11 Mar 2021 13:41:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3xLkxJr4af01ePCTinF8U8pELm9kAucSWu7xR29woOJ4TpXMPSDIU+xn4/tU19PG0+vfU X-Received: by 2002:a05:6402:3122:: with SMTP id dd2mr10546972edb.253.1615498900382; Thu, 11 Mar 2021 13:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615498900; cv=none; d=google.com; s=arc-20160816; b=c+uu9xgKQXvTGyXDR4Ee1AdkpDfhCQjVm7gW9z57Jt+pp5oALBImn1Kj9dZUy8ogd1 2rWc5KpwIYXWszHhOcZipeRIi627hRlQVZ17q9QVjvzY1vL73SrCdxw9RUBLevYgvRs3 uqBMcm7ZVg1/5AHQKzgi9Kxygzg4/hGc+VdVygG2Y+Y2YOTfVZWRMEl5kGGJ+rbY2u4+ AXxDZWJIJglY4IfGkIHUrUhrNkQLrIBo8nObZNFWiYytqkllizRCjGiq7gGM7preO8lo cUEGQkjkzspA65z1jDLIbX1LvhsLGIkdykKmaq/QoJFhEBmXYZYWOdNCebYGSYKuJJ0T L1nQ== 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:dkim-signature; bh=jCUwUXSRYRP2LJ367pVG9mu783jEZOVPApZYYYorTcY=; b=exrWflfCuqxb86DMFFLuc3uauPiwdIC2OCn/FZYOcZUJFkvvR8hT/CjZzJ1BJ9vVUa mPlQprLQpTzDkFnXvHgWmS1WuCDn9s14rvLepxEUgxFrMXVl2vx4fWpaDQX8sDlQiUVC 8OduD6Zh7ZZ72t0WeQJVj6jMR8DKJ1F/tE7DLeI7CSmwNjMJdEMbB5qjlsUfcHWmt759 EmOkKHOPUy5ws7TcB4m3qii+6+SSkiO4VZji6JtQQoyWWXAYyo/RfEzcONMXHlf4kKIg TUAd+vXEHpj1G7v5s/WaywYZJZBXFEYEXd624WEJR5NioeIg17ZfmkSNtnyY5mm5AvCi Ro9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Plz1xq3S; 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 a9si2521176edr.332.2021.03.11.13.41.18; Thu, 11 Mar 2021 13:41:40 -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=Plz1xq3S; 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 S231301AbhCKViR (ORCPT + 99 others); Thu, 11 Mar 2021 16:38:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230372AbhCKVhp (ORCPT ); Thu, 11 Mar 2021 16:37:45 -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 4D65FC061574 for ; Thu, 11 Mar 2021 13:37:45 -0800 (PST) Received: by mail-wr1-x44a.google.com with SMTP id h30so10153442wrh.10 for ; Thu, 11 Mar 2021 13:37:45 -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=jCUwUXSRYRP2LJ367pVG9mu783jEZOVPApZYYYorTcY=; b=Plz1xq3SLytyAFVQRIdDqpfeMoVJQVQnjL8v5eLWlHpRU3ZXHwZ7nNYQwGHB8jkEl0 oec/CqXdexSMPCB/xEQc8lqn+4mP/LOkm0oqY//jnkP3wzYEtNThi7FOfPPphX4RmoFE ao0BmeAMJqqGLTJkM09Ht/ur6e2pTnhYW0cyFZmYZTeP54Hg1c8nULI2bpOngYV9skI4 nlX9Ks5TI8iw8G6P5wTshuA2NBNFjML5xjZ2/0seUMwzVpI2lSb/a5NuFtLu1Z6COWrK /Zj1Uzg5xBCAF7rntkf4bj4+xzxSqLYPE/b+KjqGXV1+z3P9U99E669EFLETrkPaiJWQ MQug== 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=jCUwUXSRYRP2LJ367pVG9mu783jEZOVPApZYYYorTcY=; b=NfnNbEh2Qnzg2vZTe4LFyDNM7XwM2d1iYshhiiIQXPMOEDYJY6k/AlgVp7rMqNyMrD hCvwjBhxapTuXwUuterRdZ3zjnqdAQsDRjlRRAGtNmLD1a7m4DLEP7kJwOeL7NpH2u85 a8wcVOwp2474Ad4WlzoHtd96eGGQr/CZJ+X7Wu4Xi2YfyvNm02/quPaxN+jJJT0C3iAD 75M3QLr0kFJGCV0/ARP5bd22NHIF6UXfZR0ffd827ek+EtohITZn63gn8EcnZGezgBc7 p0ibleDfXhYatXnmhsQxx1LIcSopxgtVulCigU+iJhyyBsTa27np6Zu/QL2673Og4GJR DhmQ== X-Gm-Message-State: AOAM531gE3lQBeUeKuRpVCU6BgJFe7oOP7aJr+JpnLTsJS+8HZhk4dcX x+BcHniCKVQHudd+dVFuKJpa9hEp8ZTEgkcv X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:95a:d8a8:4925:42be]) (user=andreyknvl job=sendgmr) by 2002:a7b:c0c4:: with SMTP id s4mr10327657wmh.9.1615498664022; Thu, 11 Mar 2021 13:37:44 -0800 (PST) Date: Thu, 11 Mar 2021 22:37:20 +0100 In-Reply-To: Message-Id: <318ca25e3e3d32482c0155b662ce4057e436f9cd.1615498565.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog Subject: [PATCH 08/11] kasan: docs: update HW_TAGS implementation details 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the "Implementation details" section for HW_TAGS KASAN: - Punctuation, readability, and other minor clean-ups. Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/dev-tools/kasan.rst b/Documentation/dev-tools/kasan.rst index dff18e180120..f5c746a475c1 100644 --- a/Documentation/dev-tools/kasan.rst +++ b/Documentation/dev-tools/kasan.rst @@ -270,35 +270,35 @@ memory. Hardware tag-based KASAN ~~~~~~~~~~~~~~~~~~~~~~~~ -Hardware tag-based KASAN is similar to the software mode in concept, but uses +Hardware tag-based KASAN is similar to the software mode in concept but uses hardware memory tagging support instead of compiler instrumentation and shadow memory. Hardware tag-based KASAN is currently only implemented for arm64 architecture and based on both arm64 Memory Tagging Extension (MTE) introduced in ARMv8.5 -Instruction Set Architecture, and Top Byte Ignore (TBI). +Instruction Set Architecture and Top Byte Ignore (TBI). Special arm64 instructions are used to assign memory tags for each allocation. Same tags are assigned to pointers to those allocations. On every memory -access, hardware makes sure that tag of the memory that is being accessed is -equal to tag of the pointer that is used to access this memory. In case of a -tag mismatch a fault is generated and a report is printed. +access, hardware makes sure that the tag of the memory that is being accessed is +equal to the tag of the pointer that is used to access this memory. In case of a +tag mismatch, a fault is generated, and a report is printed. Hardware tag-based KASAN uses 0xFF as a match-all pointer tag (accesses through -pointers with 0xFF pointer tag aren't checked). The value 0xFE is currently +pointers with the 0xFF pointer tag are not checked). The value 0xFE is currently reserved to tag freed memory regions. -Hardware tag-based KASAN currently only supports tagging of -kmem_cache_alloc/kmalloc and page_alloc memory. +Hardware tag-based KASAN currently only supports tagging of slab 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. +If the hardware does not support MTE (pre ARMv8.5), hardware tag-based KASAN +will not be enabled. In this case, all KASAN 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 +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 does not support MTE (but supports TBI). -Hardware tag-based KASAN only reports the first found bug. After that MTE tag +Hardware tag-based KASAN only reports the first found bug. After that, MTE tag checking gets disabled. Shadow memory -- 2.31.0.rc2.261.g7f71774620-goog