Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1859178rwb; Fri, 19 Aug 2022 10:33:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Yv95/saF/tO8FtD8/NUFx0pfMx6Q1rcszyFeaxwhFM6K/rIgVq0MXwQctQrNLzro0iUYI X-Received: by 2002:a17:90b:4a92:b0:1f7:2ee5:a2ed with SMTP id lp18-20020a17090b4a9200b001f72ee5a2edmr14960246pjb.127.1660930434642; Fri, 19 Aug 2022 10:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930434; cv=none; d=google.com; s=arc-20160816; b=Id2E3LOWpf8eAZ+0AeFvcj9GtgB0CfS1o0pl97drI/4iw2cn/vHnBXXX6rhS76KjH7 MDWesMA7isFTefNMXb/9y4ZpoLcct3XkagyJPuITEGRE+gQ4WqnfPA14vZLt9Q6FyD+6 VuOyhlXH4luXsep+dJ75cPs8Jq7n03/BBEjCz+Iw/kOiKq7ySShHhBdiQ034ET1Mgfru GmtCrLimI1jMc4/uCftJlrYLBbhEeep79li2jkr0y/2T/le2IJfqOjfr3ELUcYCDYrFp Ujewcl6V5CEl17APHIHvV9uZ84BvozizhzDZAouTj4fpbHLRqm9FYkik3/9HGS/8U22L N+CQ== 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=aT/ZGkLzbGPUsGnSJIvzwvwqlSm1KoArojjLdmzJ9X0=; b=eg/7KPo5EWFgP/5K/BnrPCBTGPnIlsl2IK3cNuQ1tUQVe6tSNtooKbtudYcOL7VPOY mRuGMjNGEHdGxj5qPZHChsANSBrFOwTdLmXG8pgLeDdLREGeN78KZmXX1MPQOY4reBAp /LHIf4stBhmQ9IlOQHSzPmWNgE1TmK0FBT+DqWNKxl6WdLBiVASsB1pe+5Wi+93G8BVA UQuE7KxrHY9vF+gTjw6fVwD5cL9pUYh4rfpZYZ9lfOPeEvL92icaMfJ1v5lD8hYG+dOc uO4uCGU23l6vBBZz07jQty62au1JzMVMtI+qWNbMZDRQDuSMs6GCNW0H6HRYHvTfoEpz U54w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yJv23HXY; 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 185-20020a6301c2000000b0042a46120526si1651424pgb.672.2022.08.19.10.33.43; Fri, 19 Aug 2022 10:33:54 -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=yJv23HXY; 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 S1351821AbiHSQMU (ORCPT + 99 others); Fri, 19 Aug 2022 12:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351858AbiHSQKp (ORCPT ); Fri, 19 Aug 2022 12:10:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E971D11232B; Fri, 19 Aug 2022 08:57:01 -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 83FDC614DA; Fri, 19 Aug 2022 15:57:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85C1BC433C1; Fri, 19 Aug 2022 15:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924619; bh=OrNeTHxlYDIcYbDW02upfTtUi0ToYWNUAMpL14jUXmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yJv23HXYzG/KJaCBssesTZEcGmvuWaLN7IUe0ZFBAnyd4j1SlzW8nqFqIgxicQK/b Upl6IfjsoWbf14SaKoXO0K9aFBw3FlzlD1Vj9Tg58aWgDUEQYcTbvKUo+tz0HRu7vG gGfDbo+DM+u3rC9Mulx4/v+xHuwNNNqw429MvUxk= 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.10 229/545] bpf: Fix subprog names in stack traces. Date: Fri, 19 Aug 2022 17:39:59 +0200 Message-Id: <20220819153839.610541820@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 15ddc4292bc0..de636b7445b1 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -11152,6 +11152,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; @@ -11164,9 +11165,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