Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp364736lfn; Wed, 2 Mar 2022 08:50:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5ELyrDc9HCWYcFzbUojiBIDgcM0fj3iMbe+LzwICpU8W1HFZg8EbMTgDr1AtjiN8xsMz7 X-Received: by 2002:a05:6a00:1704:b0:4cc:c8d7:e54a with SMTP id h4-20020a056a00170400b004ccc8d7e54amr34097884pfc.16.1646239819692; Wed, 02 Mar 2022 08:50:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646239819; cv=none; d=google.com; s=arc-20160816; b=z9L6s91iuaEbPTXfJchRhcz4auRqCbDH6e05zURLMkUBR9p48ht8QO6o3CNbH6LN0p EBBSjGDlnoFH/Hj0JXBqagCbjK1xvmlZmEwZ61UMRBd7KTHDgblMWrFlNxemQNmp3KTw D30BnWXmmmsbKlJ+zh/tIVeoN3z9hU3d5go5/Nu/C/TbJd3PUonOJDvLB4uNBZw5z4Ri bcIEIGGuo0qyp7Pd79KnFwC4sUPqB5jB/gCyAy63TuEpvmpN1XS3MRInS5dOsO0c0mpZ /ck49cQBnizgAieg2fHy+Vaj3XxkyGjWJHmqCfiyOXGR2WdbqsyvFnfkHYL53Y/GwI8x om6Q== 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=uo3r1XZ2YxXX2Y0KQk7NP/LkQS2+d42pEDKbCuKVO2A=; b=bU29Fd9CgLt0v4K8ckD6sgUYKiQ9cwvsTd+uH7IbKM9lKFefPStj3v2XJUrW4fF2Ly PnSA2t1bb9hxQE2T4GrG9NpKsou2el9UfMNS8fwqZ27GExGGyZ+EpV5pe5BT8rwL6gq6 fqWM7yUh06Mm/ot6/K6r21LUiFCPCPv9kznF0tXlSURXIegJ3yr/d1XND+0NSgH0nnyt VkctNYS5OHYqdib63Qljg6RZnlK5q+ntu9LJWP9EQ1QHPmZbameHHU+KBBlynHWFzaPL nWZd0FLwCda/XFG91uodWXRzIkkOVEm09QtZ+KFllXz3Cz2tTCAlfyeuWcaKIN7h3Jsc lofA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="dqtbv/8F"; 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 s67-20020a635e46000000b0034139b76228si14990008pgb.451.2022.03.02.08.50.02; Wed, 02 Mar 2022 08:50:19 -0800 (PST) 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="dqtbv/8F"; 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 S243182AbiCBQhs (ORCPT + 99 others); Wed, 2 Mar 2022 11:37:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242163AbiCBQhd (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 51CE3C4B78 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=1646239008; 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=uo3r1XZ2YxXX2Y0KQk7NP/LkQS2+d42pEDKbCuKVO2A=; b=dqtbv/8FM/BpZ36aN0SoEvBbrDqGpQNujrrTiFrcZ/GGK1iACrmtY3v9EpgsqMoF5kVf+V T77/+r0QQUpdIhNtrvEvaDV4gqjloM1z7E8wkpf36GllOgJ+Wk5zA4ChirBxB4zHXCD8Ai ZlMMu+FEdx2HixPTDXf2hhJwnz8Ki+I= 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 04/22] kasan: improve stack frame info in reports Date: Wed, 2 Mar 2022 17:36:24 +0100 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,SPF_HELO_NONE,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 - Print at least task name and id for reports affecting allocas (get_address_stack_frame_info() does not support them). - Capitalize first letter of each sentence. Signed-off-by: Andrey Konovalov --- mm/kasan/report_generic.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/kasan/report_generic.c b/mm/kasan/report_generic.c index 3751391ff11a..7e03cca569a7 100644 --- a/mm/kasan/report_generic.c +++ b/mm/kasan/report_generic.c @@ -180,7 +180,7 @@ static void print_decoded_frame_descr(const char *frame_descr) return; pr_err("\n"); - pr_err("this frame has %lu %s:\n", num_objects, + pr_err("This frame has %lu %s:\n", num_objects, num_objects == 1 ? "object" : "objects"); while (num_objects--) { @@ -266,13 +266,14 @@ void kasan_print_address_stack_frame(const void *addr) if (WARN_ON(!object_is_on_stack(addr))) return; + pr_err("The buggy address belongs to stack of task %s/%d\n", + current->comm, task_pid_nr(current)); + if (!get_address_stack_frame_info(addr, &offset, &frame_descr, &frame_pc)) return; - pr_err("\n"); - pr_err("addr %px is located in stack of task %s/%d at offset %lu in frame:\n", - addr, current->comm, task_pid_nr(current), offset); + pr_err(" and is located at offset %lu in frame:\n", offset); pr_err(" %pS\n", frame_pc); if (!frame_descr) -- 2.25.1