From patchwork Wed Nov 4 23:18:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11883249 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 0D0F5C00A89 for ; Thu, 5 Nov 2020 05:03:54 +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 80BD52083B for ; Thu, 5 Nov 2020 05:03:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="w6UOsxNs"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="IbB3ryrL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="MHsAFWSN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 80BD52083B 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=YmmtdMhCjD1E2AMLJxsMGcvi8ho7A3bbG6237EAU9Y0=; b=w6UOsxNskmIwfds5HbClThICv ytqRS/QzGmc4tkdFyN1RSTit01XsU3VAgIvGvl7LlrAbd7eK3Y6e0APQ7Z4G3Q6k/JN2DSWlqHrgR lD4l8oXZX8vcIvry1FcZBcwYyGAXfJEw7E+MLD139vQmKfaKUnT5MZPoDK7VqdlJbBifZWhAxvjSf giMOBizfAnifJqriiMHovOTHSF53MbvXkbG0AfTe54hmceiriefYjWu9rwVfIbiZV0rtINV/DflVb mzR8awlwvyo5bzVQR2pS+ZDpJ2FTZIwj83SBOSMt+qcs52ixdrQAqmrqget1KseFnpNLYv7WV/2Nw +eZnsIhKQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaXPf-0003NC-7B; Thu, 05 Nov 2020 05:02:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaW5E-00016k-Q0 for linux-arm-kernel@merlin.infradead.org; Thu, 05 Nov 2020 03:37:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:Cc:To:From:Subject: References:Mime-Version:Message-Id:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=96T+1f9i/jCV3zB6gHtRoH9MAYIWASsGc4o7euuXITQ=; b=IbB3ryrLNaQv/i1r3lGvL9X4QD cmES0naZFDELPTsxyf6ocHxN777xJzVoqLsL5JG9i3eM7TlmeB9szfsnR24J+jN+R4gNvkjw02Uhw qea3dquTRAXRlh+LWyOvieat29jj7STkEIgPw0fU8aJUCR31547m/G6OkKDBm2XTUjlutiMJXUJHd Isgckcbp56Bt4gV5rhpe7rsd8tQt+WsGWzGRbrBXs0L/TXDWmv5NLqjsrzPuG7QuaCVEG7MfdOxFo k7g+siPPhSNwtKND7wXOfQdRhH3hFtZFWFVKfSfbw+KLCsD0NRJDSOvyGL3fDEY0Wu0UJxjr3emaa VzGarIaQ==; Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaS5K-00043z-EU for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 23:21:00 +0000 Received: by mail-qk1-x74a.google.com with SMTP id k12so14453676qkj.18 for ; Wed, 04 Nov 2020 15:20:58 -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=96T+1f9i/jCV3zB6gHtRoH9MAYIWASsGc4o7euuXITQ=; b=MHsAFWSNNNsmPyRuCRBRe5S5UJlJTgrmBZO2ihBxvYR0I9yYigF63VwzzPho62nZs2 VLtTKG/brXnczBsTg/i2aly4WyjggyM4qk5OgjEXTMS6woyfj8oUQLECz4dnR7CYmlCK P2hAhriFaidiECgnMceqscf76Xp8o3bbo8VrPcMQFeLKrXv1UFPRc6fihUk7uiYivJRY /Psb2wdAmwOpskpJVZWh95yRjI1C5Gce+azuH8yjGwSerALSKQTYVjqWvilB6QagDvv7 yNsYVvfeAHhc4rqWuseztMtgbrSeVVBL0ZtROar7FPeVqCV0fj2xagBhvbamoTlcYhxm Ntrw== 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=96T+1f9i/jCV3zB6gHtRoH9MAYIWASsGc4o7euuXITQ=; b=oepWs+1Odf7bMKETajAqkPeAxVN6MNgjbZ49jyiVqQ1EB7H7TNg255kLKeXtyd7s1K 64+vflH5Fix+wYJH37/TXOvY6RtgyTPogzf25G9hsOxNy+HwYkjxumWetd7GkKgT4Ar0 IkQ2hRYScH5vbh1DrjPTKTKKB5smJ3vh9PYQpLDK3EHN14n+JjJuxP0Zkx0Na66XibzL 4ZTKhZHiZphEm2pHzJlrSkmjfLb/1UAAaF2JNrOSPuccunjlwbiXySfFzCEK/fyYRZpM gnei341PiXsI3kZA918sNM2nEjM7l1nH5h4MH7GszpZF8jJBYRWw7p/7csDYdnez23a7 MIPg== X-Gm-Message-State: AOAM533PVxErcOI9HDszdrfqHCsKPTg6PHXRAbwjY78isWftIiV+GJF5 Wz/KKZ7/rD5JfDIM1c3ZjBIsmR2C8vpT874g X-Google-Smtp-Source: ABdhPJyY4vYywqcrGkIXWcGHdEVetd/tg0ubApwhK74pxGohLkeevkUn1OS+r+BUFIBRiQwZoc1eeXrnVoZyf101 X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a0c:a2a6:: with SMTP id g35mr293187qva.4.1604531994786; Wed, 04 Nov 2020 15:19:54 -0800 (PST) Date: Thu, 5 Nov 2020 00:18:35 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v8 20/43] 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-20201104_232058_594844_BFBA7A24 X-CRM114-Status: GOOD ( 12.99 ) 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 --- 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(); }