From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727877AbgFJUDb (ORCPT ); Wed, 10 Jun 2020 16:03:31 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C338C03E96F for ; Wed, 10 Jun 2020 13:03:30 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id k1so1276338pls.2 for ; Wed, 10 Jun 2020 13:03:30 -0700 (PDT) Date: Wed, 10 Jun 2020 13:03:27 -0700 From: Kees Cook Subject: Re: [PATCH 2/5] gcc-plugins/stackleak: Use asm instrumentation to avoid useless register saving Message-ID: <202006101302.AC218FA1@keescook> References: <20200604134957.505389-1-alex.popov@linux.com> <20200604134957.505389-3-alex.popov@linux.com> <202006091143.AD1A662@keescook> <757cbafb-1e13-8989-e30d-33c557d33cc4@linux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <757cbafb-1e13-8989-e30d-33c557d33cc4@linux.com> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Alexander Popov Cc: Emese Revfy , Miguel Ojeda , Masahiro Yamada , Michal Marek , Andrew Morton , Masahiro Yamada , Thiago Jung Bauermann , Luis Chamberlain , Jessica Yu , Sven Schnelle , Iurii Zaikin , Catalin Marinas , Will Deacon , Vincenzo Frascino , Thomas Gleixner , Peter Collingbourne , Naohiro Aota , Alexander Monakov , Mathias Krause , PaX Team , Brad Spengler , Laura Abbott , Florian Weimer , kernel-hardening@lists.openwall.com, linux-kbuild@vger.kernel.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, gcc@gcc.gnu.org, notify@kernel.org On Wed, Jun 10, 2020 at 06:47:14PM +0300, Alexander Popov wrote: > On 09.06.2020 21:46, Kees Cook wrote: > The inline asm statement that is used for instrumentation is arch-specific. > Trying to add > asm volatile("call stackleak_track_stack") > in gcc plugin on aarch64 makes gcc break spectacularly. Ah! Thank you, that eluded my eyes. :) > I pass the target arch name to the plugin and check it explicitly to avoid that. > > Moreover, I'm going to create a gcc enhancement request for supporting > no_caller_saved_registers attribute on aarch64. For arm64 right now it looks like the plugin will just remain "inefficient" in these cleanup, as before, yes? -- Kees Cook