stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Hou Tao <houtao1@huawei.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jiri Olsa <jolsa@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10 13/92] bpf, perf: Use subprog name when reporting subprog ksymbol
Date: Mon,  5 Dec 2022 20:09:26 +0100	[thread overview]
Message-ID: <20221205190803.936802443@linuxfoundation.org> (raw)
In-Reply-To: <20221205190803.464934752@linuxfoundation.org>

From: Hou Tao <houtao1@huawei.com>

[ Upstream commit 47df8a2f78bc34ff170d147d05b121f84e252b85 ]

Since commit bfea9a8574f3 ("bpf: Add name to struct bpf_ksym"), when
reporting subprog ksymbol to perf, prog name instead of subprog name is
used. The backtrace of bpf program with subprogs will be incorrect as
shown below:

  ffffffffc02deace bpf_prog_e44a3057dcb151f8_overwrite+0x66
  ffffffffc02de9f7 bpf_prog_e44a3057dcb151f8_overwrite+0x9f
  ffffffffa71d8d4e trace_call_bpf+0xce
  ffffffffa71c2938 perf_call_bpf_enter.isra.0+0x48

overwrite is the entry program and it invokes the overwrite_htab subprog
through bpf_loop, but in above backtrace, overwrite program just jumps
inside itself.

Fixing it by using subprog name when reporting subprog ksymbol. After
the fix, the output of perf script will be correct as shown below:

  ffffffffc031aad2 bpf_prog_37c0bec7d7c764a4_overwrite_htab+0x66
  ffffffffc031a9e7 bpf_prog_c7eb827ef4f23e71_overwrite+0x9f
  ffffffffa3dd8d4e trace_call_bpf+0xce
  ffffffffa3dc2938 perf_call_bpf_enter.isra.0+0x48

Fixes: bfea9a8574f3 ("bpf: Add name to struct bpf_ksym")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/20221114095733.158588-1-houtao@huaweicloud.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0e01216f4e5a..e9b354d521a3 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8740,7 +8740,7 @@ static void perf_event_bpf_emit_ksymbols(struct bpf_prog *prog,
 				PERF_RECORD_KSYMBOL_TYPE_BPF,
 				(u64)(unsigned long)subprog->bpf_func,
 				subprog->jited_len, unregister,
-				prog->aux->ksym.name);
+				subprog->aux->ksym.name);
 		}
 	}
 }
-- 
2.35.1




  parent reply	other threads:[~2022-12-05 19:35 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 19:09 [PATCH 5.10 00/92] 5.10.158-rc1 review Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 01/92] btrfs: sink iterator parameter to btrfs_ioctl_logical_to_ino Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 02/92] btrfs: free btrfs_path before copying inodes to userspace Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 03/92] spi: spi-imx: Fix spi_bus_clk if requested clock is higher than input clock Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 04/92] btrfs: move QUOTA_ENABLED check to rescan_should_stop from btrfs_qgroup_rescan_worker Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 05/92] drm/display/dp_mst: Fix drm_dp_mst_add_affected_dsc_crtcs() return code Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 06/92] kbuild: fix -Wimplicit-function-declaration in license_is_gpl_compatible Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 07/92] drm/amdgpu: update drm_display_info correctly when the edid is read Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 08/92] drm/amdgpu: Partially revert "drm/amdgpu: update drm_display_info correctly when the edid is read" Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 09/92] btrfs: qgroup: fix sleep from invalid context bug in btrfs_qgroup_inherit() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 10/92] iio: health: afe4403: Fix oob read in afe4403_read_raw Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 11/92] iio: health: afe4404: Fix oob read in afe4404_[read|write]_raw Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 12/92] iio: light: rpr0521: add missing Kconfig dependencies Greg Kroah-Hartman
