Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp326920pxm; Wed, 2 Mar 2022 16:28:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOc+lQ3baj3VGOg/51F6N8YT3LUNpg4/p/rw3ZM0y6GGOSxJLACLfliAMrUzRXPxArPku+ X-Received: by 2002:a17:90a:d584:b0:1bc:e520:91f2 with SMTP id v4-20020a17090ad58400b001bce52091f2mr2468075pju.192.1646267305670; Wed, 02 Mar 2022 16:28:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646267305; cv=none; d=google.com; s=arc-20160816; b=xKBh/U+j+qbWMtaGD2LBIYh1VD1WXSxWPAj+UM+3WbLJtz7XlX/85I3bcdbi8DKQDV CH1/ojdFfShKYafgbuPpgSNzkq4QR3beCFjn1gg4T2CEP0Ts6ZAwNWgqmuCh5rcQPPTn 9lQ8o/AVX6ZbrGIU4Kr2aR9vjKwdDOfaVNUL+UDb0HEatVYh+e8BjG7u1SHv8XzB1gU5 mpHeZD/pRtOXDgcOuJf/1yBJ7M6NX9o1V2iSLMu8ZFh+J/Q+JYH23FhVj2daPr1jT6OQ 6UqvLNc2gXaw+b3HGb1cWTQL1BkiI1Njk/8WhdOiP6dfAgJQOkyBHIM49Ja1hxZNwAgI UDbw== 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=ReVQg90bpO6aQ9p1E17mGNBQrTUFi/5PZoBeBo27NeE=; b=OieEyxNjgw2pbrSnIxn74RnNqL04y3L5m2AYxdl5LZr7ytBELZgkRDQP8GWYXhIxER AGB6AYQA3JxMy+Fsdvi/gbX4Ro8j5cB6p2fGE5EYN4Ze2raqcgbLV5ooDCfjXdmx113s zKVOJWL18QCAEP7fqcLUIPhxBtxmtp1gEpBqSFITZ9deP+xcWcSJtffqtusxgokRpyM4 I7yg0K3DiZN9NIq6suP70XEFDmghGZYvzJgF9cukYw6luc4I3sDZZxYCoKnya/6kTRu7 P5K2vBptImbS5bxnWmfiWqszHT3yYACvhkkCBqWGvITycTznDbF2J3AhcrfeDgXXARdS grVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CkSxgq2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bg22-20020a17090b0d9600b001bc22d9a57asi458197pjb.14.2022.03.02.16.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:28:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CkSxgq2C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37E96163D55; Wed, 2 Mar 2022 15:39:56 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242981AbiCBQhp (ORCPT + 99 others); Wed, 2 Mar 2022 11:37:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242830AbiCBQhd (ORCPT ); Wed, 2 Mar 2022 11:37:33 -0500 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A029CEA00 for ; Wed, 2 Mar 2022 08:36:50 -0800 (PST) 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=1646239007; 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=ReVQg90bpO6aQ9p1E17mGNBQrTUFi/5PZoBeBo27NeE=; b=CkSxgq2C4AQd4Hc/5oIgvZVdzS8i0G/red+aOhMvBK+qP+KWRBe1leENjyQER0Scn8x8s+ +JQ5jqkF9/rAvHLfhxTpE1MaNTAH3+5lHi+ABoT3biafZUWNz1r9qlaCCnYaOH+mR/AO56 glUtZxXMxV9DzLCbZno4jG0eTH+Qnxc= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm 02/22] kasan: more line breaks in reports Date: Wed, 2 Mar 2022 17:36:22 +0100 Message-Id: <8682c4558e533cd0f99bdb964ce2fe741f2a9212.1646237226.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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Add a line break after each part that describes the buggy address. Improves readability of reports. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 607a8c2e4674..ded648c0a0e4 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -250,11 +250,13 @@ static void print_address_description(void *addr, u8 tag) void *object = nearest_obj(cache, slab, addr); describe_object(cache, object, addr, tag); + pr_err("\n"); } if (kernel_or_module_addr(addr) && !init_task_stack_addr(addr)) { pr_err("The buggy address belongs to the variable:\n"); pr_err(" %pS\n", addr); + pr_err("\n"); } if (is_vmalloc_addr(addr)) { @@ -265,6 +267,7 @@ static void print_address_description(void *addr, u8 tag) " [%px, %px) created by:\n" " %pS\n", va->addr, va->addr + va->size, va->caller); + pr_err("\n"); page = vmalloc_to_page(page); } @@ -273,9 +276,11 @@ static void print_address_description(void *addr, u8 tag) if (page) { pr_err("The buggy address belongs to the physical page:\n"); dump_page(page, "kasan: bad access detected"); + pr_err("\n"); } kasan_print_address_stack_frame(addr); + pr_err("\n"); } static bool meta_row_is_guilty(const void *row, const void *addr) @@ -382,7 +387,6 @@ void kasan_report_invalid_free(void *object, unsigned long ip) kasan_print_tags(tag, object); pr_err("\n"); print_address_description(object, tag); - pr_err("\n"); print_memory_metadata(object); end_report(&flags, (unsigned long)object); } @@ -443,7 +447,6 @@ 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_memory_metadata(info.first_bad_addr); } else { dump_stack_lvl(KERN_ERR); -- 2.25.1