Skip to contentSkip to conversation

Patch "perf event: Check ref_reloc_sym before using it" has been added to the 4.19-stable tree

PATCH [email protected] 1 participant 1 message Nov 25, 2020 perf events

lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

perf event: Check ref_reloc_sym before using it

to the 4.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
perf-event-check-ref_reloc_sym-before-using-it.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From e9a6882f267a8105461066e3ea6b4b6b9be1b807 Mon Sep 17 00:00:00 2001
From: Igor Lubashev <[email protected]>
Date: Mon, 26 Aug 2019 21:39:12 -0400
Subject: perf event: Check ref_reloc_sym before using it

From: Igor Lubashev <[email protected]>

commit e9a6882f267a8105461066e3ea6b4b6b9be1b807 upstream.

Check for ref_reloc_sym before using it instead of checking symbol_conf.kptr_restrict and relying solely on that check.

---
 tools/perf/util/event.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
tools/perf/util/event.c +4 -3
@@ -912,11 +912,13 @@ static int __perf_event__synthesize_kern
 	int err;
 	union perf_event *event;
 
-	if (symbol_conf.kptr_restrict)
-		return -1;
 	if (map == NULL)
 		return -1;
 
+	kmap = map__kmap(map);
+	if (!kmap->ref_reloc_sym)
+		return -1;
+
 	/*
 	 * We should get this from /sys/kernel/sections/.text, but till that is
 	 * available use this, and after it is use this as a fallback for older
@@ -939,7 +941,6 @@ static int __perf_event__synthesize_kern
 		event->header.misc = PERF_RECORD_MISC_GUEST_KERNEL;
 	}
 
-	kmap = map__kmap(map);
 	size = snprintf(event->mmap.filename, sizeof(event->mmap.filename),
 			"%s%s", machine->mmap_name, kmap->ref_reloc_sym->name) + 1;
 	size = PERF_ALIGN(size, sizeof(u64));

Patches currently in stable-queue which might be from [email protected] are

queue-4.19/perf-event-check-ref_reloc_sym-before-using-it.patch

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel