void set_module_sig_enforced(void);
-void *__module_writable_address(struct module *mod, void *loc);
-
-static inline void *module_writable_address(struct module *mod, void *loc)
-{
- if (!IS_ENABLED(CONFIG_ARCH_HAS_EXECMEM_ROX) || !mod ||
- mod->state != MODULE_STATE_UNFORMED)
- return loc;
- return __module_writable_address(mod, loc);
-}
-
+ void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data);
+
#else /* !CONFIG_MODULES... */
static inline struct module *__module_address(unsigned long addr)
{
return false;
}
-static inline void *module_writable_address(struct module *mod, void *loc)
-{
- return loc;
-}
-
+
+ static inline void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data)
+ {
+ }
#endif /* CONFIG_MODULES */
#ifdef CONFIG_SYSFS
*/
bool is_module_text_address(unsigned long addr)
{
- bool ret;
-
- preempt_disable();
- ret = __module_text_address(addr) != NULL;
- preempt_enable();
-
- return ret;
+ guard(rcu)();
+ return __module_text_address(addr) != NULL;
}
+ void module_for_each_mod(int(*func)(struct module *mod, void *data), void *data)
+ {
+ struct module *mod;
+
+ guard(rcu)();
+ list_for_each_entry_rcu(mod, &modules, list) {
+ if (mod->state == MODULE_STATE_UNFORMED)
+ continue;
+ if (func(mod, data))
+ break;
+ }
+ }
+
/**
* __module_text_address() - get the module whose code contains an address.
* @addr: the address.
FEATURE_DISPLAY := libtraceevent
FEATURE_DISPLAY += libtracefs
FEATURE_DISPLAY += libcpupower
+ FEATURE_DISPLAY += libbpf
+ FEATURE_DISPLAY += clang-bpf-co-re
+ FEATURE_DISPLAY += bpftool-skeletons
-ifeq ($(V),1)
- Q =
-else
- Q = @
-endif
-
all: $(RTLA)
include $(srctree)/tools/build/Makefile.include