-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'trace-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/ker…
…nel/git/rostedt/linux-trace Pull ftrace fixes from Steven Rostedt: "There's been a few memory issues found with ftrace. One was simply a memory leak where not all was being freed that should have been in releasing a file pointer on set_graph_function. Then Thomas found that the ftrace trampolines were marked for read/write as well as execute. To shrink the possible attack surface, he added calls to set them to ro. Which also uncovered some other issues with freeing module allocated memory that had its permissions changed. Kprobes had a similar issue which is fixed and a selftest was added to trigger that issue again" * tag 'trace-v4.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: x86/ftrace: Make sure that ftrace trampolines are not RWX x86/mm/ftrace: Do not bug in early boot on irqs_disabled in cpu_flush_range() selftests/ftrace: Add a testcase for many kprobe events kprobes/x86: Fix to set RWX bits correctly before releasing trampoline ftrace: Fix memory leak in ftrace_graph_release()
- Loading branch information
Showing
6 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# description: Register/unregister many kprobe events | ||
|
||
# ftrace fentry skip size depends on the machine architecture. | ||
# Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc | ||
case `uname -m` in | ||
x86_64|i[3456]86) OFFS=5;; | ||
ppc*) OFFS=4;; | ||
*) OFFS=0;; | ||
esac | ||
|
||
echo "Setup up to 256 kprobes" | ||
grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \ | ||
head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||: | ||
|
||
echo 1 > events/kprobes/enable | ||
echo 0 > events/kprobes/enable | ||
echo > kprobe_events | ||
echo "Waiting for unoptimizing & freeing" | ||
sleep 5 | ||
echo "Done" |