diff options
Diffstat (limited to 'SOURCE/module/kernel/mutex.c')
| -rw-r--r-- | SOURCE/module/kernel/mutex.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/SOURCE/module/kernel/mutex.c b/SOURCE/module/kernel/mutex.c index 8ee8b97..5143765 100644 --- a/SOURCE/module/kernel/mutex.c +++ b/SOURCE/module/kernel/mutex.c @@ -430,13 +430,22 @@ static int __activate_mutex_monitor(void) hook_tracepoint("sched_process_exit", trace_sched_process_exit_hit, NULL); } //get_argv_processes(&mm_tree); - +//https://lore.kernel.org/lkml/[email protected]/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) get_online_cpus(); +#else + cpus_read_lock(); +#endif new_mutex_lock(orig_text_mutex); JUMP_INSTALL(mutex_lock); JUMP_INSTALL(mutex_unlock); new_mutex_unlock(orig_text_mutex); +//https://lore.kernel.org/lkml/[email protected]/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) put_online_cpus(); +#else + cpus_read_unlock(); +#endif return 1; out_variant_buffer: @@ -452,14 +461,24 @@ static void __deactivate_mutex_monitor(void) unhook_tracepoint("sched_process_exit", trace_sched_process_exit_hit, NULL); } +//https://lore.kernel.org/lkml/[email protected]/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) get_online_cpus(); +#else + cpus_read_lock(); +#endif new_mutex_lock(orig_text_mutex); JUMP_REMOVE(mutex_lock); JUMP_REMOVE(mutex_unlock); new_mutex_unlock(orig_text_mutex); +//https://lore.kernel.org/lkml/[email protected]/ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0) put_online_cpus(); +#else + cpus_read_unlock(); +#endif clean_data(); @@ -633,6 +652,8 @@ static int lookup_syms(void) if (orig___mutex_unlock_slowpath == NULL) orig___mutex_unlock_slowpath = (void *)diag_kallsyms_lookup_name("__mutex_unlock_slowpath.isra.19"); if (orig___mutex_unlock_slowpath == NULL) + orig___mutex_unlock_slowpath = (void *)diag_kallsyms_lookup_name("__mutex_unlock_slowpath.isra.24"); + if (orig___mutex_unlock_slowpath == NULL) orig___mutex_unlock_slowpath = (void *)diag_kallsyms_lookup_name("__mutex_unlock_slowpath"); if (orig___mutex_unlock_slowpath == NULL) orig___mutex_unlock_slowpath = (void *)diag_kallsyms_lookup_name("__mutex_unlock_slowpath.constprop.0"); |
