Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4341285pxu; Mon, 12 Oct 2020 16:51:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCAxq5dRcByqqBIW8zpbf4GVj2ax1L/rl8tw7OKkCdDgEdnGvnGmRq4xdiDaJ18pusFs+Q X-Received: by 2002:a17:906:ce27:: with SMTP id sd7mr5075963ejb.264.1602546686270; Mon, 12 Oct 2020 16:51:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602546686; cv=none; d=google.com; s=arc-20160816; b=xrirrbuAFAz+zax9/u/cHcNmpi/lMVXbh2xU4ShHz0VEePytwGty58FL2wKvMd72ER n+4710w8qHMfqFDnEWDie5XyLMeIPPEGJJQtwGrdY0nNUVUgTpNwhSpLRXT7urDAzSCi MzHzIIGYzxXZfjHCdwcL0eo/4iWejHmVkczwRJfRyG8lFmQmH6fsD5mMcgSAdcDA5osn zIWM7ZMc8AgW8L1rQzjQM5/F/XG7xbi+/k0yda1mI1X/4KSmizTxb01LNiV+dkY6kJSs nQml2bu5IztACqwvHmP3u1Udh0hAF4h4niFi90r8UMivAEl1mbA/RtApZ6ggHZC00Dxj a0rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2GGGWwUf6MZPA+RB0OWZRbb9H4y8rf5mnZ/TyddOXZk=; b=rWpOyJcIruAdMNzdLDeU81FV+nE2HuyNCQ3B4Qn4xo2KkVLH44m9DuW3K6GzmGouMb JL2LJReNUz5fnQGzIE0vhe8ZS+xAbTzJCRgm/XO50gfmGH+W5uh0wgc7FJo+qS6fLSk1 1sQZo9syRt2awwT1+zqT2sBnUUEMAl5tpylaXASx85xlPHYtFQkaxcUWHdOVvlxOTZJO P9DTrBk4ddUOpX4EQbICZ1rzZaEiX3v7D5rnGdRS/OXcqbJpO6hXy2z5TEWg6snc6QoC KvnfFv6ny4IiNU6Ceyr8VYyiYdsFL+bfX/nX11Ecisxct1G/mgsH96Q8JIT5ivrXYN+E qCSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PF78RTHa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt25si13348092ejb.438.2020.10.12.16.51.03; Mon, 12 Oct 2020 16:51:26 -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=@kernel.org header.s=default header.b=PF78RTHa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731390AbgJLNpa (ORCPT + 99 others); Mon, 12 Oct 2020 09:45:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731329AbgJLNmD (ORCPT ); Mon, 12 Oct 2020 09:42:03 -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 B720722228; Mon, 12 Oct 2020 13:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602510120; bh=UJHkcwtAMBTTaQj49a9rbFF+vKgSWPKHudMnhOaOilU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PF78RTHanPxwp0cH3g3nX0neB7/4SQM0+Z4rEg9A9ViVQqQLB32o0BYKoaCbdwc0c ZK6SB+AmWQzQW6GohRd+E20aQkGwQFQMQmsxJHYwX7WIk+jebsOeqdKG8vHkxKH4Zl FDD0WTlVDxxgxXvQeuMnlth7J1gjDkhHA19ZOQrU= 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.4 18/85] bpf: Prevent .BTF section elimination Date: Mon, 12 Oct 2020 15:26:41 +0200 Message-Id: <20201012132633.725047120@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132632.846779148@linuxfoundation.org> References: <20201012132632.846779148@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -599,7 +599,7 @@ #define BTF \ .BTF : AT(ADDR(.BTF) - LOAD_OFFSET) { \ __start_BTF = .; \ - *(.BTF) \ + KEEP(*(.BTF)) \ __stop_BTF = .; \ } #else