From patchwork Tue Nov 10 22:10:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11895679 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=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT 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 CB250C388F7 for ; Tue, 10 Nov 2020 22:22:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DC36206B2 for ; Tue, 10 Nov 2020 22:22:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OMs+ZedE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="oZFYWnks" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DC36206B2 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6NQeMUka3ZsvwPW9COTwrMR6Iu9WjAtO98N8J9vYdpM=; b=OMs+ZedEssN/4aMLtr91MyHtv lejPi85ITL22gOM4BdTQSQnh32kNUP3XzE4A+gPa0jEKC+x79383a7+IuMfeDPHnIgFlFwmjq2ngX v4NJUudUS5x/YXapEg+409jswItv/y7ZXrnExRb856EJHw3cNAEpmSgVl5O4RWIwPCCIsmRDp9Ntd D8ORyjqGa9qTaO/fVVpZivnE4kJk0BiIDPrJ4e1iKTHJng343HTeMDUWQVWNPqwozgE+9ChvAqIuR xrlHgPw9wk3IURP+usFrmBRkrYDv2E25kz/gYuxb3hW0yOvkHYutBHwgAFFK11iM2n1/fGdWnxUXj C/3dBj5yg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcbyr-000814-OD; Tue, 10 Nov 2020 22:19:14 +0000 Received: from mail-qk1-x749.google.com ([2607:f8b0:4864:20::749]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcbrq-0004jj-Qk for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 22:12:12 +0000 Received: by mail-qk1-x749.google.com with SMTP id m76so205867qke.3 for ; Tue, 10 Nov 2020 14:11:55 -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=F7/1KPTvjV1FWBHoCg0P+/y9T50JI9o61TdT17vNWe8=; b=oZFYWnksmbuKt9cjAl4A/CzWuDkl+po03Onfce74bBNCj+InqImRtO2/Hbul8fPpCJ JXQwiYCyMA3nZoyBNh3rBXbC9UY4jYTQx5Rcl139RMsYNC7vTyicqbXUurc3vyT41Lh2 x9/CbHX7tiJGkQzYYEMAQRgNJnBQsLSHvpTugGY5jtgC/JbJjnX0AZDQgpfZqcR8MPrV SvDTrriyYW9zoVvwDntcJDUI5olNSuwTIKKEao4LZbaS+W0x1bZ8qwXnOZsgHKLwY0re aEjAGZrXAk2pkXF1PVd1bXaglyUrrNe4mTO2HFx879k2s4w1MXZthZvtA5v1XAYt3QPY Xivw== 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=F7/1KPTvjV1FWBHoCg0P+/y9T50JI9o61TdT17vNWe8=; b=Cvmd9MVF6hWhZj3tOL5LQDAKOS1D6fUX69j0/ckrvNiET0MfKjfhsj2Q2vYK4JyqU5 SL32Vg7xcspDX9mNSHaopAscwsJrmCQJ4ViK2wsC471cWgqcIoFldWPsXsurcUr8IV6s u7bDxBQ54JvXfCpXRFeXUBBRCpBD1LARIuy70oEtfnokOx2q6aj6ZjQsiClM/Di5+1g4 D8s5be4veA5dwGBGGQfpQY02O1jSpHEOkedoBLhFBjCVKNiqO0K6+PQ/rCWGuUgiMw8j uHMqgYFMmYtOAGNojmVuTtRmVoUgUQFsahdmQrNi0ajfmFbSZlqffJRSB5kDI2/D5jYC gj7w== X-Gm-Message-State: AOAM531f4dluV98vZf49h00msi4KMhimshQJ5mCfi3AimyK9HcuZ3zTd Y+dh1tu4LSgzx8ICtwRETVttyepEbAkVV4TM X-Google-Smtp-Source: ABdhPJxidrVLv1poQn/M8x+CfUunzlye6G/3PAr5ieQaIo40Q12o8lXQcVe+pm9Z0jn83smT15CZLdNIn80gkItf X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:ad4:4514:: with SMTP id k20mr21206364qvu.1.1605046314408; Tue, 10 Nov 2020 14:11:54 -0800 (PST) Date: Tue, 10 Nov 2020 23:10:17 +0100 In-Reply-To: Message-Id: <47785f5259ba9ed493d2ac94ec7c2492fa5c1f14.1605046192.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog Subject: [PATCH v9 20/44] kasan: rename print_shadow_for_address to print_memory_metadata From: Andrey Konovalov To: Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201110_171158_982589_FEEB70AC X-CRM114-Status: GOOD ( 13.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Marco Elver , Andrey Konovalov , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Ryabinin , Andrew Morton , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a preparatory commit for the upcoming addition of a new hardware tag-based (MTE-based) KASAN mode. Hardware tag-based KASAN won't be using shadow memory, but will reuse this function. Rename "shadow" to implementation-neutral "metadata". No functional changes. Signed-off-by: Andrey Konovalov Signed-off-by: Vincenzo Frascino Reviewed-by: Marco Elver Reviewed-by: Alexander Potapenko --- Change-Id: I18397dddbed6bc6d365ddcaf063a83948e1150a5 --- mm/kasan/report.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 2990ca34abaf..5d5733831ad7 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -252,7 +252,7 @@ static int shadow_pointer_offset(const void *row, const void *shadow) (shadow - row) / SHADOW_BYTES_PER_BLOCK + 1; } -static void print_shadow_for_address(const void *addr) +static void print_memory_metadata(const void *addr) { int i; const void *shadow = kasan_mem_to_shadow(addr); @@ -338,7 +338,7 @@ void kasan_report_invalid_free(void *object, unsigned long ip) pr_err("\n"); print_address_description(object, tag); pr_err("\n"); - print_shadow_for_address(object); + print_memory_metadata(object); end_report(&flags); } @@ -379,7 +379,7 @@ static void __kasan_report(unsigned long addr, size_t size, bool is_write, if (addr_has_metadata(untagged_addr)) { print_address_description(untagged_addr, get_tag(tagged_addr)); pr_err("\n"); - print_shadow_for_address(info.first_bad_addr); + print_memory_metadata(info.first_bad_addr); } else { dump_stack(); }