From patchwork Mon Nov 23 20:07:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11926395 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=-16.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 BD1F5C83014 for ; Mon, 23 Nov 2020 20:09:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3BDBF20715 for ; Mon, 23 Nov 2020 20:09:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="HCFwctjL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BDBF20715 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 577676B00A4; Mon, 23 Nov 2020 15:09:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FFCE6B00A5; Mon, 23 Nov 2020 15:09:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A0246B00A6; Mon, 23 Nov 2020 15:09:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 048A26B00A4 for ; Mon, 23 Nov 2020 15:09:07 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A35EA1EE6 for ; Mon, 23 Nov 2020 20:09:07 +0000 (UTC) X-FDA: 77516771934.13.power10_3a13e7a27368 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 82C3618140B70 for ; Mon, 23 Nov 2020 20:09:07 +0000 (UTC) X-HE-Tag: power10_3a13e7a27368 X-Filterd-Recvd-Size: 5126 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Nov 2020 20:09:06 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id e15so103079wme.4 for ; Mon, 23 Nov 2020 12:09:06 -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=a0i3AqOqSlN3mSBa2/h8s/3PQOlnMPwV+np3TVLmk30=; b=HCFwctjLT762qsWSFnyCoceQR1WwjqODXCAB4DXKVtoXdhRkxuq4HIhodNj6AHwwsK ASQfwf/znzdG9tsQQEbN8/zSWjfzuSpt9Q8F7+5EZQQOpi6f5nnF0ZRMew0fyQ1FtPPH g2YbOcXtSSdFjbXpyd3VmVi/ne0woFCwhlKt45TQhH62b2Ws3jcqTtTRb7YkowmDqA1o 27zUgsUxdFaOU7dKQarCgo0RdxamvCdnA+APaDxNrGZZCRBYp978FFnbLRqZvIV7IyuY s6pepICM5x0UM5D/sMcgrw7z0aUsANisZ9YQaoK9N0hUJOlOa2+zu9iOWOYetR4vkbYp Bn3w== 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=a0i3AqOqSlN3mSBa2/h8s/3PQOlnMPwV+np3TVLmk30=; b=SLpWlIpYxg/ab68SGG2JYg1ZQ704M+lfL9NsriCx+wmZ6l+eqUTc4MYj/3nVrO7Zq9 j8f6GG4J8FI3/eQlylBKUI6H8Shups1KFTxsCTWClG2oH76KzoGBX/SZj3BVyIJYzDI5 7tg32mi82hKCx5W2M1Ty7jgWWgGWBAY2LfCt2T69Lqe4mSvJR7k0XEEk29E1IMY/KJLR ihJlnuXJOBSowtntYCg6Oe5gBuv9tgCYgvpxNX/DrZaGRY+KzMsycIjNrJn+wo0PZYyB h8XJhdAz03R4DNf4nNHR/Cj0MB2DVmICDseoh1+ZAiZPGFJlbcaJJ/MhPR50fxdveiIe mW/A== X-Gm-Message-State: AOAM531dJ7YGktmPctlkmlvwNn1qObQfJbkTTr4kbuvP/WeAh+oqEvmw nARAW3VQmhZjLGlXMgfnln06LBzNA7lSNMLU X-Google-Smtp-Source: ABdhPJyocb4hAm3ir2t8Dure7BSo4y6ote2SX75mLc33oEVsWpbUztBS/p2ERVSjCbuUqjDba4gjyIC15du3F/Ki X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a7b:c1cc:: with SMTP id a12mr202256wmj.0.1606162145370; Mon, 23 Nov 2020 12:09:05 -0800 (PST) Date: Mon, 23 Nov 2020 21:07:43 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH mm v11 19/42] kasan: rename print_shadow_for_address to print_memory_metadata From: Andrey Konovalov To: Andrew Morton Cc: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , 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 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: 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(); }