Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp152710imm; Tue, 17 Jul 2018 15:59:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpffbfGDk8Lh1z6LO2GKyGOLxRVgm70dG+IaG8hOYomT6TKotv9xEvDlD3D8+NcbEW1Q+Jzz X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr3424261plk.75.1531868353047; Tue, 17 Jul 2018 15:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531868353; cv=none; d=google.com; s=arc-20160816; b=ZwSqUQWT2lp2qRk2lcYGcmzRuAm8EGW4ETqlUWnzqbQo6vvOnnX37K4/Qh/P2yua0q YN7DfkeuxqVyOAvOZv6XTJsIAlsC0Mj1fWHOMydf5V9cowVmmbtxCqrTbgp4k0oyRwhl xHgVPJqh53vVImikrr5rlJkvUP81ebd2ddkHgcugu/TYzHvKcmGPxegmZGJxTcSu+Icn KRhWg3Hj8LYbl7CeW9CaiFOm0vJB8SzSRZT1ax+EJOa8tBC6OLi3TWofdoi2Qn6kga2B lxOEeVJJp6Cuvx2TvFEVsWKj2GnCNRokM8iAu74eyDxM2diOi3mZoZGDJ1FOpdGcYMs+ fiWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=hp7BHugqwHetcfx7Qtfncp8vk5Rfnp+Kd9uoegqTaxM=; b=Sd9FdqpSonM//3myeeH22LCdNPveqfJqBurTpd3ro/hKVtr3WzVWz0P+196cJbjKd9 DSgqaYmTTs5KMZnJdY79WudiDy7Ac4ESC8EJKstULfBeJGWyrqee+v+j+h4g9m/P0B/a 6d2Vll72wm3myH+7Hn4Q3lLWN4twttp8YTsdeycrFXexfmWGYrsYGXLzKcS24Dd7UA+t oYYm8d/Q57DBCp+sy7SYuMxqungXajm9UPc4oWzSPXmME4QNRgn1KdsYI2cek/2Hu8Fz d9vSeggy94i0wVnx+j1Ejau9lxc/Nslf9kh0V+AbLM6MA2sD/ueX+3Q1Pah8rI+RT4N4 rGHQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22-v6si1790962pls.259.2018.07.17.15.58.57; Tue, 17 Jul 2018 15:59:13 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730798AbeGQXdP (ORCPT + 99 others); Tue, 17 Jul 2018 19:33:15 -0400 Received: from mail-qt0-f170.google.com ([209.85.216.170]:34103 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729907AbeGQXdO (ORCPT ); Tue, 17 Jul 2018 19:33:14 -0400 Received: by mail-qt0-f170.google.com with SMTP id m13-v6so2460370qth.1 for ; Tue, 17 Jul 2018 15:58:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hp7BHugqwHetcfx7Qtfncp8vk5Rfnp+Kd9uoegqTaxM=; b=KAq5TID0uiJJe8eoLxRHUswT4OMqn0hBr35A+pNhY0lFLDK0IJ09GYxsrTBAlyzTEt Hv0FTe3UuPo3YyMB9Phlf/mcZutGLB+2Uhip/pagrvmgvsEb6dd1PgMjTvWvUDS72O6H Oyhf6T7ZHRVDnCALVn/7iCbS4xRXNFJ2z4eONiVx7q0XKVf97m8EZnpgJBVP5NSt6IZZ eyTHRLEsjDZb5w7vuJ6qSDl7f7xn8Kt3FeXFfQLfnsFEtVh1qfHkrRNzPXxMOpt1pCgo nB369CSkeIYM/VDJl6LIhGmInqyJEB98/w5qtwVtdYwwQlrZbflfsZahfoBHsvwz8EfK Rw6w== X-Gm-Message-State: AOUpUlG7zS4eNQcCTZATdSU4ixJFLJMH/ANNfSq0ZcW6TEz8t33EDBYf 94C5dfGKL6J9For/GMtz/oEpNA== X-Received: by 2002:a0c:be15:: with SMTP id k21-v6mr3961452qvg.1.1531868303169; Tue, 17 Jul 2018 15:58:23 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0? ([2601:602:9802:a8dc:4eb2:6dae:ab32:e5b0]) by smtp.gmail.com with ESMTPSA id 144-v6sm999088qkh.37.2018.07.17.15.58.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jul 2018 15:58:21 -0700 (PDT) Subject: Re: [PATCH] arm64: Clear the stack To: Mark Rutland , will.deacon@arm.com, catalin.marinas@arm.com Cc: 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 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> From: Laura Abbott Message-ID: <06dd55e6-d39e-7617-b644-bdd04fa3c030@redhat.com> Date: Tue, 17 Jul 2018 15:58:19 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180703121440.v4olvwqb3ykgt5fm@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Laura