Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kINT: Fix synchronization problem #294

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/modules/database/p_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ int p_create_database(void) {

P_SYM_INIT(jump_label_mutex)
P_SYM_INIT(text_mutex)
P_SYM_INIT(tracepoints_mutex)

/*
* First gather information about CPUs in the system - CRITICAL !!!
Expand Down
2 changes: 2 additions & 0 deletions src/modules/database/p_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ static inline void p_text_section_lock(void) {
mutex_lock(P_SYM(p_module_mutex));
while (mutex_is_locked(P_SYM(p_jump_label_mutex)))
schedule();
mutex_lock(P_SYM(p_tracepoints_mutex));
#if defined(P_LKRG_CI_ARCH_STATIC_CALL_TRANSFORM_H)
do {
p_lkrg_counter_lock_lock(&p_static_call_spinlock, &p_text_flags);
Expand All @@ -225,6 +226,7 @@ static inline void p_text_section_unlock(void) {
#if defined(P_LKRG_CI_ARCH_STATIC_CALL_TRANSFORM_H)
p_lkrg_counter_lock_val_dec(&p_static_call_spinlock);
#endif
mutex_unlock(P_SYM(p_tracepoints_mutex));
/* Release the 'module_mutex' */
mutex_unlock(P_SYM(p_module_mutex));
#if defined(CONFIG_DYNAMIC_FTRACE)
Expand Down
1 change: 1 addition & 0 deletions src/p_lkrg_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ typedef struct _p_lkrg_global_symbols_structure {
pmd_t *(*p_mm_find_pmd)(struct mm_struct *mm, unsigned long address);
struct mutex *p_jump_label_mutex;
struct mutex *p_text_mutex;
struct mutex *p_tracepoints_mutex;
struct text_poke_loc **p_tp_vec;
int *p_tp_vec_nr;
#if defined(CONFIG_DYNAMIC_DEBUG)
Expand Down