s change, and the code still executes under the same locking (`ftrace_lock`, `text_mutex` when the arch overrides `ftrace_arch_code_modify_prepare()`), so the risk of regression is minimal: the new call simply yields CPU if needed while keeping the locks held, preventing watchdog-induced crashes but otherwise behaving identically. Given it fixes a real, user-visible soft lockup with a contained and well-understood tweak, this is an excellent candidate for stable backporting. kernel/trace/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index a69067367c296..42bd2ba68a821 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -7535,6 +7535,8 @@ void ftrace_module_enable(struct module *mod) if (!within_module(rec->ip, mod)) break; + cond_resched(); + /* Weak functions should still be ignored */ if (!test_for_valid_rec(rec)) { /* Clear all other flags. Should not be enabled anyway */ -- 2.51.0[PATCH AUTOSEL 6.17-6.1] ftrace: Fix softlockup in ftrace_module_enableSasha Levin undefinedpatches@lists.linux.dev, stable@vger.kernel.org undefined undefined undefined undefined undefined undefined undefined‹1ƒÆ'