diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-05-17 10:19:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-25 14:30:17 +0200 |
commit | 6384f782a69cf93a8a59322e1b6cf29f27fa0c8f (patch) | |
tree | 0abb8a898c15a5ad1ad7fd8f4ca7741e2c83f78c /kernel/smp.c | |
parent | d5fb96b955ff53e31f8d83553e28510a6e5cb90b (diff) | |
download | linux-stable-6384f782a69cf93a8a59322e1b6cf29f27fa0c8f.tar.gz linux-stable-6384f782a69cf93a8a59322e1b6cf29f27fa0c8f.tar.bz2 linux-stable-6384f782a69cf93a8a59322e1b6cf29f27fa0c8f.zip |
tracing/kprobes: Enforce kprobes teardown after testing
commit 30e7d894c1478c88d50ce94ddcdbd7f9763d9cdd upstream.
Enabling the tracer selftest triggers occasionally the warning in
text_poke(), which warns when the to be modified page is not marked
reserved.
The reason is that the tracer selftest installs kprobes on functions marked
__init for testing. These probes are removed after the tests, but that
removal schedules the delayed kprobes_optimizer work, which will do the
actual text poke. If the work is executed after the init text is freed,
then the warning triggers. The bug can be reproduced reliably when the work
delay is increased.
Flush the optimizer work and wait for the optimizing/unoptimizing lists to
become empty before returning from the kprobes tracer selftest. That
ensures that all operations which were queued due to the probes removal
have completed.
Link: http://lkml.kernel.org/r/20170516094802.76a468bb@gandalf.local.home
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Fixes: 6274de498 ("kprobes: Support delayed unoptimizing")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/smp.c')
0 files changed, 0 insertions, 0 deletions