Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1518962ybg; Thu, 4 Jun 2020 11:43:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjkRrHaGhRSFbg8EGrkNKadyDJjHknQLFxA2y5JlaX/RYMUDRc1CDJVt4h90LISgFM9YfD X-Received: by 2002:a17:906:7f95:: with SMTP id f21mr4936541ejr.554.1591296194245; Thu, 04 Jun 2020 11:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591296194; cv=none; d=google.com; s=arc-20160816; b=c/8K5hANA+po/zS56HzI4YID/NZfPYD79Th8UmrQM3ClCldzIZPAk8rI19arT1DekP bgJflAHVZvQUC23krd/sxXD2sAX43JtmXrdWWU3Pjpi+ean2GRIleVgDu/qooRfQUV8Q siiRB93prPcb+YD8aS1VKyQMJ6N/P5C8Ip2wII7+1ez7/8D8sDMi2fCVjju+QiY1Cr4w 9cdPF6934M/4BzNM+wwYJ8GfG+t4F5IqqoAyiTz7zvSlCO+I9HH58t7CsSjZ/6kR/n15 J0SjevnmhOMHNdc4a8VfIhwHC0OYV3K80fMtgDd8rwxSoiBYz94/6NUYAoKQ2aFkfQ3E Lk0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JFfRFTCW6FlgjlqwGn/P6j5CtXdNMxPx5d48a8cUyd4=; b=LZ8hDt82yDKQGCNKx5ogxbGYdmaM2SCfSLf3tpSuFmGmRAvamxWKQHhwu/E8nVY66U nvfavUWnR8/1L/ExvCPjKZCGEso9BT429cZVc03+ZsSiXgTdZY6tfy1R3CB5gSVA4jSK xH4faLsCnzqbbwEf3fsyN4Pl410Qk4ApLIAcgDRx0aDBt4f/8mbeHVJ06Nacv+8HxXjn HqAjofetGFzpBIhiWYV/xcmE0uvq/4/05EtRcPTLXYJ4u8WCdcOZfOA7UA+RQSoS/hEM EbNuq6HVU26i5KfF2Q3EgGptxr1i6OCSQSBef2UjnDdL/bRhHtqoe+FpBzBfBpkfHeNG d9bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EEECY9X2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nk5si1984417ejb.513.2020.06.04.11.42.51; Thu, 04 Jun 2020 11:43:14 -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=@google.com header.s=20161025 header.b=EEECY9X2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728865AbgFDOOp (ORCPT + 99 others); Thu, 4 Jun 2020 10:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728496AbgFDOOo (ORCPT ); Thu, 4 Jun 2020 10:14:44 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D96AC08C5C0 for ; Thu, 4 Jun 2020 07:14:43 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id z18so7439792lji.12 for ; Thu, 04 Jun 2020 07:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JFfRFTCW6FlgjlqwGn/P6j5CtXdNMxPx5d48a8cUyd4=; b=EEECY9X2ZdOdKHgdpzGf+DMwJvZiLd517zxt2dbS2nKm3skzGPqTgtp413UgMfvu0Z ySVazhwi/YFYlUV4XnFzNegdZNUnbuIoZjvesCvFjNLr65TFhoUJDtKunjSbLIdKe1Ij T9U0pl+DeA8gNiHYV54V1mtUWojw8ar7qhEqIKQJkpZOJbirv3Ko8C7M9ApwFuifCCyM 2BCbFSH7yCa2YARYKYiQjagjZ6ntYCRHhZ+z6FtDWrarTmrlseFb6Ofe5PTMn80MgGMT w8bNH0WNfPllBGNPWsHRyTCLuuEd5VP4NkFuiuk4k8s1Iz/61glv2Kv2yiGh6FU/aHnF JmxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JFfRFTCW6FlgjlqwGn/P6j5CtXdNMxPx5d48a8cUyd4=; b=bD+rZWMd01HrHXv7PKlYZvfSBctDXos25WEcS7A9ZKhG8EU5mf4/R5+csXh8RspGBD QiH0JrEtAAxqDNEYjnyZgZV0KHOhnQpOHi1iQOAIHj9FBbp4sZIUfqaHtyp3gkqlfQIk joS9AGvO4Bf9/rXSDEbah/SbvrcF/Dswwq3HFyYlUWLpRO8uJ6ZtXXtnHUFGLG246QE0 ch5O9gE+n1y/8ZMccIBSkj/RyNH+URk6oKrNqg1fwa1Vj0V1eKdsX799vso3fD7iVW6l fEv+qyGN0uuo4DJoBP5Lwbi+f/XLAi423Iv+ox80equZ+YM+PAgRNxA+vz5IRQ8cT/bF f0hg== X-Gm-Message-State: AOAM530afD+jfSnfIxoIFX+iI9ykf5os9cmSAeovJfVETDqw2pND2F42 7SSI5A5koovuRuVszRUsJnW5bzlKhSrulbpp9YdIJQ== X-Received: by 2002:a2e:541e:: with SMTP id i30mr2143909ljb.156.1591280081782; Thu, 04 Jun 2020 07:14:41 -0700 (PDT) MIME-Version: 1.0 References: <20200604134957.505389-1-alex.popov@linux.com> <20200604134957.505389-6-alex.popov@linux.com> <20200604135806.GA3170@willie-the-truck> In-Reply-To: <20200604135806.GA3170@willie-the-truck> From: Jann Horn Date: Thu, 4 Jun 2020 16:14:15 +0200 Message-ID: Subject: Re: [PATCH 5/5] gcc-plugins/stackleak: Don't instrument vgettimeofday.c in arm64 VDSO To: Will Deacon Cc: Alexander Popov , Kees Cook , 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 , Vincenzo Frascino , Thomas Gleixner , Peter Collingbourne , Naohiro Aota , Alexander Monakov , Mathias Krause , PaX Team , Brad Spengler , Laura Abbott , Florian Weimer , Kernel Hardening , linux-kbuild@vger.kernel.org, "the arch/x86 maintainers" , Linux ARM , kernel list , gcc@gcc.gnu.org, notify@kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 4, 2020 at 3:58 PM 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. Maybe at some point we should replace exclusions based on GCC_PLUGINS_CFLAGS and KASAN_SANITIZE and UBSAN_SANITIZE and OBJECT_FILES_NON_STANDARD and so on with something more generic... something that says "this file will not be built into the normal kernel, it contains code that runs in realmode / userspace / some similarly weird context, and none of our instrumentation infrastructure is available there"...