Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3591705rwb; Mon, 5 Sep 2022 14:53:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IkhEHGsgviM9Wk9Ek/C8QDYRv2bxf2+lubVvitKGIPHpmyvT24wkBy/zkvKQq6t8bRXx1 X-Received: by 2002:a17:903:248:b0:172:7520:db07 with SMTP id j8-20020a170903024800b001727520db07mr50410278plh.76.1662414830183; Mon, 05 Sep 2022 14:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662414830; cv=none; d=google.com; s=arc-20160816; b=c9L91KbIGH1oZp6+2SxJ8cbwCaIpJvXGp+OKJr0t3SljlpUaBzVFGmm8fudR2PRKjE HLNbVC6qCalH5QAsw7rF1kbUksHd/tjpGIDoegmTt96fR+HK4Ce9TzPxQy/Z8rUCIjSu cgJc7OzWl5jz/XBwMjcZyH8faGbi/Ebx5oH5Si/VLWhbjkJ0VeyZtkHL/dBMaarns64+ /pGBaEIX43NW6YS1mWqpP6ypokuZB8gTRxZ9VLXTm6Rbrz7hORpOeAe/wouhl0rIY4mh 5LVzvQ/T237oUfd5SKZsUm3VkoSh6O067jTR7nMrOHataP1RPgNHzZKepPQtZI7Sdxa6 hY6A== 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=HG8amreOT6Boo2OYpfsAisJYLLHPkbhrfrZ7vEhyKIU=; b=yF3r2ZevHX37j36bySrRwoSlHW6DvvsPpsLB32knpnwfh1bChMy0Wdm5aT0xf2Q/a1 C37ZiA6pfvjq8RfXPz+MhGrhnbYpBwRpkmcirF2oIOphKB6c5fuxjB9GYxtm+KM4WoAE fjw4q6msMKBJrfr6oOIOi98WDVf3vFdsF56On36i2uotMy6awzISG51ke1jlW7MJL3q7 IXats52uFYodIZOPVfyAclVAJdyNKJH/JXTXTj3xbUAOkHN59nItBsAZmRaS82YqEqFh WISKU9Zqq5iEeGA6sTewa+P+dChUFXOQP4kNTpgicE+YREDOCUkD12b6k7fHGCLWpRvH sV4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=hjZEe66l; 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 p16-20020a056a000b5000b0052b206007bcsi11860782pfo.237.2022.09.05.14.53.38; Mon, 05 Sep 2022 14:53:50 -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=hjZEe66l; 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 S237692AbiIEVLb (ORCPT + 99 others); Mon, 5 Sep 2022 17:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232558AbiIEVLD (ORCPT ); Mon, 5 Sep 2022 17:11:03 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A34066A65 for ; Mon, 5 Sep 2022 14:10:23 -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=1662412215; 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=HG8amreOT6Boo2OYpfsAisJYLLHPkbhrfrZ7vEhyKIU=; b=hjZEe66lYGDZc3DHO2OTGnJrvW/RGewUVnd2Hzcn/FX7J3MbM+slzlQ08TFOkf8L4DCWJU BpQte9D3I0RPeQ6bad+pQOcAQA1+Gh3UeVdJQ26IMQzTz7vd/JKRoWSdAzvnjl5taBIAwX VubFPiPflFahgW/sbOGvOPk6VjRWrg0= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Peter Collingbourne , Evgenii Stepanov , Florian Mayer , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm v3 25/34] kasan: simplify print_report Date: Mon, 5 Sep 2022 23:05:40 +0200 Message-Id: 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,RCVD_IN_DNSWL_NONE, 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. Reviewed-by: Marco Elver 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); -- 2.25.1