Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp22916808rwd; Fri, 30 Jun 2023 14:49:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48BtgSnCaMmBD5o6WY9dsNTVJ6amYTL3Drf3wHEcFh2FrCzOUijM0cRXu2AWMAYzS//Qvk X-Received: by 2002:a05:6808:1295:b0:3a1:ee4b:b8ee with SMTP id a21-20020a056808129500b003a1ee4bb8eemr4694220oiw.53.1688161777153; Fri, 30 Jun 2023 14:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688161777; cv=none; d=google.com; s=arc-20160816; b=kLKG8Lp2RJ4ouqu9n/NxX+MXa3F0bkY/houkO0Kvn4zklP65pilBYWGQqU8btWeXcQ OZ+KaJ8hj5LQwG4xO9QD0JyAx2F9aK9+QC/2Ze6MCheCyryMuPBrvbTRasnrL2x6vR5q FgClUIGeFX8C5G+ENIBoPG/DXIAi/3pQz2v5U3XMSnM6AyUrZ+N9vPyGFB5cKpzl18W9 528psMP6coeJlWx9usM+q/eipH6DOTZaOrJyAnQMlECX9sLYSojIQpnqlZODL9neQf7P FSmwHhVnDoUd7kxXq6+6SAnT6m5IQp+yRS4acoB+jqLXe+ZZxwUmIuuDYpHlf5LQuXrK D43w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fy9QqYY1ukYXHuyCeOoyYBfJGAHOm15QaQZ4XLVJviA=; fh=97oduAXuK+SUxNr2rzgPrxwrm3hNOZRAH1piO46Q9Os=; b=WSnaCYON8CURqN88y8zYqgnn0j7ZwQy7WICL5B3yKD/ukNpE/kiCNY+6Og3cDLbeXv YWDP4OTTZLDfTRhgekS3YOLKhqUcqsgX9srkwbompaZaJtXU/ubIi4hwfIqCQ4QVIoZe JuXaxCLxTMh9iTiidZa/WHFTb1DNycRI+mt0rUVhhcledsczvYcIwheuEXdC9YgbMVPb fNCEUqY4y/uGpn9VhXlrAoSFjzc5WgnOKaYQ2JL+p7r23W80IIV6kq4iXj29bCm+yBMF chncGNt9fU5Xb9GYDzQ8MQ1naFHI+3QwhFmUFZNPCq/4kLYxB3AtjfY4QZeeWmE8KJGh tFCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=byinquFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t24-20020a656098000000b00553ebb05d26si13188170pgu.108.2023.06.30.14.49.23; Fri, 30 Jun 2023 14:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=byinquFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232478AbjF3VC6 (ORCPT + 99 others); Fri, 30 Jun 2023 17:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230388AbjF3VC4 (ORCPT ); Fri, 30 Jun 2023 17:02:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B90FD3AB6; Fri, 30 Jun 2023 14:02:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5832861812; Fri, 30 Jun 2023 21:02:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEF1CC433C0; Fri, 30 Jun 2023 21:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688158974; bh=JcRoUVFNM9/6PR4mDTjNnE2muKhhGvnoeEasmT4br1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=byinquFCr/Gggvsv/R7A6N614gv3EUx+4dmFXAZ0rdYEOYUAaZ5fnniEEAPyS6JHA n6kp6jaizk1QTx7gyAbl30ZH9jidBOv1qFDjQy7mm4+zaJirNeeC7HkKGOC17av1lr jYfbWFNbe6en6ziR8GSr5LTX6ziEpA2v2XQhxzDI1kMCCCKHSE7XUQkdb+K9aaC/He GMk4oItAKiyRjJcHhOIzFD4NTmokq96vZS/TWbCJsZm/1XJg2A7zi5cBE8DfyDNn3M F17bf4dQko3kkURaNgauZR9oJrDbqOuxge9fhH4S7LBn27lrsPDA1E1SESju5saP8Z xrup+9a4lckFw== From: SeongJae Park To: Daniel Borkmann Cc: SeongJae Park , martin.lau@linux.dev, Alexander.Egorenkov@ibm.com, ast@kernel.org, memxor@gmail.com, olsajiri@gmail.com, bpf@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Olsa Subject: Re: [PATCH v2] btf: warn but return no error for NULL btf from __register_btf_kfunc_id_set() Date: Fri, 30 Jun 2023 21:02:51 +0000 Message-Id: <20230630210251.126928-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <75483b53-bd8e-692e-ed18-a4c87cf20a1b@iogearbox.net> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 30 Jun 2023 22:52:24 +0200 Daniel Borkmann wrote: > On 6/30/23 9:48 PM, SeongJae Park wrote: > > On Fri, 30 Jun 2023 16:53:38 +0200 Daniel Borkmann wrote: > >> On 6/28/23 6:46 PM, SeongJae Park wrote: > >>> __register_btf_kfunc_id_set() assumes .BTF to be part of the module's > >>> .ko file if CONFIG_DEBUG_INFO_BTF is enabled. If that's not the case, > >>> the function prints an error message and return an error. As a result, > >>> such modules cannot be loaded. > >>> > >>> However, the section could be stripped out during a build process. It > >>> would be better to let the modules loaded, because their basic > >>> functionalities have no problem[1], though the BTF functionalities will > >>> not be supported. Make the function to lower the level of the message > >>> from error to warn, and return no error. > >>> > >>> [1] https://lore.kernel.org/bpf/20220219082037.ow2kbq5brktf4f2u@apollo.legion/ > >>> > >>> Reported-by: Alexander Egorenkov > >>> Link: https://lore.kernel.org/bpf/87y228q66f.fsf@oc8242746057.ibm.com/ > >>> Suggested-by: Kumar Kartikeya Dwivedi > >>> Link: https://lore.kernel.org/bpf/20220219082037.ow2kbq5brktf4f2u@apollo.legion/ > >>> Fixes: c446fdacb10d ("bpf: fix register_btf_kfunc_id_set for !CONFIG_DEBUG_INFO_BTF") > >>> Cc: # 5.18.x > >>> Signed-off-by: SeongJae Park > >>> Acked-by: Jiri Olsa > >> > >> I presume this one is targeted at bpf (rather than bpf-next) tree, right? > > > > You're correct. It's not urgent for us, but I would prefer it to be merged > > into all affected kernels as early as possible. > > Ok, sounds good, bpf tree it is then. > > >>> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c > >>> index 6b682b8e4b50..d683f034996f 100644 > >>> --- a/kernel/bpf/btf.c > >>> +++ b/kernel/bpf/btf.c > >>> @@ -7848,14 +7848,10 @@ static int __register_btf_kfunc_id_set(enum btf_kfunc_hook hook, > >>> > >>> btf = btf_get_module_btf(kset->owner); > >>> if (!btf) { > >>> - if (!kset->owner && IS_ENABLED(CONFIG_DEBUG_INFO_BTF)) { > >>> - pr_err("missing vmlinux BTF, cannot register kfuncs\n"); > >>> - return -ENOENT; > >>> - } > >> > >> Why the above one needs to be changed? Do you also run into this case? vmlinux BTF > >> should be built-in in this case. I understand it's rather the one below for BTF + > >> modules instead, no? > > > > Again, you're correct. This change is not really needed. I was interpreting > > Kumar's suggestion merely into code without thinking about his real meaning, > > sorry. I will restore this in the next spin. > > Perfect, I think after your v3 respin it should be good to land. Thank you! I will send it by tomorrow, to give people enough time to comment. If you don't want to wait, please let me know :) Also, please note that this will not cleanly applicable on 6.1.y. I will provide the backport to stable@ as soon as this is merged into the mainline. Thanks, SJ > > Thanks, > Daniel >