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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D670C433F5 for ; Tue, 21 Sep 2021 16:53:26 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 28BFB61168 for ; Tue, 21 Sep 2021 16:53:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 28BFB61168 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=zAjJ7AnwDrtldNh29Kolur9bnzeXXf9mju40LIskdqo=; b=aOZZVqX7QwWiIh I/8qnxvj9z0U59n1FaNc8v6MAawH0TEltKbLbemCrGkrF9S76rFlhBT55yA5zXPs9TQTHY/VEblPE yHTv4ybpdrNervsv+ApaP3LkXZMe1cZYnrFVpkPPcrAWfc2hjYXcFvVvVaQkCPL1P6gjNc3T5pYRs OBSqkxSTbNPXnAwjs8o8yqp6dpZbFkGwhoCiPqEli8jhWIJ9LlW5Mxk2U4BPCRmeYjnHUiJCAzQj2 ctDzEOQR4wfW3+5XQFXYe9OnfYpNe+OLnEpKkWGz5+xVe+bsRcK1vgILPfA9DA2Ucc4m2hBUfjSBZ 9N2w4xGoQnHfQGoHNEWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSizf-005G1g-TP; Tue, 21 Sep 2021 16:51:44 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSizc-005G1H-2K for linux-arm-kernel@lists.infradead.org; Tue, 21 Sep 2021 16:51:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BFD57113E; Tue, 21 Sep 2021 09:51:37 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.23.155]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8BD7C3F718; Tue, 21 Sep 2021 09:51:36 -0700 (PDT) Date: Tue, 21 Sep 2021 17:51:34 +0100 From: Mark Rutland To: Dmitry Vyukov Cc: syzbot , Linux ARM , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Subject: Re: [syzbot] upstream test error: KASAN: invalid-access Read in __entry_tramp_text_end Message-ID: <20210921165134.GE35846@C02TD0UTHF1T.local> References: <000000000000a3cf8605cb2a1ec0@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210921_095140_204337_14732C42 X-CRM114-Status: GOOD ( 15.71 ) 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 Hi Dmitry, The good news is that the bad unwind is a known issue, the bad news is that we don't currently have a way to fix it (and I'm planning to talk about this at the LPC "objtool on arm64" talk this Friday). More info below: the gist is we can produce spurious entries at an exception boundary, but shouldn't miss a legitimate value, and there's a plan to make it easier to spot when entries are not legitimate. On Fri, Sep 17, 2021 at 05:03:48PM +0200, Dmitry Vyukov wrote: > > Call trace: > > dump_backtrace+0x0/0x1ac arch/arm64/kernel/stacktrace.c:76 > > show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:215 > > __dump_stack lib/dump_stack.c:88 [inline] > > dump_stack_lvl+0x68/0x84 lib/dump_stack.c:105 > > print_address_description+0x7c/0x2b4 mm/kasan/report.c:256 > > __kasan_report mm/kasan/report.c:442 [inline] > > kasan_report+0x134/0x380 mm/kasan/report.c:459 > > __do_kernel_fault+0x128/0x1bc arch/arm64/mm/fault.c:317 > > do_bad_area arch/arm64/mm/fault.c:466 [inline] > > do_tag_check_fault+0x74/0x90 arch/arm64/mm/fault.c:737 > > do_mem_abort+0x44/0xb4 arch/arm64/mm/fault.c:813 > > el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:357 > > el1h_64_sync_handler+0xb0/0xd0 arch/arm64/kernel/entry-common.c:408 > > el1h_64_sync+0x78/0x7c arch/arm64/kernel/entry.S:567 > > __entry_tramp_text_end+0xdfc/0x3000 > > /\/\/\/\/\/\/\ > > This is broken unwind on arm64. d_lookup statically calls __d_lookup, > not __entry_tramp_text_end (which is not even a function). > See the following thread for some debugging details: > https://lore.kernel.org/lkml/CACT4Y+ZByJ71QfYHTByWaeCqZFxYfp8W8oyrK0baNaSJMDzoUw@mail.gmail.com/ The problem here is that our calling convention (AAPCS64) only allows us to reliably unwind at function call boundaries, where the state of both the Link Register (LR/x30) and Frame Pointer (FP/x29) are well-defined. Within a function, we don't know whether to start unwinding from the LR or FP, and we currently start from the LR, which can produce spurious entries (but ensures we don't miss anything legitimte). In the short term, I have a plan to make the unwinder indicate when an entry might not be legitimate, with the usual stackdump code printing an indicator like '?' on x86. In the longer term, we might be doing things with objtool or asking for some toolchain help such that we can do better in these cases. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel