Skip to content

Commit 074376a

Browse files
Jiri Kosinarostedt
authored andcommitted
ftrace/x86: Anotate text_mutex split between ftrace_arch_code_modify_post_process() and ftrace_arch_code_modify_prepare()
ftrace_arch_code_modify_prepare() is acquiring text_mutex, while the corresponding release is happening in ftrace_arch_code_modify_post_process(). This has already been documented in the code, but let's also make the fact that this is intentional clear to the semantic analysis tools such as sparse. Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1906292321170.27227@cbobk.fhfr.pm Fixes: 3961126 ("ftrace/x86: Add a comment to why we take text_mutex in ftrace_arch_code_modify_prepare()") Fixes: d5b844a ("ftrace/x86: Remove possible deadlock between register_kprobe() and ftrace_run_update_code()") Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 46cc0b4 commit 074376a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎arch/x86/kernel/ftrace.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#ifdef CONFIG_DYNAMIC_FTRACE
3636

3737
int ftrace_arch_code_modify_prepare(void)
38+
__acquires(&text_mutex)
3839
{
3940
/*
4041
* Need to grab text_mutex to prevent a race from module loading
@@ -48,6 +49,7 @@ int ftrace_arch_code_modify_prepare(void)
4849
}
4950

5051
int ftrace_arch_code_modify_post_process(void)
52+
__releases(&text_mutex)
5153
{
5254
set_all_modules_text_ro();
5355
set_kernel_text_ro();

0 commit comments

Comments
 (0)