From patchwork Wed Jan 8 09:04:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930367 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 598031F2C44; Wed, 8 Jan 2025 09:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327121; cv=none; b=bIeAsXKU+YXIVhiqbM6yR46U+o1S4YYVRUUL7iAu7mvNdDNMze4PjjWNiuKMnpiCBErhWAOyyo4YilFcA2YRsNZT75nJvniaTSrZ/U0O0C0kuHVtbO9w+ViNvoSNStkBoMys2+2EcxFlJyP71hMDg7usE6alQy8jeFqPshRzHHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327121; c=relaxed/simple; bh=Lq/578psMJ7xGA1MC6Fb72suiu4e26yPqzxxiBL1vRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZQ6J+OE1EKKp6Y1bSGh8PPcqzwm9me6iCxGmLcu1iB6hRe9nzKp+hTuAi7mQ1KGUdilcEI89obq1fQDsm8DgTheDsu3tZZkIQ1r72YzwKbCA/NL0Z8Rx03dXL+FoP6hSv517VQkSak2kpLmwpdmEAB40TO+OAteeVdKoL60XoZI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2NWsnHYD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Radbmlg1; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2NWsnHYD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Radbmlg1" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dl0IiwCR3ilXTxBcYNupLq7U5e515iyR9fTpq03YpK4=; b=2NWsnHYDRTA58xM51vdPnzxpA853qVzlsE3h/6QMdiUM154kZ1qtsE9Baes12JWw9zjDuu BeV/u9cBOxSnL5UudUvnUo6+yeMx1dABdZFshGHI1d8fU7UUT6oLxrg6uYdRjIwOLiqsoL k+TalvqwOpDLOztEh7YN1xQK6J5Km/hYXGdRa93tjUcTZ+hzCyjtr5izfR+CPTn4w4r2A1 99raKF2o0NaeXyGImTxR9us6yKdPLyT1WhPmkImJ04m3JVCgB0Icq13a8BesDEkFb1Fp/j Dw4RJVls2P+HyyFsrAdoSA8oJ2yVrzAkiQ+bD7yyPmrzcnhW01bjdjSqOcYdFQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327115; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dl0IiwCR3ilXTxBcYNupLq7U5e515iyR9fTpq03YpK4=; b=Radbmlg1VcUiFOGoj9wk5Vae7DRGB0WrW/kGlDYZe4YpKonGZXcr6qdzDK4LWmM/K4Ge8v V6azuNKTwTBmCuBw== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , Jiri Kosina , Joe Lawrence , Josh Poimboeuf , Masami Hiramatsu , Mathieu Desnoyers , Miroslav Benes , Petr Mladek , Steven Rostedt , linux-trace-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: [PATCH v3 06/28] module: Use RCU in find_module_all(). Date: Wed, 8 Jan 2025 10:04:35 +0100 Message-ID: <20250108090457.512198-7-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The modules list and module::kallsyms can be accessed under RCU assumption. Remove module_assert_mutex_or_preempt() from find_module_all() so it can be used under RCU protection without warnings. Update its callers to use RCU protection instead of preempt_disable(). Cc: Jiri Kosina Cc: Joe Lawrence Cc: Josh Poimboeuf Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Miroslav Benes Cc: Petr Mladek Cc: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org Cc: live-patching@vger.kernel.org Reviewed-by: Petr Mladek Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- include/linux/module.h | 2 +- kernel/livepatch/core.c | 4 +--- kernel/module/kallsyms.c | 1 + kernel/module/main.c | 6 ++---- kernel/trace/trace_kprobe.c | 9 +++------ 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index 94acbacdcdf18..5c1f7ea76c8cb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -663,7 +663,7 @@ static inline bool within_module(unsigned long addr, const struct module *mod) return within_module_init(addr, mod) || within_module_core(addr, mod); } -/* Search for module by name: must be in a RCU-sched critical section. */ +/* Search for module by name: must be in a RCU critical section. */ struct module *find_module(const char *name); extern void __noreturn __module_put_and_kthread_exit(struct module *mod, diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 3c21c31796db0..f8932c63b08e3 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -59,7 +59,7 @@ static void klp_find_object_module(struct klp_object *obj) if (!klp_is_module(obj)) return; - rcu_read_lock_sched(); + guard(rcu)(); /* * We do not want to block removal of patched modules and therefore * we do not take a reference here. The patches are removed by @@ -75,8 +75,6 @@ static void klp_find_object_module(struct klp_object *obj) */ if (mod && mod->klp_alive) obj->mod = mod; - - rcu_read_unlock_sched(); } static bool klp_initialized(void) diff --git a/kernel/module/kallsyms.c b/kernel/module/kallsyms.c index 4eef518204eb5..3cba9f933b24f 100644 --- a/kernel/module/kallsyms.c +++ b/kernel/module/kallsyms.c @@ -450,6 +450,7 @@ unsigned long module_kallsyms_lookup_name(const char *name) unsigned long ret; /* Don't lock: we're in enough trouble already. */ + guard(rcu)(); preempt_disable(); ret = __module_kallsyms_lookup_name(name); preempt_enable(); diff --git a/kernel/module/main.c b/kernel/module/main.c index 5cce4a92d7ba3..5aa56ec8e203e 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -374,16 +374,14 @@ bool find_symbol(struct find_symbol_arg *fsa) } /* - * Search for module by name: must hold module_mutex (or preempt disabled - * for read-only access). + * Search for module by name: must hold module_mutex (or RCU for read-only + * access). */ struct module *find_module_all(const char *name, size_t len, bool even_unformed) { struct module *mod; - module_assert_mutex_or_preempt(); - list_for_each_entry_rcu(mod, &modules, list, lockdep_is_held(&module_mutex)) { if (!even_unformed && mod->state == MODULE_STATE_UNFORMED) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 935a886af40c9..37ff78ee17fe0 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -123,9 +123,8 @@ static nokprobe_inline bool trace_kprobe_module_exist(struct trace_kprobe *tk) if (!p) return true; *p = '\0'; - rcu_read_lock_sched(); - ret = !!find_module(tk->symbol); - rcu_read_unlock_sched(); + scoped_guard(rcu) + ret = !!find_module(tk->symbol); *p = ':'; return ret; @@ -800,12 +799,10 @@ static struct module *try_module_get_by_name(const char *name) { struct module *mod; - rcu_read_lock_sched(); + guard(rcu)(); mod = find_module(name); if (mod && !try_module_get(mod)) mod = NULL; - rcu_read_unlock_sched(); - return mod; } #else From patchwork Wed Jan 8 09:04:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930368 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C72A1F76D7; Wed, 8 Jan 2025 09:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327124; cv=none; b=pIIC48rWaFmNTHY1VYrXkfcsEpXcuAxL5T1DXLBbxXP1GQeZRn59sXKYO2mzmHdMKIs54lP+jBh5WitCbP0YhUvPrN+8WQkqG7nVi3GArt+90RbqKeW3K3vSCrwePLDuoT7skzrgsFrksrrHRCBLe34ouOtnpAoiyUEPhGnHgro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327124; c=relaxed/simple; bh=xNkHK5skl0w0C9lJamZwTCTHZMhBReuD0NcedcOei+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mj5POqZflDGbKm4gSILhemyMgtjlHZXM4iipaKSNPFj91yg0hVXzubNVNTAw2+LCAiowphN5a4YjSmY24D+km60TiauhU7EaGh7FgDsBz/6er9/9TPegeedeNyqItFZnVjpKCXHYDc8uNi47/LqUrBvno5S1MJi1QtbKgz0yg9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qZGqUNiL; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JhnK0Yu4; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qZGqUNiL"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JhnK0Yu4" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=luYbbdZNCAXl/IP2EISod9yvpOfM235A0wCO9dfQi8c=; b=qZGqUNiLevk3ULvmOAgodsKpMRTtpdv6zZ5qUtcVO8ZwmriORfqt+BAiiwnzpFb4pj7wGJ qqIrEs42Lod/4DpYI4l0IL434kVxZV3x+XaZ3TbpdcrNBYRR4lP0VEUHk8ZUzgfPd+3/MO a+FI63LXtZjf0rHQ5aK2L0M0T1UZOb4GeqtD3Y5HvX3pJKhuimEoUeA/AhEZjRj0pYyfL5 +amDJ/rpmcycJ3/zeQNMje5n0Xnql5aGiTx6ld96PiO6RPYSW/AGgTbzc8k2h7yTa2mj4E k9ofqTkV3//mwiIDmmTC20MOYsAaVNPdrp5VNOXL6tRR872cXmzwLhnKHPnm7Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=luYbbdZNCAXl/IP2EISod9yvpOfM235A0wCO9dfQi8c=; b=JhnK0Yu4bXTsTOoq/2QpxdG2IUFKpBcbjrCKe3W7xFQhlFCjP6V59gChgnIT16k/VUPy28 I8OAkeg4E0fvk/Cw== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , Catalin Marinas , Mark Rutland , Masami Hiramatsu , Steven Rostedt , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v3 17/28] arm64: module: Use RCU in all users of __module_text_address(). Date: Wed, 8 Jan 2025 10:04:46 +0100 Message-ID: <20250108090457.512198-18-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 __module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Catalin Marinas Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Steven Rostedt Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-trace-kernel@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- arch/arm64/kernel/ftrace.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index 245cb419ca24d..2b76939b6304f 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftrace.c @@ -257,14 +257,13 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec, * dealing with an out-of-range condition, we can assume it * is due to a module being loaded far away from the kernel. * - * NOTE: __module_text_address() must be called with preemption - * disabled, but we can rely on ftrace_lock to ensure that 'mod' + * NOTE: __module_text_address() must be called within a RCU read + * section, but we can rely on ftrace_lock to ensure that 'mod' * retains its validity throughout the remainder of this code. */ if (!mod) { - preempt_disable(); + guard(rcu)(); mod = __module_text_address(pc); - preempt_enable(); } if (WARN_ON(!mod)) From patchwork Wed Jan 8 09:04:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930369 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 730D01F8900; Wed, 8 Jan 2025 09:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327125; cv=none; b=BfCV/+1vj/5O2IFUQ7S0SKYt5xHXC/cJPwC8zFFzKrzMGYAh54z0yZw08LiVIr+Rpcp4XEQtEsBHyYwbuTge3fC4IBu8Y278+GQZ2e5L18RRQrnbJr7aQeD7k8HxrFIMR0nMOLm/7fDwlaWeaMcCTQR7ZddBjCKVrKtdv6lyR1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327125; c=relaxed/simple; bh=JMLSIq4XCqh7X46oF8dvRjupa8G10AN+Bi4dbH6ayzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GljypC4TMdKHbQUTy+Ymfk1eWANd3ShyWh8TYQFMPojM1h/uB7i/a5nizrvj+rZDz+xNV6x0TunaOIDv6Ho+y7KP7sN1CF3aumtxra0DIeUk88UXRLH84g8q2nzQg2bDFg/WaDROYQryErDbOfNPCJ4mAurOyNk4w+IYEqX6wII= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Zeq82ZZt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=o9rVqG6g; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Zeq82ZZt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="o9rVqG6g" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dKkEa1oBjIwyFreZFvtbWG1WNxqNuZKzuLQp9IQamCY=; b=Zeq82ZZtfycF+dEkhvnQG4m5Gm/Dg336iRPpNCa0jIIynUDK44CLaWcEHM91iLvvyVeDwf NRZdcAl0pca++p4iXsTy1ATeNGWQ0/ttOEarFzUqIaQLSXgLGkLjRtrObC8AUsP16pSHl4 A93Z/xemaCJmcGKVUSTlDyAxp1RGB7VdiBSnn73ZwFXLJl+ggc+UB38zEeybmelfsR82Oh lBe0gsu3NkVEDGFh4ak12MI1+L1bJg2JybDwqVktkHEJnrLbMEebPLUZRv7A1tv5z9QURT rDyhVxLNQiChLewieqy0QvpLZv1OhExoOvlkAfkAIZqeAI6F196664v7KmzUdA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dKkEa1oBjIwyFreZFvtbWG1WNxqNuZKzuLQp9IQamCY=; b=o9rVqG6g7PSN1elXM/7opz1M1ZZG8+lypfGps76VIls8huRnp2KWGJw/AyhZ6XhIyzGHkr 7w4eXU89djJIcTAg== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , Huacai Chen , Mark Rutland , Masami Hiramatsu , Steven Rostedt , WANG Xuerui , linux-trace-kernel@vger.kernel.org, loongarch@lists.linux.dev Subject: [PATCH v3 19/28] LoongArch: ftrace: Use RCU in all users of __module_text_address(). Date: Wed, 8 Jan 2025 10:04:48 +0100 Message-ID: <20250108090457.512198-20-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 __module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Huacai Chen Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Steven Rostedt Cc: WANG Xuerui Cc: linux-trace-kernel@vger.kernel.org Cc: loongarch@lists.linux.dev Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- arch/loongarch/kernel/ftrace_dyn.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/loongarch/kernel/ftrace_dyn.c b/arch/loongarch/kernel/ftrace_dyn.c index 18056229e22e4..5b7b8ac13e350 100644 --- a/arch/loongarch/kernel/ftrace_dyn.c +++ b/arch/loongarch/kernel/ftrace_dyn.c @@ -85,14 +85,13 @@ static bool ftrace_find_callable_addr(struct dyn_ftrace *rec, struct module *mod * dealing with an out-of-range condition, we can assume it * is due to a module being loaded far away from the kernel. * - * NOTE: __module_text_address() must be called with preemption - * disabled, but we can rely on ftrace_lock to ensure that 'mod' + * NOTE: __module_text_address() must be called within a RCU read + * section, but we can rely on ftrace_lock to ensure that 'mod' * retains its validity throughout the remainder of this code. */ if (!mod) { - preempt_disable(); - mod = __module_text_address(pc); - preempt_enable(); + scoped_guard(rcu) + mod = __module_text_address(pc); } if (WARN_ON(!mod)) From patchwork Wed Jan 8 09:04:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930370 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6B121F8924; Wed, 8 Jan 2025 09:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327126; cv=none; b=Una/u4/wkoQ5IlhP4eFl9bhu8do5aDb5y3MelpiRxbS7IMXgPrcP9E1vios2tN7/Y77xU8cKBm/UUUDHOl1mKx3tUskDhQ/e2kpsoPXRiIAsOpIZAsvRChGNIdUEG2d0jNjvh69GpfBvsCGJ4xXZoGTzZVb8uVc9BgxTXW6fBS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327126; c=relaxed/simple; bh=QLtectwvLpXIdURiO0vN4A+c/rzqgAPwxEpJeUhAO7U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EklHxS1vUdjh1goZQQbjoamthwrsaPyU26yr9Jm2uUFi3haQQPeggnHZuAhdIA6Uag8drmXUvHe+mMajDBdbdzOc131r2LCTFmWb9iSEIEwy0uSToRPj6AVE3PnIgXRwKVw2/3smSQ0j/mztzS7+AqZNPWUp85+ObIMRQ02uz1s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LEApxjYZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dKYJumFF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LEApxjYZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dKYJumFF" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rwBYB6GDGtwSo0ZVmHQeUUNLy015tLjU3w/e5JgGy/c=; b=LEApxjYZTkhUm30+CjLuvcHX5E2bkNJXnvyUNg8o7S/Fx61HuGetUOphWXxK7KkRlZqXpf HIajKikSPhM8iYZN10EyVeaIzc72/iuTnHo0mHHluGSqAyHpEEYIRDomEhG9ucd0bA5QNe mRPhhSVD5Mw3kKlEi3iLDkgTEd9R0q6Yh3r6PhO3zt9soyTkYfj7cbuQJvgsCtqdXTTnlw ziHMU5S1znSAkYMIhcFJfJmVQN6bapUF4Om3FT+TXqop0bh27OgxrqxKTt84hR6nd7BVvF tLQEVolIS16851bhceciMfsJOItqvtrr+VnjFSLqFCRl5W7HJYyANETR5/2Arw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rwBYB6GDGtwSo0ZVmHQeUUNLy015tLjU3w/e5JgGy/c=; b=dKYJumFF1zyEaO2G91SGXq3IYr7DTmPO/R3ooBrOdSFGUIexbJ7PDdRkr4PzJr+nPMoUvE ybGJf41RElFb2sDA== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , Christophe Leroy , Madhavan Srinivasan , Mark Rutland , Masami Hiramatsu , Michael Ellerman , Naveen N Rao , Nicholas Piggin , Steven Rostedt , linux-trace-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v3 20/28] powerpc/ftrace: Use RCU in all users of __module_text_address(). Date: Wed, 8 Jan 2025 10:04:49 +0100 Message-ID: <20250108090457.512198-21-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 __module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: Christophe Leroy Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Michael Ellerman Cc: Naveen N Rao Cc: Nicholas Piggin Cc: Steven Rostedt Cc: linux-trace-kernel@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Tested-by: Shrikanth Hegde --- arch/powerpc/kernel/trace/ftrace.c | 6 ++---- arch/powerpc/kernel/trace/ftrace_64_pg.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 5ccd791761e8f..558d7f4e4bea6 100644 --- a/arch/powerpc/kernel/trace/ftrace.c +++ b/arch/powerpc/kernel/trace/ftrace.c @@ -115,10 +115,8 @@ static unsigned long ftrace_lookup_module_stub(unsigned long ip, unsigned long a { struct module *mod = NULL; - preempt_disable(); - mod = __module_text_address(ip); - preempt_enable(); - + scoped_guard(rcu) + mod = __module_text_address(ip); if (!mod) pr_err("No module loaded at addr=%lx\n", ip); diff --git a/arch/powerpc/kernel/trace/ftrace_64_pg.c b/arch/powerpc/kernel/trace/ftrace_64_pg.c index 98787376eb87c..531d40f10c8a1 100644 --- a/arch/powerpc/kernel/trace/ftrace_64_pg.c +++ b/arch/powerpc/kernel/trace/ftrace_64_pg.c @@ -120,10 +120,8 @@ static struct module *ftrace_lookup_module(struct dyn_ftrace *rec) { struct module *mod; - preempt_disable(); - mod = __module_text_address(rec->ip); - preempt_enable(); - + scoped_guard(rcu) + mod = __module_text_address(rec->ip); if (!mod) pr_err("No module loaded at addr=%lx\n", rec->ip); From patchwork Wed Jan 8 09:04:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930371 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 307761F9420; Wed, 8 Jan 2025 09:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327128; cv=none; b=gtO8456BIoKB8MfFGnXFgh/MD8pifedZY0NvLjdYPrwYs/WIPnYK4FJPi5+jXNaAW5WTV+ViM9KnFrXBBL3/d8oyEOZp4XMVnpjoCwrkoYBM8c1U35N1LaxztsAnQ25MCUwZQUWY/PKxxE7HOPUML3y5GJHu4vfS9kSrg/I/b5k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327128; c=relaxed/simple; bh=Rfno/WDBaQo6Megi5n9CLWuW+Sf5W7R4mY0Et7Ub/lI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WMYzjwuoNmJyU+XpLsWNpZx3IEhLvlOWTFKZBHJ37ZjreyakRmIM44cduHc2r3cty5PSKzvwgvxzKBzQ4J70wZP46KxEUb9WXBtII66UfeFR7pJgY94yy+TAVwzCqLBJN7SuxhLl+CBRV8nC3tJ0vh+n1hyrZP2+nXx1qc+GDcM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=OlQxyPTc; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Pi0E5pkC; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="OlQxyPTc"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Pi0E5pkC" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aWZxQxOJaEGd9SElXjI4Z9tZyIiipQdtqCaCraspLAk=; b=OlQxyPTc4KXCBeZGT3TJa+bbkReub6yPnM2lqBeJYit76X+ZTMq2yA0QoY08+401skoxFX dYJ40n67dA+bywAEOToIEQlia/tRRCRY8AbYUF7kOK5dgWaih7fk9FejvNIjyGgDX/rkYS fZCnagS96iMzk5UG0V+o/n5m7OGktAptW2Uhze9UoCeKXif7Csjsohks9L1nt6Zi0Bi0uR Skw19b5vmyf7Fk/A6MPJM4Zs4OpVPjdt5+xI+/8/7gh5esgz0OslIDcPrgbTRWeDurLemF O9SxQ7WM65wZHD2m54kgPfWgHyupWGbr3mY+3/23khr8bWuCp8a6bkqx2y7Y9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aWZxQxOJaEGd9SElXjI4Z9tZyIiipQdtqCaCraspLAk=; b=Pi0E5pkCHo/POaYqtA2D8zPpOtGjm4FDBWb3u3Jd9uYvwb5+wePI0na9fXkwzIO4roKQ81 vwjUMv0cYkSEvMDg== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Eduard Zingerman , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Masami Hiramatsu , Mathieu Desnoyers , Matt Bobrowski , Song Liu , Stanislav Fomichev , Steven Rostedt , Yonghong Song , bpf@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v3 25/28] bpf: Use RCU in all users of __module_text_address(). Date: Wed, 8 Jan 2025 10:04:54 +0100 Message-ID: <20250108090457.512198-26-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 __module_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_address() with RCU. Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Eduard Zingerman Cc: Hao Luo Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Martin KaFai Lau Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Cc: Matt Bobrowski Cc: Song Liu Cc: Stanislav Fomichev Cc: Steven Rostedt Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Acked-by: Alexei Starovoitov --- kernel/trace/bpf_trace.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 1b8db5aee9d38..020df7b6ff90c 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -2336,10 +2336,9 @@ void bpf_put_raw_tracepoint(struct bpf_raw_event_map *btp) { struct module *mod; - preempt_disable(); + guard(rcu)(); mod = __module_address((unsigned long)btp); module_put(mod); - preempt_enable(); } static __always_inline @@ -2907,16 +2906,14 @@ static int get_modules_for_addrs(struct module ***mods, unsigned long *addrs, u3 for (i = 0; i < addrs_cnt; i++) { struct module *mod; - preempt_disable(); - mod = __module_address(addrs[i]); - /* Either no module or we it's already stored */ - if (!mod || has_module(&arr, mod)) { - preempt_enable(); - continue; + scoped_guard(rcu) { + mod = __module_address(addrs[i]); + /* Either no module or we it's already stored */ + if (!mod || has_module(&arr, mod)) + continue; + if (!try_module_get(mod)) + err = -EINVAL; } - if (!try_module_get(mod)) - err = -EINVAL; - preempt_enable(); if (err) break; err = add_module(&arr, mod); From patchwork Wed Jan 8 09:04:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 13930372 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA87E1F9F64; Wed, 8 Jan 2025 09:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327129; cv=none; b=nSDexZm1ANaz3f9MqqPBXdvoTlysxhCGD2gIns59sqaFjNPE3hxHnvypWwuS/xifV3kJqIyGngqhTKOnO0l1FxUscZ76xtXVaCQ6OAEmE+tW6OOAXfnEQJYs3bfknig7xgsh+dtOh5l+xohxTLrU7WDNPOu78wSfWTV5X4uOr9A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736327129; c=relaxed/simple; bh=zhuCTsrhq1sNrdJmokFlAoIEp1UlB8V4GeZJTffN1ts=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BUC8DgVu/KapgBzlnnR02PNx7VM27+OZQ1AYJUn/mUm53Tv2E82pnqKlPNInSs3gkaEG1rFzZJ3IuoJNhTZcuyXVWFWzYisZU7wL5uljj3S+nRHCbWVZg/EVkHAW4FZKKtZD2CKFu/YKRXWLCjp3PIhDQo+TWVcBBzYQ+GySUoY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=kZCak5YE; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cN/CNFCB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="kZCak5YE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cN/CNFCB" From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1736327124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VX0vljVHwWLPf6RRFuZ5ON1QvJx256zYGCAz24C+oI8=; b=kZCak5YES3w/CPS981gos2Cz1VvOvyEDTa+/ua2GkecyY2LbWcSr52H9Q3Vo3eDRBkgO2F 7qRqZn9GBRZOXpBIeikBTqwBhbEYqYw+OQ/Wb5JW8wbpwZfgfRX8y7wSOXIkJNqmfEZAaB 2zdBrO7hM7PuXbRg49MKpyWjJLYEmx0IRbM9R6D9LKfMaWfmYvtXFNeMWpSvzyV6rFlVTR 0pvLewAQZN0GcNJsZQ42vnwYQNMT2b93+IjaDepIVo050iVG1uR/kN2JOjqNEJ2ukjH091 6DC8fhtjbqnwcQhWI2WQOiz8kKGNheNdOA+x4O3mRu8nOgqkfZpIGjZkuGQmrQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1736327124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VX0vljVHwWLPf6RRFuZ5ON1QvJx256zYGCAz24C+oI8=; b=cN/CNFCBJOLmcq/uSXT6xcI9WzcQe8fkL1ve5n6I/VoNQPGKWOJpjQcPHxg0GJIaJxbT+M Jg4LK4/ad0fzs0Dw== To: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Daniel Gomez , Luis Chamberlain , "Paul E . McKenney" , Peter Zijlstra , Petr Pavlu , Sami Tolvanen , Thomas Gleixner , Sebastian Andrzej Siewior , "David S. Miller" , Anil S Keshavamurthy , Masami Hiramatsu , Naveen N Rao , linux-trace-kernel@vger.kernel.org Subject: [PATCH v3 26/28] kprobes: Use RCU in all users of __module_text_address(). Date: Wed, 8 Jan 2025 10:04:55 +0100 Message-ID: <20250108090457.512198-27-bigeasy@linutronix.de> In-Reply-To: <20250108090457.512198-1-bigeasy@linutronix.de> References: <20250108090457.512198-1-bigeasy@linutronix.de> Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 __module_text_address() can be invoked within a RCU section, there is no requirement to have preemption disabled. Replace the preempt_disable() section around __module_text_address() with RCU. Cc: David S. Miller Cc: Anil S Keshavamurthy Cc: Masami Hiramatsu Cc: Naveen N Rao Cc: linux-trace-kernel@vger.kernel.org Acked-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior --- kernel/kprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/kprobes.c b/kernel/kprobes.c index b027a4030976a..22e47a27df4aa 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c @@ -1566,7 +1566,7 @@ static int check_kprobe_address_safe(struct kprobe *p, if (ret) return ret; jump_label_lock(); - preempt_disable(); + rcu_read_lock(); /* Ensure the address is in a text area, and find a module if exists. */ *probed_mod = NULL; @@ -1612,7 +1612,7 @@ static int check_kprobe_address_safe(struct kprobe *p, } out: - preempt_enable(); + rcu_read_unlock(); jump_label_unlock(); return ret;