Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1858208ybb; Thu, 2 Apr 2020 08:35:52 -0700 (PDT) X-Google-Smtp-Source: APiQypIUL0ixL1jcqlRndJEQg/9HY9ejz6ZH3l6rAYi12LTg7K4jmpp8OL5l0ggBClqq8vherHqc X-Received: by 2002:a4a:e495:: with SMTP id s21mr3202234oov.79.1585841752199; Thu, 02 Apr 2020 08:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585841752; cv=none; d=google.com; s=arc-20160816; b=J6Q8ENe13vNIJkVbhXKToIK8yQilOj5ipHiGb2cF/H/2XLX9D/kTCRcnqJgQgj8l9p mnRkosEJoVDJIgv+lJh2OW4Ez28UVk8aarLFNg8fMu8TmbbKKU+66LOVbS6T7eTckky1 WJcL4cwg1Bn3xbrWL1xUX+H4dTw3TGsiLsl6EVxK3D3hy8QCcikS3SoILeJIzLPyZO3V sV+6oeSIYFgQs/HrM4R2TJ1CMLOZQMRw8jPgtdK6Zr9bBSlhglxPSt8tZ1YPvtTF73pp sQiEODgRWV/d/oYejbzBwgRu7GT/2cUfPDFg/LuaQ46GNXxyufJvVv8Mwte6gPNcxLcO yPFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=bKUf/bnAONFPXaf6zoV9Cn+HIIIIoYflCpB+vjMGW18=; b=QI2hBCKnPzzpk2VTjOrVEH1bXmgwZdOL0EszysuQ/W4oIcIlfX85msd0ENRbxOOoD9 kTLgUcV2LdGdjYDcoKxzcpaIB0nF8R6CcCfjLAV2kMft387/iKL2XI+ZZx0faqBfBN+T HTDxTIp99osUYWvDymr0JGpKZMksSNlOMCFTe2Ys/ks+J9jpH/31a6upa9s9dtSCOLuF Xzu9VDxUg2PGwExh0WP9oLzzDxEq6nbZ2ErQugjokGRKtBZbJtK9vFZ75S/TMZGWYEiu iYDdJ9aTEnvAiG5plRKEK6jg8xSJd/JrzWcIi1/77chyBqwGaPxM4/XKS7zPQKWV6aUt jozA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bacher09.org header.s=reg header.b=HNrpNMyR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si2633668oia.155.2020.04.02.08.35.38; Thu, 02 Apr 2020 08:35:52 -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=@bacher09.org header.s=reg header.b=HNrpNMyR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389303AbgDBPel (ORCPT + 99 others); Thu, 2 Apr 2020 11:34:41 -0400 Received: from pub.regulars.win ([89.163.144.234]:35722 "EHLO pub.regulars.win" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732754AbgDBPek (ORCPT ); Thu, 2 Apr 2020 11:34:40 -0400 From: Slava Bacherikov DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bacher09.org; s=reg; t=1585841677; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bKUf/bnAONFPXaf6zoV9Cn+HIIIIoYflCpB+vjMGW18=; b=HNrpNMyRlD90A3TMwMZHALy+ta+0ynQ+1oVhRvwwGsCPTvsRtsjf4Ds9ztmBRuq3sAOWKK RG/VAG3HXogrMUbFpmqA/WQufGMoqj4Bg663lFurWifyDKMZQ7p3Vc/RXS0Jch/uOh7pJ3 0zhAfPmaMV+DII6Y5Ggr0RlbXON+Y9A= To: keescook@chromium.org 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, kpsingh@google.com, Slava Bacherikov Subject: [PATCH v4 bpf] kbuild: fix dependencies for DEBUG_INFO_BTF Date: Thu, 2 Apr 2020 18:33:36 +0300 Message-Id: <20200402153335.38447-1-slava@bacher09.org> In-Reply-To: <202004010849.CC7E9412@keescook> References: <202004010849.CC7E9412@keescook> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reported-by: Jann Horn Reported-by: Liu Yiding Acked-by: KP Singh Acked-by: Andrii Nakryiko Reviewed-by: Kees Cook 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