From patchwork Mon Nov 2 16:04:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11874391 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 A3546C00A89 for ; Mon, 2 Nov 2020 16:11:55 +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 334A422258 for ; Mon, 2 Nov 2020 16:11:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="P+7Ymdim"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="jW4TR/kD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 334A422258 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=P+7YmdimN62fFRgns9x4FHnLn +36VeoN7gNuVUeFbQoN8YvNUzIWSbwdpC/LpCzMsYC5pQbAw7/m737CXGUoGIKKfoPDK1PGyn5xcK 3RpWbk7a6DMG8YXIF/zhdmrpRcjutMbEXCNeuaZdn2/ZkmkeHal2ZTynXhyMuc6tUTD/kQcWqDyMk mlpIW7NoMszj+21ZLFnljB7jBCD3VJHS1cs29AP6GeJdqiJIe2Ym8dOetIeFrjxtYMqF4/banPuVI iOZ6BKpUtGo53yQ3Iw6ecJ88pmztvUGVBPnxgurN+KvrbTeWvcjJuvKUVU2pGfXXod+7ipdujg1iu ijq2i8TnQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcQC-0001vl-3Z; Mon, 02 Nov 2020 16:11:04 +0000 Received: from mail-wm1-x34a.google.com ([2a00:1450:4864:20::34a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kZcKs-0006qB-BN for linux-arm-kernel@lists.infradead.org; Mon, 02 Nov 2020 16:05:44 +0000 Received: by mail-wm1-x34a.google.com with SMTP id z7so3501727wme.8 for ; Mon, 02 Nov 2020 08:05:32 -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=jW4TR/kD0Gk4k2wdBuNEPB+r6ROZb4+/ETtDZ2hkgbo2o3QWFGdN08jY0Z+OmN1Hke X4fhFHbo57T+zxKvTaxtA8k6ZEvgSlJR8skMwZL8Rcta10r5wPvMulit+SFNlv/qhGiY q9KYiLeaXE/yGFNdqnNefWKGclL9WLnMYu5jrPJPjZSUIOgY1DidIczwuhQ8wc3SpyGL 3uu2GmlYO9LOoqZIHx+As5zPsRhdpmBI6estqr5FWSPfgLFRu/uxPvWmQ//DEFYJDORr xKsM8FGBtOdKEolE2I7oQfGBs9lQao1kovGlk/AiX6McGON+GtrneyGuDmGO/g15+G+j EfUg== 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=cIovE4CwZ+uH/vnCW5KX56scGZseboghOgE9AUv/1xEne5ZPJJnotVgnLM2oEQKOi0 ca1VIzPIAROGCjqHXE7BD19RjzJY7T498JicROo80KN9rPgR2Q1rTtyfJxNppHcHJraQ yMF7fZbvpBn8zJi6AvY8LhbSSG51Rpt3la6IEj+zqTyWb6sGCBlzzQ0/kWzDI0Qq+Scx r3WID47r7dAeYoe+JAKXXNm2q4zSABfdbf1Hlfk/MTSt6/kAaYRmYRa5Gc/Z7UFn3lEU YljUb4MzEOuqUe4XjnLJqxVt75ieNenhJP5MqxGrLlzyIrFw1KKJXrHnYCaA1Z4QB9uB lx+g== X-Gm-Message-State: AOAM531j1JSFrn5YSTzA8U3ZMmBtQ8b57WSOdwELqt4bjwcEkYH8b8Qt QcpDKV7zrRb5guSczPaVvJj7bSX6w6OkIgnM X-Google-Smtp-Source: ABdhPJzspIe0SD7XXTTTwvqFjpbgeWqe5VktIJdGU3UKySRafWujQV1bq+adBycOHqVppCTtFqWGEjUXe10mF//O X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:3d54:: with SMTP id k81mr19445547wma.144.1604333131167; Mon, 02 Nov 2020 08:05:31 -0800 (PST) Date: Mon, 2 Nov 2020 17:04:07 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v7 27/41] kasan: rename print_shadow_for_address to print_memory_metadata From: Andrey Konovalov To: Catalin Marinas , Will Deacon X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201102_110534_441773_25D7F3B6 X-CRM114-Status: GOOD ( 14.02 ) 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 , Elena Petrova , Andrey Konovalov , Kevin Brodsky , 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(); }