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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 A44C5C433ED for ; Thu, 13 May 2021 09:18:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 2C30661432 for ; Thu, 13 May 2021 09:18:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C30661432 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; 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=tcJ0ilRJvXe5quNghICHszFnN0yCylq02lzav0KFLow=; b=cyHS964lr5HWOfAOUwPgQrwPT prHEtf1wBBMrkLkzQTQkxsup6HY+OvHF+phsJCT0mQugRrWume+zwa50zR7z1WwioDOs8I+fZ6MiD p/iLqGZvAE781uC3sbtmEFX0nsDWVHA9uPWybeeBbC542Ac3CkM1GxSnuHcDT1f8u7iOVUP3gfBVi 7TbQD1PIhbk0CMQNeB/hWGO0QiYfpizf//VFVgnPrvEFfWB1IpcfhNoaKDwIDd/fOmyamU8rpooOQ uJ0GfQB0zSM6yceErjsmjYXHf5qc/T/J7uRg31XpRU6xzMcMdZivxe5i2BeC1ctIOOcH8GuQKdk0F L9t1tyAXw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lh7Sd-005DZq-Vs; Thu, 13 May 2021 09:16:52 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lh7Sa-005DZJ-VS for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 09:16:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=osScyFwJgLmBA8jafI/pL6hfCjJtYhbLCLnaeyb7oNU=; b=e2IWu6s3xy4IV6ywhhWEtWg/oy +zgOJUINuSVI0iNrruroaHaqUMpzsz/f/Wh0J/EBAPpZe0Dk0IH0CAka6MTVs1V9Eu1e4LzXCsafv 50VMYFicG7mMr29UvINkauECMb4N1Ot8VNsSrGY2scvffZvJGHHKWPo8JLTs/QGZLuEG06QoqYmJ4 OI9uaOVxRDBxNUWnaXhWnRoaYKMvxOiVlVQZxBsUFXznTYJgjfS8t7JAN7sdqm6bcpHsObmuCQRwJ vHyzeq3AEdrKvr5o6f9/TQMDJYOCrYpsbkGKjyrDNxxCCNOVas+KRAcsd1bWZjvUHwLC/izA24cPW zMhKfFsg==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lh7SX-00B84M-TN for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 09:16:47 +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 7E02E101E; Thu, 13 May 2021 02:16:42 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.5.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3A8543F719; Thu, 13 May 2021 02:16:40 -0700 (PDT) Date: Thu, 13 May 2021 10:16:33 +0100 From: Mark Rutland To: Peter Collingbourne Cc: Mark Brown , Will Deacon , Catalin Marinas , Andrey Konovalov , Evgenii Stepanov , Ard Biesheuvel , Linux ARM , Andrey Konovalov Subject: Re: [PATCH v4 2/3] arm64: stacktrace: Relax frame record alignment requirement to 8 bytes Message-ID: <20210513091633.GA10886@C02TD0UTHF1T.local> References: <20210513022709.983982-1-pcc@google.com> <20210513022709.983982-2-pcc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210513022709.983982-2-pcc@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_021646_021724_55651596 X-CRM114-Status: GOOD ( 19.65 ) 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 Peter, On Wed, May 12, 2021 at 07:27:08PM -0700, Peter Collingbourne wrote: > The AAPCS places no requirements on the alignment of the frame > record. In theory it could be placed anywhere, although it seems > sensible to require it to be aligned to 8 bytes. With an upcoming > enhancement to tag-based KASAN Clang will begin creating frame records > located at an address that is only aligned to 8 bytes. Accommodate > such frame records in the stack unwinding code. > > As pointed out by Mark Rutland, the userspace stack unwinding code > has the same problem, so fix it there as well. > > Signed-off-by: Peter Collingbourne > Link: https://linux-review.googlesource.com/id/Ia22c375230e67ca055e9e4bb639383567f7ad268 > Acked-by: Andrey Konovalov > Reviewed-by: Mark Rutland > Tested-by: Mark Rutland > --- > v4: > - rebase to 5.13rc1 I think the rebase went slightly wrong; note below. > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > index 2fecbf152e80..020e575e5cd3 100644 > --- a/arch/arm64/kernel/stacktrace.c > +++ b/arch/arm64/kernel/stacktrace.c > @@ -68,7 +68,11 @@ int notrace unwind_frame(struct task_struct *tsk, struct stackframe *frame) > unsigned long fp = frame->fp; > struct stack_info info; > > - if (fp & 0xf) > + /* Terminal record; nothing to unwind */ > + if (!fp) > + return -ENOENT; > + > + if (fp & 0x7) > return -EINVAL; The terminal record check got moved later in the function by commit: 8533d5bfad41e74b ("arm64: stacktrace: restore terminal records") ... so this patch shouldn't re-add it. With that gone (and this just changing the alignemnt check), this looks good to me. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel