[ SYSTEM ]: Linux srv.persadacompanies.com 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
[ SERVER ]: Apache | PHP: 8.4.19
[ USER ]: persadamedika | IP: 45.64.1.108
GEFORCE FILE MANAGER
/
usr
/
src
/
file_protector-1.1-1572
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 common
SET
[ DEL ]
📁 ftrace_hooks
SET
[ DEL ]
📁 lsm_hooks
SET
[ DEL ]
📁 syscall_hooks
SET
[ DEL ]
📁 transport
SET
[ DEL ]
📄 Kbuild
10,535 B
SET
[ EDIT ]
|
[ DEL ]
📄 Makefile
2,282 B
SET
[ EDIT ]
|
[ DEL ]
📄 compat.c
8,577 B
SET
[ EDIT ]
|
[ DEL ]
📄 compat.h
12,265 B
SET
[ EDIT ]
|
[ DEL ]
📄 debug.h
3,649 B
SET
[ EDIT ]
|
[ DEL ]
📄 dkms.conf
146 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_contexts.c
54,239 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_contexts.h
2,926 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_contexts_priv.h
5,463 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_handle_tools.h
2,287 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_key_tools.h
950 B
SET
[ EDIT ]
|
[ DEL ]
📄 file_path_tools.h
2,140 B
SET
[ EDIT ]
|
[ DEL ]
📄 hashtable_compat.h
2,798 B
SET
[ EDIT ]
|
[ DEL ]
📄 hook_trampoline_common.h
4,395 B
SET
[ EDIT ]
|
[ DEL ]
📄 interval_tree.h
779 B
SET
[ EDIT ]
|
[ DEL ]
📄 memory.c
3,393 B
SET
[ EDIT ]
|
[ DEL ]
📄 memory.h
3,059 B
SET
[ EDIT ]
|
[ DEL ]
📄 module.c
2,739 B
SET
[ EDIT ]
|
[ DEL ]
📄 module_ref.h
421 B
SET
[ EDIT ]
|
[ DEL ]
📄 module_rundown_protection.c
3,731 B
SET
[ EDIT ]
|
[ DEL ]
📄 module_rundown_protection.h
743 B
SET
[ EDIT ]
|
[ DEL ]
📄 path_tools.h
5,980 B
SET
[ EDIT ]
|
[ DEL ]
📄 rundown_protection.c
4,301 B
SET
[ EDIT ]
|
[ DEL ]
📄 rundown_protection.h
2,899 B
SET
[ EDIT ]
|
[ DEL ]
📄 safe_kobject.h
1,315 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_common.h
4,331 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_fp_properties.h
858 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_fp_properties_x.h
17,177 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_fp_value_types.h
515 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_fp_value_types_x.h
1,279 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_size.h
4,253 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_templates.h
2,452 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_writer.h
7,101 B
SET
[ EDIT ]
|
[ DEL ]
📄 si_writer_common.h
12,561 B
SET
[ EDIT ]
|
[ DEL ]
📄 stringify.h
261 B
SET
[ EDIT ]
|
[ DEL ]
📄 task_info_map.c
14,965 B
SET
[ EDIT ]
|
[ DEL ]
📄 task_info_map.h
6,481 B
SET
[ EDIT ]
|
[ DEL ]
📄 task_info_map_common.h
4,248 B
SET
[ EDIT ]
|
[ DEL ]
📄 task_tools.h
1,370 B
SET
[ EDIT ]
|
[ DEL ]
📄 tracepoints.c
3,668 B
SET
[ EDIT ]
|
[ DEL ]
📄 tracepoints.h
299 B
SET
[ EDIT ]
|
[ DEL ]
📄 write_protection.h
2,257 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: module_rundown_protection.c
/** @file module_rundown_protection.c @brief Global module rundown protection used for safe syscalls handling @details Copyright (c) 2022 Acronis International GmbH @author Denis Kopyrin (Denis.Kopyrin@acronis.com) @since $Id: $ */ #include "module_rundown_protection.h" #include "rundown_protection.h" #include "module_ref.h" #include <linux/module.h> #include <linux/spinlock.h> typedef struct { rundown_protection_t rundown_protection; // 'spinlock' protects flags below spinlock_t spinlock; bool active; bool referenced; } mod_rundown_protection_t; static mod_rundown_protection_t mod_rundown_protection; static void mod_rundown_protection_finalizer(void *ctx) { bool active, referenced; mod_rundown_protection_t *mrp = (mod_rundown_protection_t*) ctx; IPRINTF(""); spin_lock(&mrp->spinlock); active = mrp->active; referenced = mrp->referenced; if (!active) { mrp->referenced = false; } spin_unlock(&mrp->spinlock); IPRINTF("active=%d, referenced=%d", active, referenced); if (active) { IPRINTF("mod is currently active, doing nothing and considering finalizer spurious"); return; } if (referenced) { MODULE_PUT(); } else { IPRINTF("module is not referenced already"); } } void __init mod_rundown_protection_init(bool ready) { rundown_protection_init(&mod_rundown_protection.rundown_protection, mod_rundown_protection_finalizer, &mod_rundown_protection, ready); spin_lock_init(&mod_rundown_protection.spinlock); mod_rundown_protection.referenced = false; mod_rundown_protection.active = false; } bool mod_rundown_protection_lock(void) { return rundown_protection_lock(&mod_rundown_protection.rundown_protection); } void mod_rundown_protection_unlock(void) { return rundown_protection_unlock(&mod_rundown_protection.rundown_protection); } void mod_rundown_protection_set_rundown_active(void) { int64_t pending_count = 0; bool need_unreference = false; IPRINTF(""); // Notice that during 'set_rundown_active' spurious finalizer might be called rundown_protection_set_rundown_active(&mod_rundown_protection.rundown_protection); // Because 'mod_rundown_protection.active=false' is set after 'set_rundown_active' is done, finalizer might be missed. // In this case, we might have to unreference from here too if 'get_pending_count' is 0. spin_lock(&mod_rundown_protection.spinlock); mod_rundown_protection.active = false; pending_count = rundown_protection_get_pending_count(&mod_rundown_protection.rundown_protection); if (0 == pending_count) { need_unreference = mod_rundown_protection.referenced; mod_rundown_protection.referenced = false; } spin_unlock(&mod_rundown_protection.spinlock); IPRINTF("pending_count=%lld need_unreference=%d", pending_count, need_unreference); if (need_unreference) { MODULE_PUT(); } } void mod_rundown_protection_wait_for_rundown(void) { return rundown_protection_wait_for_rundown(&mod_rundown_protection.rundown_protection); } bool mod_rundown_protection_wait_for_rundown_timeout(unsigned long timeout_jiffies) { return rundown_protection_wait_for_rundown_timeout(&mod_rundown_protection.rundown_protection, timeout_jiffies); } void mod_rundown_protection_set_ready(void) { bool module_was_already_referenced; IPRINTF(""); MODULE_GET(); spin_lock(&mod_rundown_protection.spinlock); mod_rundown_protection.active = true; module_was_already_referenced = mod_rundown_protection.referenced; mod_rundown_protection.referenced = true; spin_unlock(&mod_rundown_protection.spinlock); rundown_protection_set_ready(&mod_rundown_protection.rundown_protection); IPRINTF("module_was_already_referenced=%d", module_was_already_referenced); if (module_was_already_referenced) { MODULE_PUT(); } }