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: 11926591 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 771D7C63697 for ; Mon, 23 Nov 2020 20:17:28 +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 AFA5A20657 for ; Mon, 23 Nov 2020 20:17:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hgPEpsEs"; 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 AFA5A20657 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=/oRKmWbB8yi3sL8vwCfxIDA4SfVtvRXYTDeUz1G/CgI=; b=hgPEpsEsLPVtMw9y1GvKMzWXH RWa7jOBmHFPWqBAXAFUdMV0dMZyX0c89FGfSKTDckTNXIoQ64OeLkJuKFTBD5tGZpeHGX46sL83Dc 6whKnDsAGutQguC7pK9SzHtf6gXaRdwrAetuV5MOJ9W7i4o4f/A4Q4F5HyvCYuJ6KiGNckB7+nTNo kwG6cdMPglEeiBwHTd9U64OYj9PfyLR/BAhxjjEw9EcqFzNff/DMD2Rj1zyEyngiBgc4m6NikPxdG POFDD4m2j7m+m2OMo/EUBjWtdULnD2X2o0lGTfYh9ygk7h8gzMf9qOz1e7T5A3+pSUtEqsps9qx/y Z9g/V+exw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khIEB-0001pl-7k; Mon, 23 Nov 2020 20:14:23 +0000 Received: from mail-wr1-x44a.google.com ([2a00:1450:4864:20::44a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khI97-0008A5-16 for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2020 20:09:34 +0000 Received: by mail-wr1-x44a.google.com with SMTP id r12so821306wrl.3 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=mHxgjtu3CmqhH+xrYWEflaBQfEY2S0Q+JYfkdb2t4QS11//BGBbvHEu/C66lt6F7lU NPsmZsOxVNOB2vQJmbSe1cv0qBpR4IO9x1k8fxH10scvUJvN5SGSug/9KKCimEtIf0J8 2h9lWhHenyddVNGvoVYrmcb2gaX9b15+/PNQDOU9KbrergUrTIpigg0s7lGm3rDOUpi6 602VkOdqxjNfQozEpPQUV7xAb8bH1KYpDDfs0QaK36s/0Q4J/4GzdrPN6b+jnbMn1i08 Q3tNZWcvnQekCFnvsllg3CdmVmNyGXD4avGsYPJ/jNApgOeM0OVAuPw5DnrI7VM2Vz8e wrFw== X-Gm-Message-State: AOAM532gh+Tx1r2lZPvaGv02L6WTWvY/5wCOm1aL2OBjip7RpCEZ9nBX NathPAvg9EFCjGUdoptYxyJLEETjjO06a6al 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201123_150909_194779_51050617 X-CRM114-Status: GOOD ( 14.33 ) 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 , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , 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(); }