Unverified Commit 6c342b86 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5820 [sync] PR-5789: perf/x86/lbr: Filter vsyscall addresses

parents 95f52358 325885a8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include <asm/perf_event.h>
#include <asm/msr.h>
#include <asm/insn.h>
#include <linux/mm.h>

#include "../perf_event.h"

@@ -1223,9 +1224,9 @@ static int 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 blindy 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