]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 08:56:09 +0000 (10:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 08:56:09 +0000 (10:56 +0200)
added patches:
ftrace-x86-anotate-text_mutex-split-between-ftrace_arch_code_modify_post_process-and-ftrace_arch_code_modify_prepare.patch

queue-4.19/ftrace-x86-anotate-text_mutex-split-between-ftrace_arch_code_modify_post_process-and-ftrace_arch_code_modify_prepare.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/ftrace-x86-anotate-text_mutex-split-between-ftrace_arch_code_modify_post_process-and-ftrace_arch_code_modify_prepare.patch b/queue-4.19/ftrace-x86-anotate-text_mutex-split-between-ftrace_arch_code_modify_post_process-and-ftrace_arch_code_modify_prepare.patch
new file mode 100644 (file)
index 0000000..417b9b6
--- /dev/null
@@ -0,0 +1,46 @@
+From 074376ac0e1d1fcd4fafebca86ee6158e7c20680 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Sat, 29 Jun 2019 23:22:33 +0200
+Subject: ftrace/x86: Anotate text_mutex split between ftrace_arch_code_modify_post_process() and ftrace_arch_code_modify_prepare()
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 074376ac0e1d1fcd4fafebca86ee6158e7c20680 upstream.
+
+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: 39611265edc1a ("ftrace/x86: Add a comment to why we take text_mutex in ftrace_arch_code_modify_prepare()")
+Fixes: d5b844a2cf507 ("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>
+Cc: Guenter Roeck <linux@roeck-us.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/ftrace.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/x86/kernel/ftrace.c
++++ b/arch/x86/kernel/ftrace.c
+@@ -35,6 +35,7 @@
+ #ifdef CONFIG_DYNAMIC_FTRACE
+ int ftrace_arch_code_modify_prepare(void)
++    __acquires(&text_mutex)
+ {
+       mutex_lock(&text_mutex);
+       set_kernel_text_rw();
+@@ -43,6 +44,7 @@ int ftrace_arch_code_modify_prepare(void
+ }
+ int ftrace_arch_code_modify_post_process(void)
++    __releases(&text_mutex)
+ {
+       set_all_modules_text_ro();
+       set_kernel_text_ro();
index cfced52936b02bee28f749675aa6387b592b72e7..2f60942fd1182166ee000114b9214e69ad213476 100644 (file)
@@ -43,3 +43,4 @@ scsi-ipr-fix-softlockup-when-rescanning-devices-in-p.patch
 mac80211-do-not-send-mesh-hwmp-preq-if-hwmp-is-disab.patch
 dpaa_eth-remove-unnecessary-boolean-expression-in-dp.patch
 sxgbe-fix-off-by-one-in-samsung-driver-strncpy-size-.patch
+ftrace-x86-anotate-text_mutex-split-between-ftrace_arch_code_modify_post_process-and-ftrace_arch_code_modify_prepare.patch