2022-12-05 19:09 ` Greg Kroah-Hartman [this message]
2022-12-05 19:09 ` [PATCH 5.10 14/92] scripts/faddr2line: Fix regression in name resolution on ppc64le Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 15/92] ARM: at91: rm9200: fix usb device clock id Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 16/92] libbpf: Handle size overflow for ringbuf mmap Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 17/92] hwmon: (ltc2947) fix temperature scaling Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 18/92] hwmon: (ina3221) Fix shunt sum critical calculation Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 19/92] hwmon: (i5500_temp) fix missing pci_disable_device() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 20/92] hwmon: (ibmpex) Fix possible UAF when ibmpex_register_bmc() fails Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 21/92] bpf: Do not copy spin lock field from user in bpf_selem_alloc Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 22/92] of: property: decrement node refcount in of_fwnode_get_reference_args() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 23/92] ixgbevf: Fix resource leak in ixgbevf_init_module() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 24/92] i40e: Fix error handling in i40e_init_module() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 25/92] fm10k: Fix error handling in fm10k_init_module() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 26/92] iavf: remove redundant ret variable Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 27/92] iavf: Fix error handling in iavf_init_module() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 28/92] e100: switch from pci_ to dma_ API Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 29/92] e100: Fix possible use after free in e100_xmit_prepare Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 30/92] net/mlx5: Fix uninitialized variable bug in outlen_write() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 31/92] net/mlx5e: Fix use-after-free when reverting termination table Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 32/92] can: sja1000_isa: sja1000_isa_probe(): add missing free_sja1000dev() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 33/92] can: cc770: cc770_isa_probe(): add missing free_cc770dev() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 34/92] qlcnic: fix sleep-in-atomic-context bugs caused by msleep Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 35/92] aquantia: Do not purge addresses when setting the number of rings Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 36/92] wifi: cfg80211: fix buffer overflow in elem comparison Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 37/92] wifi: cfg80211: dont allow multi-BSSID in S1G Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 38/92] wifi: mac8021: fix possible oob access in ieee80211_get_rate_duration Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 39/92] net: phy: fix null-ptr-deref while probe() failed Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 40/92] net: net_netdev: Fix error handling in ntb_netdev_init_module() Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 41/92] net/9p: Fix a potential socket leak in p9_socket_open Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 42/92] net: ethernet: nixge: fix NULL dereference Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 43/92] dsa: lan9303: Correct stat name Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 44/92] tipc: re-fetch skb cb after tipc_msg_validate Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 45/92] net: hsr: Fix potential use-after-free Greg Kroah-Hartman
2022-12-05 19:09 ` [PATCH 5.10 46/92] afs: Fix fileserver probe RTT handling Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 47/92] net: tun: Fix use-after-free in tun_detach() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 48/92] packet: do not set TP_STATUS_CSUM_VALID on CHECKSUM_COMPLETE Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 49/92] sctp: fix memory leak in sctp_stream_outq_migrate() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 50/92] net: ethernet: renesas: ravb: Fix promiscuous mode after system resumed Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 51/92] hwmon: (coretemp) Check for null before removing sysfs attrs Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 52/92] hwmon: (coretemp) fix pci device refcount leak in nv1a_ram_new() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 53/92] net/mlx5: DR, Fix uninitialized var warning Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 54/92] riscv: vdso: fix section overlapping under some conditions Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 55/92] error-injection: Add prompt for function error injection Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 56/92] tools/vm/slabinfo-gnuplot: use "grep -E" instead of "egrep" Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 57/92] nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 58/92] x86/bugs: Make sure MSR_SPEC_CTRL is updated properly upon resume from S3 Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 59/92] pinctrl: intel: Save and restore pins in "direct IRQ" mode Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 60/92] net: stmmac: Set MACs flow control register to reflect current settings Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 61/92] mmc: mmc_test: Fix removal of debugfs file Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 62/92] mmc: core: Fix ambiguous TRIM and DISCARD arg Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 63/92] mmc: sdhci-esdhc-imx: correct CQHCI exit halt state check Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 64/92] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 65/92] mmc: sdhci: Fix voltage switch delay Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 66/92] drm/amdgpu: temporarily disable broken Clang builds due to blown stack-frame Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 67/92] drm/i915: Never return 0 if not all requests retired Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 68/92] tracing: Free buffers when a used dynamic event is removed Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 69/92] io_uring: dont hold uring_lock when calling io_run_task_work* Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 70/92] ASoC: ops: Fix bounds check for _sx controls Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 71/92] pinctrl: single: Fix potential division by zero Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 72/92] iommu/vt-d: Fix PCI device refcount leak in has_external_pci() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 73/92] iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 74/92] parisc: Increase size of gcc stack frame check Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 75/92] xtensa: increase " Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 76/92] parisc: Increase FRAME_WARN to 2048 bytes on parisc Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 77/92] Kconfig.debug: provide a little extra FRAME_WARN leeway when KASAN is enabled Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 78/92] selftests: net: add delete nexthop route warning test Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 79/92] selftests: net: fix nexthop warning cleanup double ip typo Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 80/92] ipv4: Handle attempt to delete multipath route when fib_info contains an nh reference Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 81/92] ipv4: Fix route deletion when nexthop info is not specified Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 82/92] Revert "tty: n_gsm: avoid call of sleeping functions from atomic context" Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 83/92] x86/tsx: Add a feature bit for TSX control MSR support Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 84/92] x86/pm: Add enumeration check before spec MSRs save/restore setup Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 85/92] i2c: npcm7xx: Fix error handling in npcm_i2c_init() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 86/92] i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 87/92] ACPI: HMAT: remove unnecessary variable initialization Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 88/92] ACPI: HMAT: Fix initiator registration for single-initiator systems Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 89/92] Revert "clocksource/drivers/riscv: Events are stopped during CPU suspend" Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 90/92] char: tpm: Protect tpm_pm_suspend with locks Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 91/92] Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send() Greg Kroah-Hartman
2022-12-05 19:10 ` [PATCH 5.10 92/92] [PATCH 5.10.y stable v2] block: unhash blkdev part inode when the part is deleted Greg Kroah-Hartman
2022-12-05 23:34 ` [PATCH 5.10 00/92] 5.10.158-rc1 review Florian Fainelli
2022-12-06  2:37 ` Shuah Khan
2022-12-06 10:24 ` Pavel Machek
2022-12-06 12:27 ` Rudi Heitbaum
2022-12-07  9:34 ` zhouzhixiu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221205190803.936802443@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=daniel@iogearbox.net \
    --cc=houtao1@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).