Skip to contentSkip to conversation

perf events fix

GIT PULL Merged Ingo Molnar 2 participants 2 messages Oct 14, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest perf/urgent git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2023-10-14

# HEAD: e53899771a02f798d436655efbd9d4b46c0f9265 perf/x86/lbr: Filter vsyscall addresses

Fix an LBR sampling bug.

Thanks,

Ingo

------------------>
JP Kobryn (1):
perf/x86/lbr: Filter vsyscall addresses

 arch/x86/events/utils.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/events/utils.c +3 -2
index 76b1f8bb0fd5..dab4ed199227 100644
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <asm/insn.h>
+#include <linux/mm.h>
 
 #include "perf_event.h"
 
@@ -132,9 +133,9 @@ static int get_branch_type(unsigned long from, unsigned long to, int abort,
 		 * The LBR logs any address in the IP, even if the IP just
 		 * faulted. This means userspace can control the from address.
 		 * Ensure we don't blindly read any address by validating it is
-		 * a known text address.
+		 * a known text address and not a vsyscall address.
 		 */
-		if (kernel_text_address(from)) {
+		if (kernel_text_address(from) && !in_gate_area_no_mm(from)) {
 			addr = (void *)from;
 			/*
 			 * Assume we can get the maximum possible size
merge bot Merged
#1 lore raw
The pull request you sent on Sat, 14 Oct 2023 23:58:11 +0200:

The pull request you sent on Sat, 14 Oct 2023 23:58:11 +0200:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2023-10-14

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/23931d935363846a9b39a890d4aead208cd46681

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html