mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
Revert "ANDROID: module: Add vendor hook"
This reverts commit 4d63efb9ae.
The hooks android_vh_set_module_permit_before_init and
android_vh_set_module_permit_after_init is not used by any vendor, so
remove it to help with merge issues with future LTS releases.
If this is needed by any real user, it can easily be reverted to add it
back and then the symbol should be added to the abi list at the same
time to prevent it from being removed again later.
Bug: 203756332
Bug: 181639260
Cc: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I3bbc5d4190d9fbf34469d2c5c1386dcbf998fb4b
This commit is contained in:
@@ -48,7 +48,6 @@
|
||||
#include <trace/hooks/traps.h>
|
||||
#include <trace/hooks/avc.h>
|
||||
#include <trace/hooks/creds.h>
|
||||
#include <trace/hooks/module.h>
|
||||
#include <trace/hooks/memory.h>
|
||||
#include <trace/hooks/typec.h>
|
||||
#include <trace/hooks/gpiolib.h>
|
||||
@@ -274,8 +273,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_x);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_nx);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_ro);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_rw);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_before_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_after_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_util_est_update);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_meminfo_proc_show);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_mm);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM module
|
||||
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
#if !defined(_TRACE_HOOK_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_MODULE_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
/*
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct module;
|
||||
#else
|
||||
/* struct module */
|
||||
#include <linux/module.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
DECLARE_HOOK(android_vh_set_module_permit_before_init,
|
||||
TP_PROTO(const struct module *mod),
|
||||
TP_ARGS(mod));
|
||||
|
||||
DECLARE_HOOK(android_vh_set_module_permit_after_init,
|
||||
TP_PROTO(const struct module *mod),
|
||||
TP_ARGS(mod));
|
||||
|
||||
#endif /* _TRACE_HOOK_MODULE_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
@@ -63,10 +63,6 @@
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/module.h>
|
||||
|
||||
#undef CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/module.h>
|
||||
#include <trace/hooks/memory.h>
|
||||
|
||||
#ifndef ARCH_SHF_SMALL
|
||||
#define ARCH_SHF_SMALL 0
|
||||
#endif
|
||||
@@ -2263,10 +2259,6 @@ static void free_module(struct module *mod)
|
||||
|
||||
/* This may be empty, but that's OK */
|
||||
module_arch_freeing_init(mod);
|
||||
trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
module_memfree(mod->init_layout.base);
|
||||
kfree(mod->args);
|
||||
percpu_modfree(mod);
|
||||
@@ -2275,10 +2267,6 @@ static void free_module(struct module *mod)
|
||||
lockdep_free_key_range(mod->core_layout.base, mod->core_layout.size);
|
||||
|
||||
/* Finally, free the core (containing the module structure) */
|
||||
trace_android_vh_set_memory_rw((unsigned long)mod->core_layout.base,
|
||||
(mod->core_layout.size)>>PAGE_SHIFT);
|
||||
trace_android_vh_set_memory_nx((unsigned long)mod->core_layout.base,
|
||||
(mod->core_layout.size)>>PAGE_SHIFT);
|
||||
module_memfree(mod->core_layout.base);
|
||||
}
|
||||
|
||||
@@ -3655,15 +3643,7 @@ static void module_deallocate(struct module *mod, struct load_info *info)
|
||||
{
|
||||
percpu_modfree(mod);
|
||||
module_arch_freeing_init(mod);
|
||||
trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
module_memfree(mod->init_layout.base);
|
||||
trace_android_vh_set_memory_rw((unsigned long)mod->core_layout.base,
|
||||
(mod->core_layout.size)>>PAGE_SHIFT);
|
||||
trace_android_vh_set_memory_nx((unsigned long)mod->core_layout.base,
|
||||
(mod->core_layout.size)>>PAGE_SHIFT);
|
||||
module_memfree(mod->core_layout.base);
|
||||
}
|
||||
|
||||
@@ -3806,13 +3786,8 @@ static noinline int do_init_module(struct module *mod)
|
||||
rcu_assign_pointer(mod->kallsyms, &mod->core_kallsyms);
|
||||
#endif
|
||||
module_enable_ro(mod, true);
|
||||
trace_android_vh_set_module_permit_after_init(mod);
|
||||
mod_tree_remove_init(mod);
|
||||
module_arch_freeing_init(mod);
|
||||
trace_android_vh_set_memory_rw((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
trace_android_vh_set_memory_nx((unsigned long)mod->init_layout.base,
|
||||
(mod->init_layout.size)>>PAGE_SHIFT);
|
||||
mod->init_layout.base = NULL;
|
||||
mod->init_layout.size = 0;
|
||||
mod->init_layout.ro_size = 0;
|
||||
@@ -3919,7 +3894,6 @@ static int complete_formation(struct module *mod, struct load_info *info)
|
||||
module_enable_ro(mod, false);
|
||||
module_enable_nx(mod);
|
||||
module_enable_x(mod);
|
||||
trace_android_vh_set_module_permit_before_init(mod);
|
||||
|
||||
/* Mark state as coming so strong_try_module_get() ignores us,
|
||||
* but kallsyms etc. can see us. */
|
||||
|
||||
Reference in New Issue
Block a user