From patchwork Tue Jul 19 00:10:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12921919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0557C43334 for ; Tue, 19 Jul 2022 00:14:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A5FD6B0071; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 355B88E0002; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 244F78E0001; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 141D66B0071 for ; Mon, 18 Jul 2022 20:14:42 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id E893B20FDC for ; Tue, 19 Jul 2022 00:14:41 +0000 (UTC) X-FDA: 79701928362.19.6E6F61B Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf21.hostedemail.com (Postfix) with ESMTP id 4FD821C0068 for ; Tue, 19 Jul 2022 00:14:41 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658189679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jretA47WKAcb0y56HfWCPZEL31wNbTFgLZKnmROQ4mM=; b=rU0FTMcqoNDbvSFCEfvW/hbLzd+m61UXURxZAxv5KwReNfRgMljavhFkQvEaeTbR5GaOf2 gBDhMOXjtGRYvmIi7i00aQMKDaRiBY+ZMn0IYYMFg1L755kFWJ3RLV/lTjezNlQZFEHzoJ bJ/lC2DE2miWoDPTZF40dXh10ulZiVM= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v2 25/33] kasan: simplify print_report Date: Tue, 19 Jul 2022 02:10:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rU0FTMcq; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658189681; a=rsa-sha256; cv=none; b=2A7Dscy1EGHS8sVCyXVv8uQ4MUTnmWD0tmVutGmocUkn9L3kXwMHww/o1AL7DCR44UFIoZ 7jmL9HXj3GpD0R3HplJsKFENtoqeqR6gR6EuMJQTaYepzjJwPhViTdbQZmXGCCzLo1kc/x b+/keFXFbb/K7def1QD4AlVZQkreva4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658189681; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jretA47WKAcb0y56HfWCPZEL31wNbTFgLZKnmROQ4mM=; b=VnJUNaxBBE9WjaCInoPrvd13hNL8Sqte6A8sxezLKU5ElELRYZUkYqS4dXOHvlCIQlfpmt Nb428l9ts9QoKwpNQvR0yME1IT1kodJ/rR2wmSUDGVYXi0HttfAnrTVBWheOfa0dTKiHC5 BqXi8amaALFQLGllGRr8Y+3EZD+buvk= X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 4FD821C0068 Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=rU0FTMcq; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf21.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev X-Stat-Signature: qym6u1m3kd7q59gqbdo1qttm4jhfpch5 X-HE-Tag: 1658189681-461930 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: From: Andrey Konovalov To simplify reading the implementation of print_report(), remove the tagged_addr variable and rename untagged_addr to addr. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index ac526c10ebff..dc38ada86f85 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -397,17 +397,16 @@ static void print_memory_metadata(const void *addr) static void print_report(struct kasan_report_info *info) { - void *tagged_addr = info->access_addr; - void *untagged_addr = kasan_reset_tag(tagged_addr); - u8 tag = get_tag(tagged_addr); + void *addr = kasan_reset_tag(info->access_addr); + u8 tag = get_tag(info->access_addr); print_error_description(info); - if (addr_has_metadata(untagged_addr)) + if (addr_has_metadata(addr)) kasan_print_tags(tag, info->first_bad_addr); pr_err("\n"); - if (addr_has_metadata(untagged_addr)) { - print_address_description(untagged_addr, tag); + if (addr_has_metadata(addr)) { + print_address_description(addr, tag); print_memory_metadata(info->first_bad_addr); } else { dump_stack_lvl(KERN_ERR);