]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace/x86: Add a comment to why we take text_mutex in ftrace_arch_code_modify_prepare()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 28 Jun 2019 01:18:19 +0000 (21:18 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 28 Jun 2019 18:21:25 +0000 (14:21 -0400)
commite89013c68bbf73e4a2a139cfe30312d672e04d25
tree5a2fb0590d8da026037129d73500754edceedbc8
parent9301e5ef4b12a5405f7bb2b6dab4dac2bf603f70
ftrace/x86: Add a comment to why we take text_mutex in ftrace_arch_code_modify_prepare()

Taking the text_mutex in ftrace_arch_code_modify_prepare() is to fix a
race against module loading and live kernel patching that might try to
change the text permissions while ftrace has it as read/write. This
really needs to be documented in the code. Add a comment that does such.

Link: http://lkml.kernel.org/r/20190627211819.5a591f52@gandalf.local.home
Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/x86/kernel/ftrace.c