Received: by 10.223.185.116 with SMTP id b49csp2156365wrg; Thu, 22 Feb 2018 09:00:10 -0800 (PST) X-Google-Smtp-Source: AH8x2275WuSRvpDo/7Mt3rDkN1SW0W/NkwdV3PXpG0iVwpAcaY8YPoocr1NfLi32WjEoK9xNqgql X-Received: by 10.98.204.132 with SMTP id j4mr7627768pfk.35.1519318810467; Thu, 22 Feb 2018 09:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519318810; cv=none; d=google.com; s=arc-20160816; b=BBUgUNX9RtcMAJVsb0QEHS+YyPXQTomo4r94UAgDo8OUlRKxXUDGjjliue2fAVRsZ3 uJ1c6GaZ9uyKKyHbMqktjwsqXivGfTo6t8UqQshwVn50ykeEpIkxBnsskcMqQ/A9PFOi Ry2hEqA2Aaa9I7VnsP8jN86Kc91Xl+cJ+80mrtGe2txwnNeIcQjQyHjOkS47+oGqTfSu xzjlrgYJxs/KZa58SXWyJGOhwVQtZy/W8HTcwmaIkC+RHkLHErHt5qWLaDCsJacwG+D9 4KlkvdyT0uBqfh1v7YJBydqqr6Qw+OSyjRABni/ZS/SQ3nsQLn9gTur7ZoRIzYaMYCZz W/Pw== 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=jDqpFOQiJnErCAB3GVhSo32BP/83i/q9s8H1vsT+Exg=; b=p5JqyFhjuu3sRKd6CJ6RRrDprUYakKEBiMZBz+iH0ArAladx/j3Y7HJF6u6TvsjeyY XZzkqSUGwnhGEY6U00dWGLjLRIfg3NjIKzdgoMfzNeNwXutTNkB4kGeuT06tM10Tie7Y avt9hqMNXr9V294J7fRg5ttcdaBAgsCpSAM5COutA64FfehQMyg1vgczjEh2TmLMGyAV bsxyk/d11/DxUPn4BmXXGNZXuPsJYvuvL0EOqsIvvL14P5GFA0F1EKaSBV4+OaHEw87X QDtmO1YXvTN31unfznkvug8vBXAmX1Ic8ra6byI0ij2KT07FaaMAJBVYVs0Cz8/Onk9s hXgQ== 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 f12si247969pga.22.2018.02.22.08.59.54; Thu, 22 Feb 2018 09:00:10 -0800 (PST) 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 S933356AbeBVQ6g (ORCPT + 99 others); Thu, 22 Feb 2018 11:58:36 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:45090 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933093AbeBVQ6e (ORCPT ); Thu, 22 Feb 2018 11:58:34 -0500 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 6FF0580D; Thu, 22 Feb 2018 08:58:34 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 41B493F318; Thu, 22 Feb 2018 08:58:34 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 825971AE53DF; Thu, 22 Feb 2018 16:58:34 +0000 (GMT) Date: Thu, 22 Feb 2018 16:58:34 +0000 From: Will Deacon To: Laura Abbott Cc: Alexander Popov , Kees Cook , Mark Rutland , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com, richard.sandiford@arm.com Subject: Re: [PATCH 1/2] stackleak: Update for arm64 Message-ID: <20180222165834.GC18421@arm.com> References: <20180221011303.20392-1-labbott@redhat.com> <20180221011303.20392-2-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180221011303.20392-2-labbott@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laura, On Tue, Feb 20, 2018 at 05:13:02PM -0800, Laura Abbott wrote: > > arm64 has another layer of indirection in the RTL. > Account for this in the plugin. > > Signed-off-by: Laura Abbott > --- > scripts/gcc-plugins/stackleak_plugin.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c > index 6fc991c98d8b..7dfaa027423f 100644 > --- a/scripts/gcc-plugins/stackleak_plugin.c > +++ b/scripts/gcc-plugins/stackleak_plugin.c > @@ -244,6 +244,11 @@ static unsigned int stackleak_final_execute(void) > * that insn. > */ > body = PATTERN(insn); > + /* arm64 is different */ > + if (GET_CODE(body) == PARALLEL) { > + body = XEXP(body, 0); > + body = XEXP(body, 0); > + } Like most kernel developers, I don't know the first thing about GCC internals so I asked our GCC team and Richard (CC'd) reckons this should be: if (GET_CODE(body) == PARALLEL) body = XVECEXP(body, 0, 0); instead of the hunk above. Can you give that a go instead, please? Cheers, Will