Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3630758pxb; Mon, 24 Jan 2022 13:58:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/aXPD7u9fkoxE7GT09+cUBqRVlQztIzDfVqy2i3CTxogUl0sigrVahCiwmjNVFrPXH1bj X-Received: by 2002:a17:90b:1d8d:: with SMTP id pf13mr296515pjb.232.1643061490723; Mon, 24 Jan 2022 13:58:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061490; cv=none; d=google.com; s=arc-20160816; b=OzZohVux4WfQrhFfVXVYBWehPN7w37s+H8m959nNTvWCqOdYQqeH5VXLMIy86Da3mW 9W+evGlMkTVlqCKXJapl+XKEkjFDO5ISgc+6Xq+HnX0lpUtJu15aS4g1eziTp+6EBKU2 CGsvTFAaA1KJM0xT8d/SsK97vJ5Z14zYwrMpe0s5SyYszpYN8Etf1w2GxmX1QTP4WWdB +C0IWpdUpWZPCC/4crc7GF0pPmPXyfjRQDI6M2bR85z8bkzx7QTK9zulaoxsortEqPaM 6UKsqedTZIgHP+FCjmf6E2FFRS2yDiVc5E8F3PQ/KtrvYNsEES7wC5vGRG9KOjnzk4zB l9oA== 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=YznVWv0So8VLrrTj5yFGcWGna1L2CUpOcIcGKlUo5Q0=; b=dwtkm4Jk3QERcIL3g/PeFS/krhGuf5OcWOAHuncJE2RO9H1HkM59k85ojAyj0jQZ/Y HAzRQSdciVPA3R3NXtkeR9igWlNy7OMhiOA/pM6wMznKxLMqG9K9Llxta4MvG5I2sMRZ nSdT5CtD844si7BSyjtMU4z+oYweqUZpfMhOzXxHBtQjzlhdIQ4+9/YNBcWirkHzZxsG Us/KXP0O5scSO73P4lfBBBqjCPxEmZJ4Ea7u/qrqgPSS5wCUfW1SjRsrf+H6yM5eq9+2 9AKcHq+EvQExunix9o+9eT0a4Bc9Syee3t4ZJgSIM/8hhRUI1jmioOeuhNDmjcm+2J38 JTgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PewUrMZp; 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=pass (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 k20si12503221pls.312.2022.01.24.13.57.59; Mon, 24 Jan 2022 13:58:10 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=PewUrMZp; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573805AbiAXVp4 (ORCPT + 99 others); Mon, 24 Jan 2022 16:45:56 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:33760 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448020AbiAXVLy (ORCPT ); Mon, 24 Jan 2022 16:11:54 -0500 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 ams.source.kernel.org (Postfix) with ESMTPS id F31D6B8121C; Mon, 24 Jan 2022 21:11:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D495C340E5; Mon, 24 Jan 2022 21:11:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058711; bh=AqUHJMQ2oY0NsP6WS7PPXKuOprmnYcXcK6FdrOhbVas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PewUrMZpCqOV30LoK6McSnp1HXenZbUZpU/EZH9Z2Dz80cGj9sTsSnXSgwXz9lyNT AACOs+vrgGvxmPXSeK48F/n4hXp9zgYzAP+4hQySTrER080KcxJ2w9WZBHTOCyAvnE 0puTROgrWaK9FwqwdC7GVaahhdeQWp2TTpo/08sI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qiang Wang , Chengming Zhou , Andrii Nakryiko , Hengqi Chen , Sasha Levin Subject: [PATCH 5.16 0378/1039] libbpf: Use probe_name for legacy kprobe Date: Mon, 24 Jan 2022 19:36:07 +0100 Message-Id: <20220124184138.019901056@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Qiang Wang [ Upstream commit 71cff670baff5cc6a6eeb0181e2cc55579c5e1e0 ] Fix a bug in commit 46ed5fc33db9, which wrongly used the func_name instead of probe_name to register legacy kprobe. Fixes: 46ed5fc33db9 ("libbpf: Refactor and simplify legacy kprobe code") Co-developed-by: Chengming Zhou Signed-off-by: Qiang Wang Signed-off-by: Chengming Zhou Signed-off-by: Andrii Nakryiko Tested-by: Hengqi Chen Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211227130713.66933-1-wangqiang.wq.frank@bytedance.com Signed-off-by: Sasha Levin --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index fd25e30e70cc2..2696f0b7f0acc 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -9769,7 +9769,7 @@ bpf_program__attach_kprobe_opts(const struct bpf_program *prog, gen_kprobe_legacy_event_name(probe_name, sizeof(probe_name), func_name, offset); - legacy_probe = strdup(func_name); + legacy_probe = strdup(probe_name); if (!legacy_probe) return libbpf_err_ptr(-ENOMEM); -- 2.34.1