From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99FBEC433E0 for ; Tue, 9 Jun 2020 19:09:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D8452067B for ; Tue, 9 Jun 2020 19:09:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XxHW+UZD"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="jnaQZ8ME" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D8452067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iE7izaj62PhaBSalo9Hl+wXb1+AsVnN0C0G71U63hIc=; b=XxHW+UZDBJrgba MOK6QyNXwGs1TVHogwOC4fdlmrtIDh71dY/zKGNk1GNQhDHO1Jb4ABpWqoiGeUmUu9pWQUJkOWxhn q1LIFlPdAh64vxW6X4KolUSfR52yDtITGih8EmCZkdR0ZLtuY58u7A/lXv3mvO+MiXLZTR4dWXsuc CxtNuSmxEXvRZXigXOf4pSwbIvmtIu9ZJXqduQJcshZETFx1QbBFQSHQ5f2pssLc7pmz9d0p/cjTv mOczoboq97pQcx3ltAYhFLoMN8zwYc2POEuUagNrdGucuLPRLEzhPDX+jVcyp+/GwI6wryEUPL/ve G/JyvBJ+fiY1EFsZEG5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jijcr-0006rW-2t; Tue, 09 Jun 2020 19:09:33 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jijco-0006r5-7W for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2020 19:09:31 +0000 Received: by mail-pl1-x641.google.com with SMTP id bh7so8395529plb.11 for ; Tue, 09 Jun 2020 12:09:30 -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=HQ56nm4mooZrZLgVMVr3lZPOBHVENmtQeTfjkfw/YJA=; b=jnaQZ8MEekRFeh3Jik9anJ+/Px5C4alE3zNqedi1bqR8jiPLxE/33C7/RiybjLNOsq AmQ9rdfd3Ze4Ax/HonsNV1UFkPQEvOwezedHn5AF5Jnzkw2BlAW1K5ep2YZIi8eWslnH VFv1//pXv1ACBo1/iRJVPWdY32ebVtXojWK9Y= 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=HQ56nm4mooZrZLgVMVr3lZPOBHVENmtQeTfjkfw/YJA=; b=PgauC47qkj3M8GekutmkaO9PyaNDE5zH6n+loDMVepggnDfKPWHEYawPdhikXi4hLP 0nlCCgyoADqFCCc83dWZe2wkXcs6J0wNxd9MFj4jz9z4FdKovxz9oKDhZKYJ4dffdYgr Y1HiPu1/AeY6uFlTytF0/uK62bXj2xVSXHjHuiQJzaLiIqBfa/5TftFQ1STbFjJDvJBY oXa08PiynF9/7jS14rbldFtaMIZVvaPvxyTkcFD45EUskGPTPbUo8BOti4oAdb5ibdT5 VNT1tt4Z7viWe32WsldivGCIp1s8ewADv+buwcF/cOFc+jQ6pG4XZZOtx+1rTpm3Nlog 038g== X-Gm-Message-State: AOAM532gn2SOCcYWPpdeURXeFKwsQeP0FXU2po0IZZr0fm2fACYTD1vL JHp1eE9RUx9Iqu8UcvzexemCDQ== X-Google-Smtp-Source: ABdhPJyKqh5iCm5EpXlVTd6GWynqUSgX0FSb3wwJXSw5Kt+fNblO4xqG/eduJstaxdLXws8XUiWjng== X-Received: by 2002:a17:902:7896:: with SMTP id q22mr1188647pll.237.1591729769700; Tue, 09 Jun 2020 12:09:29 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id r8sm10830771pfq.16.2020.06.09.12.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 12:09:28 -0700 (PDT) Date: Tue, 9 Jun 2020 12:09:27 -0700 From: Kees Cook To: Will Deacon Subject: Re: [PATCH 5/5] gcc-plugins/stackleak: Don't instrument vgettimeofday.c in arm64 VDSO Message-ID: <202006091149.6C78419@keescook> References: <20200604134957.505389-1-alex.popov@linux.com> <20200604134957.505389-6-alex.popov@linux.com> <20200604135806.GA3170@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200604135806.GA3170@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200609_120930_285828_82D86B43 X-CRM114-Status: GOOD ( 18.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-hardening@lists.openwall.com, Catalin Marinas , Masahiro Yamada , Vincenzo Frascino , Sven Schnelle , Naohiro Aota , Masahiro Yamada , x86@kernel.org, Emese Revfy , Iurii Zaikin , PaX Team , Laura Abbott , Mathias Krause , Alexander Popov , linux-kbuild@vger.kernel.org, Alexander Monakov , Michal Marek , Thomas Gleixner , Peter Collingbourne , linux-arm-kernel@lists.infradead.org, notify@kernel.org, Florian Weimer , gcc@gcc.gnu.org, Brad Spengler , linux-kernel@vger.kernel.org, Miguel Ojeda , Luis Chamberlain , Jessica Yu , Andrew Morton , Thiago Jung Bauermann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 04, 2020 at 02:58:06PM +0100, Will Deacon wrote: > On Thu, Jun 04, 2020 at 04:49:57PM +0300, Alexander Popov wrote: > > Don't try instrumenting functions in arch/arm64/kernel/vdso/vgettimeofday.c. > > Otherwise that can cause issues if the cleanup pass of stackleak gcc plugin > > is disabled. > > > > Signed-off-by: Alexander Popov > > --- > > arch/arm64/kernel/vdso/Makefile | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile > > index 3862cad2410c..9b84cafbd2da 100644 > > --- a/arch/arm64/kernel/vdso/Makefile > > +++ b/arch/arm64/kernel/vdso/Makefile > > @@ -32,7 +32,8 @@ UBSAN_SANITIZE := n > > OBJECT_FILES_NON_STANDARD := y > > KCOV_INSTRUMENT := n > > > > -CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables > > +CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -fasynchronous-unwind-tables \ > > + $(DISABLE_STACKLEAK_PLUGIN) > > I can pick this one up via arm64, thanks. Are there any other plugins we > should be wary of? It looks like x86 filters out $(GCC_PLUGINS_CFLAGS) > when building the vDSO. I didn't realize/remember that arm64 retained the kernel build flags for vDSO builds. (I'm used to x86 throwing all its flags away for its vDSO.) How does 32-bit ARM do its vDSO? My quick run-through on plugins: arm_ssp_per_task_plugin.c 32-bit ARM only (but likely needs disabling for 32-bit ARM vDSO?) cyc_complexity_plugin.c compile-time reporting only latent_entropy_plugin.c this shouldn't get triggered for the vDSO (no __latent_entropy nor __init attributes in vDSO), but perhaps explicitly disabling it would be a sensible thing to do, just for robustness? randomize_layout_plugin.c this shouldn't get triggered (again, lacking attributes), but should likely be disabled too. sancov_plugin.c This should be tracking the KCOV directly (see scripts/Makefile.kcov), which is already disabled here. structleak_plugin.c This should be fine in the vDSO, but there's not security boundary here, so it wouldn't be important to KEEP it enabled. -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel