Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1543429imm; Thu, 19 Jul 2018 03:43:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfO44kSScRUdx/FYYgjnLTpxc/vESmzKdXHq53jMQsN9ujwQbcEzG2wbDrUkh3svEIu2VEf X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr9498648plo.281.1531997026976; Thu, 19 Jul 2018 03:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531997026; cv=none; d=google.com; s=arc-20160816; b=dkLcI7vKkwVdCVVBYfPOKm6Yn3J7ujlmWgq8gqWJOlohNklGdyW5LJi/4WAkWb6pce qKyhXbGzpiNEJQ4FJ/J7jUJJpSJ5gbGRGdHkgovYjyO2KYes7F0Zf/C8YVLemOTSOn// JRGThh63gp4XjtXrcTHM0qDjTsaWaCtEYhQU65VTxUlsDPkorxUxMgveBR292kgR6wZu xNWE1KbIEvxycSJEYrFDp8BrqMlE+uT/6kO9JJIsbWw5MI2m8oYpXCmAWQudh2p2ymRA BU/stVJbJ0CqbvaJnHlW47zMUJRxSlFqOBIafLWaWlVN9PBTU2Bsuqj5POVYXY1ml3OL 6g7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=0EcGpH549/bt6cvHDC3171X9Ih2Pus0V6pTEwg9cusM=; b=g3aEZZGuNt5r3Fe5n0kfnhBq08At73yP82xhjCbLEY8zAS2jLyWb1c5xixrnXwsq/x MyqkEvJJ/XeHlspBYPE3Eql+CJaqxXXj9kq11TJUZb/NSQvfgK0A/6q8T2mSTPPFAfln 5SBawPceuFaIlLI89352OubdE0t9jCsusGPKwsElh4z0fLJoYb46+VKJSRsiqRO/TI3i Amu6hUPlHlz/H/zD5Tz/2qSgWRVr6KcWz3dwmkUr9DAK7jpPouW2OeuDx0joN1TrnW0U a01VphlavF2ep/PvtWjY1ILR/QZgci+eXZljOgOdTgbKVL8M2md22cgopMzibeeoUwLV PWSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si5136781pgp.681.2018.07.19.03.43.32; Thu, 19 Jul 2018 03:43:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731251AbeGSLYH (ORCPT + 99 others); Thu, 19 Jul 2018 07:24:07 -0400 Received: from foss.arm.com ([217.140.101.70]:47068 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbeGSLYG (ORCPT ); Thu, 19 Jul 2018 07:24:06 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CE42780D; Thu, 19 Jul 2018 03:41:34 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0FD353F246; Thu, 19 Jul 2018 03:41:32 -0700 (PDT) Date: Thu, 19 Jul 2018 11:41:30 +0100 From: Mark Rutland To: Laura Abbott Cc: will.deacon@arm.com, catalin.marinas@arm.com, alex.popov@linux.com, Kees Cook , Ard Biesheuvel , kernel-hardening@lists.openwall.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, james.morse@arm.com Subject: Re: [PATCH] arm64: Clear the stack Message-ID: <20180719104130.egfevpo3ie4azaq6@lakrids.cambridge.arm.com> References: <20180629190553.7282-1-labbott@redhat.com> <9733d929-3c6a-40e1-6110-8f79975323d3@linux.com> <1b97aa7d-2b6c-a5df-0caa-1cd16e18a816@redhat.com> <20180703121440.v4olvwqb3ykgt5fm@lakrids.cambridge.arm.com> <06dd55e6-d39e-7617-b644-bdd04fa3c030@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <06dd55e6-d39e-7617-b644-bdd04fa3c030@redhat.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jul 17, 2018 at 03:58:19PM -0700, Laura Abbott wrote: > On 07/03/2018 05:14 AM, Mark Rutland wrote: > > > It might be cleaner just to use on_accessible_stack and then another > > > function to get the top of stack. This also might just be > > > reimplementing what x86 already has? (Mark, Ard?) > > It looks like we could build a get_stack_info() as they have. > > > > We could probably clean up our stack traced atop of that, too. > > So I spent some time looking at this and I'm not 100% clear > if there would actually be much benefit to re-writing with > get_stack_info. Most of that design seems to come from x86 > needing to handle multiple unwind options which arm64 doesn't > need to worry about. Any rework ended up with roughly > the same code without any notable benefit that I could see. > It's possible I'm missing what kind of cleanup you're suggesting > but I think just going with a tweaked version of on_accessible_stack > would be fine. I was mostly thinking that a struct stack_info with stack type enumeration would also be helpful for ensuring that we terminated stack traces when we had a loop. I'll reply on your new thread. Thanks, Mark.