Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp865779iog; Mon, 13 Jun 2022 14:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsPBUcf8h76SUXzV0oazyHXLR9h7bqjY9f6KN7cooiAmBOV6zERd8ju1ZrZ+2A2Z+p4z1L X-Received: by 2002:a05:6a00:1145:b0:4f6:3ebc:a79b with SMTP id b5-20020a056a00114500b004f63ebca79bmr1368118pfm.41.1655157066965; Mon, 13 Jun 2022 14:51:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655157066; cv=none; d=google.com; s=arc-20160816; b=y38VuVezPTWXnQ5FPALBgoqePlzADvc3mxpezZMNac0mK28+C/S1TqJllgG2xxWsAa 6j04IKMq1jB38q3hCMKVDEnG7JboKSWCK9SLpZGpXOkA2bxHosmjjfpHUgMqLAqfi53Y ZLNWwlBZWLL+ZWeuCtyxua4M/kq3jUpVHw3pmGMBitlKbglH8YSEjgXqPreEIMmCR+VP bdVGAhj2CdiZ5MQouj6YEuIzG6HtSc67ym31yynQVQcdC3QQsitOtcL056G2cR0Cx1qs SNbSVvMeJyc1HrjQE9h0z1LzLsXF6b6rXp85ToumA3aB7EvviWUDpA4c3M6slTMVXCKa 2+Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xD+jOMbc8v/VbHqobo7HTP4Hy7ebCjo8HGnwIkjNmQg=; b=m3bcbVNxGkkYqvNqlx5ty8+FfLOg7uQ0lnapV2cinGK+K7L9WLfa7pnoD8HM2r0BS4 ZHONuvK/zqSnegQzpZoYsqi0yjkUmN7FAPu4viq4xcGv1w7o7E2F6OzESUolh4RYaBJt B0xs1BUWjQnhWP8100wqaErpQPKbgxarR/JOjnH9pTvEkdv7vC0Rwj8tXMfNuNFvG3/k /Tz/ALuV2W7WQ7sfvWjVvTcCjH/JqWxjuy2FsW4uWuxja4D8r5iCA3fwYYYTJm/BR3vW cXR0QfBluRliujY/DFM1fKGBUmuoxsK16C8CAj7IbQjqzTxQ+HRmeHRhPXBYtB/kfz+N nayw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uV4k7v6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb1-20020a17090b4a4100b001d9752b43absi11996260pjb.137.2022.06.13.14.50.51; Mon, 13 Jun 2022 14:51:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uV4k7v6j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233160AbiFMU5A (ORCPT + 99 others); Mon, 13 Jun 2022 16:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352082AbiFMUyJ (ORCPT ); Mon, 13 Jun 2022 16:54:09 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26A5A29812 for ; Mon, 13 Jun 2022 13:19:46 -0700 (PDT) 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=1655151584; 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=xD+jOMbc8v/VbHqobo7HTP4Hy7ebCjo8HGnwIkjNmQg=; b=uV4k7v6j0gg2WNGE2AGUi+jftnP6i13EVs8rWhI+Mznu6bMnCcoEx7t6dQvsOLijyruwRb Bnb/ljj+Y/69/ZVheqbQ8nWo1Q2aQYKgjsxn4fv64f2dR7RxPtUroYLFBAZjgai+byrc3O hJnu05PzYAADy2CUt5i3GARZUN+wHes= 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 26/32] kasan: simplify print_report Date: Mon, 13 Jun 2022 22:14:17 +0200 Message-Id: <6920a74ae141ec8f45f19c8ebf3622910d10a5ed.1655150842.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 f3ec6f86b199..cc35c8c1a367 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -391,17 +391,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); -- 2.25.1