From patchwork Mon Oct 12 13:30:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 270306 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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 3EAC9C433DF for ; Mon, 12 Oct 2020 13:48:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2913222B8 for ; Mon, 12 Oct 2020 13:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510491; bh=4fRAaOVTv/qlBcCTxLcq0CDp/BUdDur046Ay1mTLBCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JjLfmTaXW2apBIV9QSv80bEjBKFIvQE/OX/BPQyooLfy5XPNWbae0zxnR9basySQS 8eQz5xbonatk4eNFHVb06C3XBhiMUrlpKGL+Ka40aAzC67RyROC7VIhPp84sttimQF nyBmV3ovybfooWWqe79gXCnhdL3/3ZfClZQf3WJ0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731799AbgJLNsK (ORCPT ); Mon, 12 Oct 2020 09:48:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:48538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389761AbgJLNpz (ORCPT ); Mon, 12 Oct 2020 09:45:55 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DC76B22370; Mon, 12 Oct 2020 13:45:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510329; bh=4fRAaOVTv/qlBcCTxLcq0CDp/BUdDur046Ay1mTLBCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QkqkmWvNDSUdhNy8rRo8+/9D+qp6+3XmrDZS53SPHiRQjvZ7n3f0+yuaQtziK4pWo twqHLQtgAZ6+xLnwcqab1Bte2KvZTKWWroBAmOWddH0ngbtmTovjJAkygZw++d7KXe xt2Myczhui1YRbsaEqZKRyv1Tm6fTtGVVHiEuRms= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Ambardar , Daniel Borkmann , John Fastabend , Andrii Nakryiko Subject: [PATCH 5.8 022/124] bpf: Prevent .BTF section elimination Date: Mon, 12 Oct 2020 15:30:26 +0200 Message-Id: <20201012133147.919333925@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012133146.834528783@linuxfoundation.org> References: <20201012133146.834528783@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tony Ambardar commit 65c204398928f9c79f1a29912b410439f7052635 upstream. Systems with memory or disk constraints often reduce the kernel footprint by configuring LD_DEAD_CODE_DATA_ELIMINATION. However, this can result in removal of any BTF information. Use the KEEP() macro to preserve the BTF data as done with other important sections, while still allowing for smaller kernels. Fixes: 90ceddcb4950 ("bpf: Support llvm-objcopy for vmlinux BTF") Signed-off-by: Tony Ambardar Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/a635b5d3e2da044e7b51ec1315e8910fbce0083f.1600417359.git.Tony.Ambardar@gmail.com Signed-off-by: Greg Kroah-Hartman --- include/asm-generic/vmlinux.lds.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -641,7 +641,7 @@ #define BTF \ .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) { \ __start_BTF = .; \ - *(.BTF) \ + KEEP(*(.BTF)) \ __stop_BTF = .; \ } #else