From patchwork Wed May 2 20:33:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laura Abbott X-Patchwork-Id: 10376477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 372076038F for ; Wed, 2 May 2018 20:34:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27A8E28F9F for ; Wed, 2 May 2018 20:34:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C2B529007; Wed, 2 May 2018 20:34:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A717028F9F for ; Wed, 2 May 2018 20:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pSiiB8PsuXEjwb2OqBYeJlev1XoR01uq+RzyGz0DUZ8=; b=a/G3recGzWNTaNTBCE95qpoJR1 JRbO1BYXtapf8DgCf4L3sunB+02kiKqrdRA8u5AsgfA5Q+EhUpFHuanqu7FQOtlVsBeiOLtR3KZfi qewmdK+85TSr6B0upW0iWrHg/1i5NkNm3Dn3yKxIiERPY4YQuqgJdqjYADHRGA3ZwzOjRUC1ztOaT vKjryE2+mYD+psVtPbDpF4UzM9TU4q1NzopYIdcU1zbIvywxZZDzJtukwIdNoqaU5hbE4i5mm7h1j aqIuCDB7iX/tDmcpX3HNJpA7wEQ+bU38P3B+gX2QziWz20hm06vTtgR17+DWSczavAxqylYo0BIyB 0LaP8m1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fDySF-0007k5-UJ; Wed, 02 May 2018 20:34:23 +0000 Received: from mail-ot0-f193.google.com ([74.125.82.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fDyRc-0007Rf-3r for linux-arm-kernel@lists.infradead.org; Wed, 02 May 2018 20:33:45 +0000 Received: by mail-ot0-f193.google.com with SMTP id l13-v6so18149723otk.9 for ; Wed, 02 May 2018 13:33:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fpn5GpvC1cSmsOtM1hGkpdRLhGuq36Wj2g36hQzxIHg=; b=I/hag3ztR1QqWBpiiMwPGlDKKg6ZvOztPSayIA0vpjH15ReErJkbsHNqXRU/e7nVNk xjN1ZHNZ5+I44o0af4NAeK5cCujkWWhJoM/apYubk+Ly2tDGJ+Yk0ahsP63pJVeJen+4 ywKYqrnqxbUxLRvQdn8Q1xK2gJY8Uezilx6KuFtnO/lpqfAreIvsEArjugXdSrdQHol+ O3zdoLYIPt3w82nxVUVA2/R3x6L+C/AA6dM/qrPOhLbYugREgW14BbzlmeX7FeazRdJF 90E/e6aW2l4ddHLTwi2NEKC+sOJc1y0ow31TcT9LkQqF/cw+BXcoE8cN2IQ0Z1A03Kc5 oeGg== X-Gm-Message-State: ALQs6tCX4YghyGfQ21ruagPbUQ6fEKnUtMmsgD4x86D7AP637ZYY5zY/ UzpC7dvwNPEzoByPr3QSsYwMpA== X-Google-Smtp-Source: AB8JxZqhzqEF5YH1ET8/AlzN806/mAsphVQM0xk7iSFPQFe7Alo3fRza+THnjjU4hxWsHN9JDv6k2A== X-Received: by 2002:a9d:48f1:: with SMTP id a46-v6mr14323088otj.94.1525293213144; Wed, 02 May 2018 13:33:33 -0700 (PDT) Received: from labbott-redhat.redhat.com ([2601:602:9802:a8dc::d2dd]) by smtp.gmail.com with ESMTPSA id v140-v6sm7141762oie.52.2018.05.02.13.33.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 13:33:32 -0700 (PDT) From: Laura Abbott To: Alexander Popov , Kees Cook , Mark Rutland , Ard Biesheuvel Subject: [PATCH 1/2] stackleak: Update for arm64 Date: Wed, 2 May 2018 13:33:25 -0700 Message-Id: <20180502203326.9491-2-labbott@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180502203326.9491-1-labbott@redhat.com> References: <20180502203326.9491-1-labbott@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180502_133344_202084_A87369C0 X-CRM114-Status: GOOD ( 12.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laura Abbott , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-hardening@lists.openwall.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP arm64 has another layer of indirection in the RTL. Account for this in the plugin. Signed-off-by: Laura Abbott --- Fixed from previous version to be a vector expression. --- scripts/gcc-plugins/stackleak_plugin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/gcc-plugins/stackleak_plugin.c b/scripts/gcc-plugins/stackleak_plugin.c index 6ac2a055ec61..0a55ecaf44df 100644 --- a/scripts/gcc-plugins/stackleak_plugin.c +++ b/scripts/gcc-plugins/stackleak_plugin.c @@ -253,6 +253,10 @@ static unsigned int stackleak_cleanup_execute(void) * that insn. */ body = PATTERN(insn); + /* arm64 is different */ + if (GET_CODE(body) == PARALLEL) + body = XVECEXP(body, 0, 0); + if (GET_CODE(body) != CALL) continue;