Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2926905rwb; Mon, 15 Aug 2022 14:12:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR70a/hSEQYJKX1A4QX5jSkdGvLCU0E948DZatWx4JPWRGjCrtdE87TRlrdhAPXBlyzZAEMg X-Received: by 2002:a17:902:904b:b0:170:a3e6:9d98 with SMTP id w11-20020a170902904b00b00170a3e69d98mr18666395plz.50.1660597938411; Mon, 15 Aug 2022 14:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597938; cv=none; d=google.com; s=arc-20160816; b=FIBe9pWhhIxvVrc9JbsWMGNl08kxNnY2HOQLR5ljSCL6kQFMoLvRm+hd+cPMATDaQl uvFMOiodfA3O3MOpbQ56ErXNyzBVTyM+J+lpVrTVIO7QlkW8TpOZZatPg81BswcXrSR5 RC3PA1RltwD2iYN1B+QNMnQH0Whd8OTsKKUrbttlKSgOLS4I0HoWehMIGrbdaLXDM2KX qo2JFbXJ+rgCw0vr4WiLPMZu7eGd9t+KLZUCWwn7iKdrRuk271PQXjNWAqFybb+oUPli UrPqc7EHv4w3DPzI/PFWKH0a3zUjWjC/j6nLYEgAKIvy8Ea7mjp+5YS3LY+EDVQ5a9nc wDSA== 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=c+b0AgEVDrJklIf8EKv0HrWMq4MG5/xjOQy8cadEi7Y=; b=yPsWB2z6BFf/aNjrcP6nhbjCsNx4TX9GF9sZWpGcghV0Qzzg0EfYTgv7b64GoZePZc 9VUOYSiTfHGmr0QfS+NMa1i62UcB3H0pNgOxUo01K2AQJURI60c70ZXgS4eqkvo9egJL gsIF6tuNiIJAc/xK/X+KyXn0EydnW5BR5JtpJP3d/M95X92C1kPLlyj5DbhZWq9dsTpw H2wrBtd/Oy8nVLhj5xfxy1Sj5FkUYQLkKiCHDZrDUSP98aV1gPxO+wAXEmsccwvWZidM MUoFkr51bmeOASpb+rF/nvamTOQWYnDfTgUmv6C4V0jsjDTOU3pBssiK164lJyahg+hS dKVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TZPqMo6m; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a170902e84300b0016edf7ced85si14738499plg.113.2022.08.15.14.12.07; Mon, 15 Aug 2022 14:12:18 -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=@linuxfoundation.org header.s=korg header.b=TZPqMo6m; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244786AbiHOS66 (ORCPT + 99 others); Mon, 15 Aug 2022 14:58:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244896AbiHOS4N (ORCPT ); Mon, 15 Aug 2022 14:56:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E13692A73D; Mon, 15 Aug 2022 11:30:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 392B260F9F; Mon, 15 Aug 2022 18:30:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 427C0C433C1; Mon, 15 Aug 2022 18:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588237; bh=ORph88blPiFZ+kkoAYxCbSsKbFMd7dm7uoia54TWeYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZPqMo6mzoQg8Q2Wd6FliN10qNRk9rPKNDhAOMJXzPOccN362drQEHwhbEMwT+0IP b3DZqq+khr0Et49haisy8tL0IXM3KRwSNIj7TPqPF9BhibbFePqF7u0NvGVyPf9VbD M2eEUbTXqosPptWZuTU+JkboqdfDwyYeF+eriIbE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tejun Heo , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Yonghong Song , Sasha Levin Subject: [PATCH 5.15 339/779] bpf: Fix subprog names in stack traces. Date: Mon, 15 Aug 2022 19:59:43 +0200 Message-Id: <20220815180351.764246993@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 From: Alexei Starovoitov [ Upstream commit 9c7c48d6a1e2eb5192ad5294c1c4dbd42a88e88b ] The commit 7337224fc150 ("bpf: Improve the info.func_info and info.func_info_rec_size behavior") accidently made bpf_prog_ksym_set_name() conservative for bpf subprograms. Fixed it so instead of "bpf_prog_tag_F" the stack traces print "bpf_prog_tag_full_subprog_name". Fixes: 7337224fc150 ("bpf: Improve the info.func_info and info.func_info_rec_size behavior") Reported-by: Tejun Heo Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Martin KaFai Lau Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220714211637.17150-1-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin --- kernel/bpf/verifier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 346d36c905a9..c8b534a498b3 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -12445,6 +12445,7 @@ static int jit_subprogs(struct bpf_verifier_env *env) /* Below members will be freed only at prog->aux */ func[i]->aux->btf = prog->aux->btf; func[i]->aux->func_info = prog->aux->func_info; + func[i]->aux->func_info_cnt = prog->aux->func_info_cnt; func[i]->aux->poke_tab = prog->aux->poke_tab; func[i]->aux->size_poke_tab = prog->aux->size_poke_tab; @@ -12457,9 +12458,6 @@ static int jit_subprogs(struct bpf_verifier_env *env) poke->aux = func[i]->aux; } - /* Use bpf_prog_F_tag to indicate functions in stack traces. - * Long term would need debug info to populate names - */ func[i]->aux->name[0] = 'F'; func[i]->aux->stack_depth = env->subprog_info[i].stack_depth; func[i]->jit_requested = 1; -- 2.35.1