Add dependency on CONFIG_OPTPROBES

If CONFIG_OPTPROBES is not enabled, don't try to sync with kprobe optimizer
This commit is contained in:
Adam_pi3 2021-02-06 20:33:03 -05:00
parent 7d45ab04d3
commit 7f9742103e
No known key found for this signature in database
GPG key ID: 7C0A38B52323F571
3 changed files with 6 additions and 0 deletions

View file

@ -355,7 +355,9 @@ int p_create_database(void) {
p_db.p_module_list_hash,p_db.p_module_kobj_hash);
P_SYM(p_state_init) = 1;
#if defined(CONFIG_OPTPROBES)
P_SYM(p_wait_for_kprobe_optimizer)();
#endif
#if !defined(CONFIG_GRKERNSEC)
p_text_section_lock();

View file

@ -443,6 +443,7 @@ static int __init p_lkrg_register(void) {
}
#endif
#if defined(CONFIG_OPTPROBES)
P_SYM(p_wait_for_kprobe_optimizer) = (void (*)(void))P_SYM(p_kallsyms_lookup_name)("wait_for_kprobe_optimizer");
if (!P_SYM(p_wait_for_kprobe_optimizer)) {
@ -451,6 +452,7 @@ static int __init p_lkrg_register(void) {
p_ret = P_LKRG_GENERAL_ERROR;
goto p_main_error;
}
#endif
// Freeze all non-kernel processes
while (P_SYM(p_freeze_processes)())

View file

@ -222,7 +222,9 @@ typedef struct _p_lkrg_global_symbols_structure {
struct dyn_ftrace *(*p_ftrace_rec_iter_record)(struct ftrace_rec_iter *iter);
struct mutex *p_ftrace_lock;
#endif
#if defined(CONFIG_OPTPROBES)
void (*p_wait_for_kprobe_optimizer)(void);
#endif
struct module *p_find_me;
unsigned int p_state_init;