Linux Trace Kernel
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Gomez <da.gomez@samsung.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Petr Pavlu <petr.pavlu@suse.com>,
	Sami Tolvanen <samitolvanen@google.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"David S. Miller" <davem@davemloft.net>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	Naveen N Rao <naveen@kernel.org>,
	linux-trace-kernel@vger.kernel.org
Subject: [PATCH v3.5 25/28] kprobes: Use RCU in all users of __module_text_address().
Date: Wed, 29 Jan 2025 09:49:25 +0100	[thread overview]
Message-ID: <20250129084925.9ppBjGLC@linutronix.de> (raw)
In-Reply-To: <20250128144452.fb5f9741e58f059c7cdf4ce9@kernel.org>

__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 <davem@davemloft.net>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Naveen N Rao <naveen@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
Update due to the collision during the merge window.

 kernel/kprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 0305692106709..9c8afbb957b0f 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1547,7 +1547,7 @@ static int check_kprobe_address_safe(struct kprobe *p,
 	/* Ensure the address is in a text area, and find a module if exists. */
 	*probed_mod = NULL;
 	if (!core_kernel_text((unsigned long) p->addr)) {
-		guard(preempt)();
+		guard(rcu)();
 		*probed_mod = __module_text_address((unsigned long) p->addr);
 		if (!(*probed_mod))
 			return -EINVAL;
-- 
2.47.2


      parent reply	other threads:[~2025-01-29  8:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250108090457.512198-1-bigeasy@linutronix.de>
2025-01-08  9:04 ` [PATCH v3 06/28] module: Use RCU in find_module_all() Sebastian Andrzej Siewior
2025-01-08  9:04 ` [PATCH v3 17/28] arm64: module: Use RCU in all users of __module_text_address() Sebastian Andrzej Siewior
2025-01-08  9:04 ` [PATCH v3 19/28] LoongArch: ftrace: " Sebastian Andrzej Siewior
2025-01-08  9:04 ` [PATCH v3 20/28] powerpc/ftrace: " Sebastian Andrzej Siewior
2025-01-20 10:09   ` Shrikanth Hegde
2025-01-08  9:04 ` [PATCH v3 25/28] bpf: " Sebastian Andrzej Siewior
2025-01-09 18:38   ` Alexei Starovoitov
2025-01-09 20:54     ` Sebastian Andrzej Siewior
2025-01-09 21:00       ` Alexei Starovoitov
2025-01-29  8:47         ` [PATCH v3.5 " Sebastian Andrzej Siewior
2025-01-08  9:04 ` [PATCH v3 26/28] kprobes: " Sebastian Andrzej Siewior
2025-01-28  5:44   ` Masami Hiramatsu
2025-01-28  7:10     ` Sebastian Andrzej Siewior
2025-01-29  8:49     ` Sebastian Andrzej Siewior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250129084925.9ppBjGLC@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=da.gomez@samsung.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=naveen@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=petr.pavlu@suse.com \
    --cc=samitolvanen@google.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox