Commit 01d5b167 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull modules updates from Petr Pavlu:

 - Use RCU instead of RCU-sched

   The mix of rcu_read_lock(), rcu_read_lock_sched() and
   preempt_disable() in the module code and its users has
   been replaced with just rcu_read_lock()

 - The rest of changes are smaller fixes and updates

* tag 'modules-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/modules/linux: (32 commits)
  MAINTAINERS: Update the MODULE SUPPORT section
  module: Remove unnecessary size argument when calling strscpy()
  module: Replace deprecated strncpy() with strscpy()
  params: Annotate struct module_param_attrs with __counted_by()
  bug: Use RCU instead RCU-sched to protect module_bug_list.
  static_call: Use RCU in all users of __module_text_address().
  kprobes: Use RCU in all users of __module_text_address().
  bpf: Use RCU in all users of __module_text_address().
  jump_label: Use RCU in all users of __module_text_address().
  jump_label: Use RCU in all users of __module_address().
  x86: Use RCU in all users of __module_address().
  cfi: Use RCU while invoking __module_address().
  powerpc/ftrace: Use RCU in all users of __module_text_address().
  LoongArch: ftrace: Use RCU in all users of __module_text_address().
  LoongArch/orc: Use RCU in all users of __module_address().
  arm64: module: Use RCU in all users of __module_text_address().
  ARM: module: Use RCU in all users of __module_text_address().
  module: Use RCU in all users of __module_text_address().
  module: Use RCU in all users of __module_address().
  module: Use RCU in search_module_extables().
  ...
parents 7405c0f0 897c0b4e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16210,7 +16210,7 @@ F: include/dt-bindings/clock/mobileye,eyeq5-clk.h
MODULE SUPPORT
M:	Luis Chamberlain <mcgrof@kernel.org>
R:	Petr Pavlu <petr.pavlu@suse.com>
M:	Petr Pavlu <petr.pavlu@suse.com>
R:	Sami Tolvanen <samitolvanen@google.com>
R:	Daniel Gomez <da.gomez@samsung.com>
L:	linux-modules@vger.kernel.org
@@ -16221,8 +16221,10 @@ F: include/linux/kmod.h
F:	include/linux/module*.h
F:	kernel/module/
F:	lib/test_kmod.c
F:	lib/tests/module/
F:	scripts/module*
F:	tools/testing/selftests/kmod/
F:	tools/testing/selftests/module/
MONOLITHIC POWER SYSTEM PMIC DRIVER
M:	Saravanan Sekar <sravanhome@gmail.com>
+1 −3
Original line number Diff line number Diff line
@@ -285,11 +285,9 @@ bool in_module_plt(unsigned long loc)
	struct module *mod;
	bool ret;

	preempt_disable();
	guard(rcu)();
	mod = __module_text_address(loc);
	ret = mod && (loc - (u32)mod->arch.core.plt_ent < mod->arch.core.plt_count * PLT_ENT_SIZE ||
		      loc - (u32)mod->arch.init.plt_ent < mod->arch.init.plt_count * PLT_ENT_SIZE);
	preempt_enable();

	return ret;
}
+3 −4
Original line number Diff line number Diff line
@@ -320,14 +320,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))
+4 −5
Original line number Diff line number Diff line
@@ -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();
		scoped_guard(rcu)
			mod = __module_text_address(pc);
		preempt_enable();
	}

	if (WARN_ON(!mod))
+1 −3
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ bool unwind_next_frame(struct unwind_state *state)
		return false;

	/* Don't let modules unload while we're reading their ORC data. */
	preempt_disable();
	guard(rcu)();

	if (is_entry_func(state->pc))
		goto end;
@@ -514,14 +514,12 @@ bool unwind_next_frame(struct unwind_state *state)
	if (!__kernel_text_address(state->pc))
		goto err;

	preempt_enable();
	return true;

err:
	state->error = true;

end:
	preempt_enable();
	state->stack_info.type = STACK_TYPE_UNKNOWN;
	return false;
}
Loading