Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp775028ybg; Wed, 10 Jun 2020 13:24:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXkGdurQ3j/a4gTEBc6wphAU1P0IbqASLNeu8fzJgCUdP5XP5np5jtZS8Mj9yVE4Y519Zk X-Received: by 2002:a05:6402:3c1:: with SMTP id t1mr4110025edw.350.1591820650101; Wed, 10 Jun 2020 13:24:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591820650; cv=none; d=google.com; s=arc-20160816; b=pbVGip6orP2p9NFkGtaQl76O+dFGVFIzZQq+ZGDqj3PySzgIxPHmk3lCO0ahrst1ro wV1uAq1tClGEnNnPhxJtj0PHWA7NsDKEx18YG1fhR/3mtttcWCbMgJNCgyZK1WR3MzL4 lO/QpsHAByQLxU5FTR3NirRJ3fIerVynoAT8kAoXEmSbEmGpHGaNOgTjLzl8RVf+/xNG kVT4VaicKW+j6bbke61e5cEnSZ4mqGQS4dgBgVE2+hBsUgWya14L0SPc2FUbzcL0udtL /ZsyknkUU0ERC0nlm/SjohKYAVI1vwX9Y0VHYHHfy2GNZ6mZD1w1skNp+Imz07OPxgKK wCbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gMJmfBXQHkqYBkdWFgkIELmfTMw2QzimZzoX9rnpMvg=; b=ZSu5u46wXHM2hxINNRCQGDsRH9dAxz4OKnyQlO/Ql8FWp2xBrW57kcfU6o+dili1tj DrAky723USS5XRo7xwBhV8UtQ1QLameTdodGDFdJ7DUajMEke0dUrEPo6zB97tVCQJoB ADCcJZOtuWbzEMNNJRSrPidkGDGeY+mFQduQ2jci2vT2G1mOpW34s78qG9HWrooC6Xfw QCacFoRDYeca5C9e2JTHLv0RRSxIIUeW5eFbBtpq0QbsFq/pagJfACBSUZGf0eFaR8XR U/wkoMcvBZZjn0DnXVwDLZJ/vJdi0xIydHEfLxXdqcLTewcJ+So8XJEoZCYOu5rJYfkU uu1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VmhHMiuh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si390206edr.174.2020.06.10.13.23.47; Wed, 10 Jun 2020 13:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VmhHMiuh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730348AbgFJUDa (ORCPT + 99 others); Wed, 10 Jun 2020 16:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727877AbgFJUDa (ORCPT ); Wed, 10 Jun 2020 16:03:30 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1BCDC03E96B for ; Wed, 10 Jun 2020 13:03:29 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id v24so1377158plo.6 for ; Wed, 10 Jun 2020 13:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gMJmfBXQHkqYBkdWFgkIELmfTMw2QzimZzoX9rnpMvg=; b=VmhHMiuh5ohUCH3fDJnKjrDQRFL0Ji8PnJG1vfqLFDTNpxPKF/jUW6bjeiV5SjTR6o WXLVjXgIO5BzDsgibhA+L18doG6dCY7DA2U8R4aA2THMwHzIRdDqPqVTIOT51M5UhGjo pbeqxJDSxr/3GPDIEZHoH3PhBmMXdRDJJDdIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gMJmfBXQHkqYBkdWFgkIELmfTMw2QzimZzoX9rnpMvg=; b=H9mIC+u0ehUjflNMuWUDyF0sjhA11q8NCHIlYUhNIA9IcFt24J4WJXEiZjvvu0mUQ0 N9WCE72rRUnTEl4/Kt4jftKIS9X1/8NLDJF2O362VcXKqnsOxKZBQpT/amK2wgpM/BZ+ iccV2hnmY/fqrM8tsXTtz8e1LFzRD83EZsdg9b0u3tGa10e0aGGUBoJ5XAI0fY/uqWcx LOfQaK4JW5BVfqE1lcTrVs1GukgNSGN9AAao1ZcnfM5gAyOWpNlXSdHW2E0x3vqGDKSY SbUZ2qZyCvh2YyFgy8kZ1a9hWxvYamb+Ie3TLfPGLI35f52IY/Dcvq7jr7V7j6rNlhm7 6Kag== X-Gm-Message-State: AOAM532vHzEBtONC7Vrf59djsE/uATCbyWHz7x/hnQvM8mPlcjSqJsUz trT0cjL4zXS4GyZSNpGTW89UHQ== X-Received: by 2002:a17:90a:cb8d:: with SMTP id a13mr4644611pju.175.1591819409470; Wed, 10 Jun 2020 13:03:29 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l63sm724636pfd.122.2020.06.10.13.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 13:03:28 -0700 (PDT) Date: Wed, 10 Jun 2020 13:03:27 -0700 From: Kees Cook 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 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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