From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41AAAC433EF for ; Wed, 30 Mar 2022 16:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V57oyK20/BgKPDM8Z5IGbsNSpP3RorSD7+8ZnXkTExo=; b=5CdK22rbezDoTb noPCPYA2HGxeqQpGfa0v/a8qF/jJUslkL65nSr7/FfJugAPlYHK9Oe2KpnHt2/nlHudhEJINRBBck rPb8UXaXrpvutESIYCeY5AMGqUUsbKsPxehs0tGQLpuwPGBAdv7MFpUazJ4NM5EWO83oAMGX5eNO6 t9FUAfzXaD6/0NNKb0r0NmXyqOy+SgjM0JnFX/vWdKFlcCptT0+ZDS+xFI8D1dHHM/oc3c8Y2ah5K U9Feuy2m4ZIE9NuNzlrk2+l7HomR9Q2RCfZSnvTh12RhqO9lv8/+Hm7TdZqv8pOZWpPyD6KibrLQz dbfYRz6CgdjQg4u23/Mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZamn-00GkIe-Bi; Wed, 30 Mar 2022 16:03:05 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZami-00GjJ7-QI for linux-arm-kernel@lists.infradead.org; Wed, 30 Mar 2022 16:03:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X8vuOEtqWSaptxuQ7CBgqKQVZ7tPQluBFV2owyI5yMM=; b=dXZhuRZDnQ1op9njQ9/fCC+OQm OOCsY08lzIo8CZgzEG/6HA3SqIVorTl+maICM+3ksMrGoZ5d85gwy47wSv0g7GUFrFwGZ/Uu3Tp8B 44CyGqCmBlvFwjYYJZhedlzbZFetx0JlIMdgXQ47x6oMhF8xia6gg9wzwMRRoWw8mdvxwR8oZKSmR 3VQ037H2EIOxXfZDwV8vrR5rS/Umla2MACki7nAINOaGHm1x912bJ5QsGil9FKhC0DyF/SCFSiBZg x19QHR1VVME4AwK9K6P3sLitQ97ZnCjYqm4lJ6lrWiLvdAhuzSxLIKgAvuYJzISW1HkZXDMED2NGe qCR5cf2g==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58010) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nZakU-0003Pi-Vr; Wed, 30 Mar 2022 17:00:42 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nZakO-0006jh-SK; Wed, 30 Mar 2022 17:00:36 +0100 Date: Wed, 30 Mar 2022 17:00:36 +0100 From: "Russell King (Oracle)" To: Lin Yujun Cc: mhiramat@kernel.org, rostedt@goodmis.org, ardb@kernel.org, ndesaulniers@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame() Message-ID: References: <20220317090751.80831-1-linyujun809@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220317090751.80831-1-linyujun809@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220330_090300_899039_40489DE7 X-CRM114-Status: GOOD ( 15.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 17, 2022 at 05:07:51PM +0800, Lin Yujun wrote: > The following KASAN warning is detected by QEMU. > > ================================================================== > BUG: KASAN: stack-out-of-bounds in unwind_frame+0x508/0x870 > Read of size 4 at addr c36bba90 by task cat/163 > > CPU: 1 PID: 163 Comm: cat Not tainted 5.10.0-rc1 #40 > Hardware name: ARM-Versatile Express > [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [] (show_stack) from [] (dump_stack+0x98/0xb0) > [] (dump_stack) from [] (print_address_description.constprop.0+0x58/0x4bc) > [] (print_address_description.constprop.0) from [] (kasan_report+0x154/0x170) > [] (kasan_report) from [] (unwind_frame+0x508/0x870) > [] (unwind_frame) from [] (__save_stack_trace+0x110/0x134) > [] (__save_stack_trace) from [] (stack_trace_save+0x8c/0xb4) > [] (stack_trace_save) from [] (kasan_set_track+0x38/0x60) > [] (kasan_set_track) from [] (kasan_set_free_info+0x20/0x2c) > [] (kasan_set_free_info) from [] (__kasan_slab_free+0xec/0x120) > [] (__kasan_slab_free) from [] (kmem_cache_free+0x7c/0x334) > [] (kmem_cache_free) from [] (rcu_core+0x390/0xccc) > [] (rcu_core) from [] (__do_softirq+0x180/0x518) > [] (__do_softirq) from [] (irq_exit+0x9c/0xe0) > [] (irq_exit) from [] (__handle_domain_irq+0xb0/0x110) > [] (__handle_domain_irq) from [] (gic_handle_irq+0xa0/0xb8) > [] (gic_handle_irq) from [] (__irq_svc+0x6c/0x94) > Exception stack(0xc36bb928 to 0xc36bb970) > b920: c36bb9c0 00000000 c0126919 c0101228 c36bb9c0 b76d7730 > b940: c36b8000 c36bb9a0 c3335b00 c01ce0d8 00000003 c36bba3c c36bb940 c36bb978 > b960: c010e298 c011373c 60000013 ffffffff > [] (__irq_svc) from [] (unwind_frame+0x0/0x870) > [] (unwind_frame) from [<00000000>] (0x0) > > The buggy address belongs to the page: > page:(ptrval) refcount:0 mapcount:0 mapping:00000000 index:0x0 pfn:0x636bb > flags: 0x0() > raw: 00000000 00000000 ef867764 00000000 00000000 00000000 ffffffff 00000000 > page dumped because: kasan: bad access detected > > addr c36bba90 is located in stack of task cat/163 at offset 48 in frame: > stack_trace_save+0x0/0xb4 > > this frame has 1 object: > [32, 48) 'trace' > > Memory state around the buggy address: > c36bb980: f1 f1 f1 f1 00 04 f2 f2 00 00 f3 f3 00 00 00 00 > c36bba00: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 > >c36bba80: 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 > ^ > c36bbb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > c36bbb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > ================================================================== > > There is a same issue on x86 and has been resolved by the commit f7d27c35ddff > ("x86/mm, kasan: Silence KASAN warnings in get_wchan()"). > The solution could be applied to arm architecture too. > > Signed-off-by: Lin Yujun > Reported-by: He Ying Hi, Please drop this in the patch system if not already done so. Pointer to it in my signature below. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel