Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp744185ybb; Wed, 1 Apr 2020 08:51:29 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuEAnwOEyihjUpICVkfqe1gf3sJSWz8ghni5ueh6vucJOHrqNxy46oSUB5dOpewXGWyHUDR X-Received: by 2002:a9d:68d0:: with SMTP id i16mr16991616oto.291.1585756289363; Wed, 01 Apr 2020 08:51:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585756289; cv=none; d=google.com; s=arc-20160816; b=oevnelAVRMqEE5vQFs4kh2iXSBymQqaLcmEwljGCfMQ6KLC1vh2+RCXZcMFdKuvMCT EMJawbuKeYfCu9HdEhMRo9mcz/l6xQxwDr10VkODl1kIJ6D9Ke7jLplpFqE18Q1frZfR cSTOSOyfQRq6EnbAw4gtQscwcFO7ufWnnFprN0qUn3D6xnxuYvr7liki4UXy3/VDdX76 UXxTDnNwOHDPuFc6d99k5rc7iNcoG2UwZrvVTIuUIZ71VbQd8zaMRUqUMcvciNY85ePi nY7TsYqw3SGLT6ocWy/FpUTpRbn1Df0Fz8/7xziikIq3PEhLXM7myojQWRmB0IyyEGOS vqCw== 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=ySKX8LJGChHC8c8x0OQmrTxCx//5fIDMajpHfT6ERsw=; b=asA3B/mUbSGgHepSPLUKpQKpgnsoh/KutiBs6+JHfYASIYAaj+py/I2eM4Gag4Ierk YqUFjk9bW5jzutBLcRj2QZgXGeLB4RnWijewPQOxf41gMAlqBKdbKjpEv12gdIutjNIV zlaS/Tr+ne6gBNLWS21+xxN+nmbIvipHXe6+xNW1OzdyaHebMJHF7mevMJTJi3/6x8vi 9nhXUKzpOEtuejyEShGqnXTc0+50gUqosjdQq3aZqyBeH4W0IkwioPpHc+ShB+bLFJob NftvkJ0WNakFq57au6RQg5Q4sz8q05g+wrcgxfqSYr0y0pWm5a/6QYTfFbRTeJKjOm/i 1e9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fYGIqS4w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id j9si1030625oif.164.2020.04.01.08.51.16; Wed, 01 Apr 2020 08:51:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fYGIqS4w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1733072AbgDAPt0 (ORCPT + 99 others); Wed, 1 Apr 2020 11:49:26 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37480 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbgDAPt0 (ORCPT ); Wed, 1 Apr 2020 11:49:26 -0400 Received: by mail-pl1-f196.google.com with SMTP id x1so40093plm.4 for ; Wed, 01 Apr 2020 08:49:25 -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=ySKX8LJGChHC8c8x0OQmrTxCx//5fIDMajpHfT6ERsw=; b=fYGIqS4w9FpClJWxf/snstu/bTH/DlaBxQ+pEq2Y/GNnZQYhfDgue/9Lz65NoujHM9 LSxifCvxnIYPKf2GWZY90VOJwTSLJWpwxgDs7Js/2+jdx5gWGXq3ir2iVZK7zD365h/N P8618F8gyRMfSa+q7hWsIqDVOexwB7konfVek= 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=ySKX8LJGChHC8c8x0OQmrTxCx//5fIDMajpHfT6ERsw=; b=ASkOHYravt1/BrkCiDm+JNvc/lh4EEwww4ECZ295uh0s0HqEVH/rYe4tsBN1h3tTvq dL/nOOCfpRNcs4DopbWNqyusZx6VnjYriZlUnI+x5KFlY6AnEkCdk13Uc7Qmx0GFAZQi I1KJa2mArBWK0z9R8k4s2rxiILBLgvgrREq6GfYprxlmJ//cDzmLzGLlNZfQmSqDDcIE JDyVnb0oU9uO5gaRp/DqWvm6f6hikzrmtWD0AvguzARPtQMZJfoyWJwa3JIBM/xNrcIO IotDXjUQPy6cnia1x6z5AZu30LhuXZKYzGV3M2thlFfaKMyAPNAqJutdM49lzZcqqD04 BElA== X-Gm-Message-State: AGi0Pua+OgEVtbRhuufmrBL9rvN2XcIEqgQEat3BuY9FvyjBffbPcs+w BygoFEjk/eqbusPMhVXHUaUh7A== X-Received: by 2002:a17:90b:110f:: with SMTP id gi15mr5488512pjb.184.1585756165084; Wed, 01 Apr 2020 08:49:25 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x3sm1837199pfp.167.2020.04.01.08.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 08:49:23 -0700 (PDT) Date: Wed, 1 Apr 2020 08:49:22 -0700 From: Kees Cook To: Slava Bacherikov Cc: andriin@fb.com, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, jannh@google.com, alexei.starovoitov@gmail.com, daniel@iogearbox.net, kernel-hardening@lists.openwall.com, liuyd.fnst@cn.fujitsu.com, KP Singh Subject: Re: [PATCH v3 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF Message-ID: <202004010849.CC7E9412@keescook> References: <202004010033.A1523890@keescook> <20200401142057.453892-1-slava@bacher09.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200401142057.453892-1-slava@bacher09.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 01, 2020 at 05:20:58PM +0300, Slava Bacherikov wrote: > Currently turning on DEBUG_INFO_SPLIT when DEBUG_INFO_BTF is also > enabled will produce invalid btf file, since gen_btf function in > link-vmlinux.sh script doesn't handle *.dwo files. > > Enabling DEBUG_INFO_REDUCED will also produce invalid btf file, and > using GCC_PLUGIN_RANDSTRUCT with BTF makes no sense. > > Signed-off-by: Slava Bacherikov Very cool; thanks! :) Reviewed-by: Kees Cook -Kees > Reported-by: Jann Horn > Reported-by: Liu Yiding > Acked-by: KP Singh > Acked-by: Andrii Nakryiko > Fixes: e83b9f55448a ("kbuild: add ability to generate BTF type info for vmlinux") > --- > lib/Kconfig.debug | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug > index f61d834e02fe..b94227be2d62 100644 > --- a/lib/Kconfig.debug > +++ b/lib/Kconfig.debug > @@ -222,7 +222,9 @@ config DEBUG_INFO_DWARF4 > > config DEBUG_INFO_BTF > bool "Generate BTF typeinfo" > - depends on DEBUG_INFO > + depends on DEBUG_INFO || COMPILE_TEST > + depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED > + depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST > help > Generate deduplicated BTF type information from DWARF debug info. > Turning this on expects presence of pahole tool, which will convert -- Kees Cook