Linux host2.homegym.sg 4.18.0-553.8.1.el8_10.x86_64 #1 SMP Tue Jul 2 07:26:33 EDT 2024 x86_64
Apache
Server IP : 159.223.38.192 & Your IP : 159.223.38.192
Domains : 20 Domain
User : eachadea
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
usr /
src /
file_protector-1.1-1583 /
Delete
Unzip
Name
Size
Permission
Date
Action
common
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
ftrace_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
lsm_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
syscall_hooks
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
transport
[ DIR ]
drwxr-xr-x
2025-10-28 18:03
Kbuild
10.29
KB
-rw-r--r--
2025-10-28 18:03
Makefile
2.23
KB
-rw-r--r--
2025-10-28 18:03
compat.c
8.42
KB
-rw-r--r--
2025-10-28 18:03
compat.h
11.98
KB
-rw-r--r--
2025-10-28 18:03
debug.h
3.56
KB
-rw-r--r--
2025-10-28 18:03
dkms.conf
146
B
-rw-r--r--
2025-10-28 18:03
file_contexts.c
60.43
KB
-rw-r--r--
2025-10-28 18:03
file_contexts.h
6.21
KB
-rw-r--r--
2025-10-28 18:03
file_contexts_priv.h
5.48
KB
-rw-r--r--
2025-10-28 18:03
file_handle_tools.h
2.53
KB
-rw-r--r--
2025-10-28 18:03
file_key_tools.h
950
B
-rw-r--r--
2025-10-28 18:03
file_path_tools.h
2.09
KB
-rw-r--r--
2025-10-28 18:03
hashtable_compat.h
2.73
KB
-rw-r--r--
2025-10-28 18:03
hook_trampoline_common.h
4.29
KB
-rw-r--r--
2025-10-28 18:03
interval_tree.h
779
B
-rw-r--r--
2025-10-28 18:03
memory.c
3.31
KB
-rw-r--r--
2025-10-28 18:03
memory.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
module.c
2.67
KB
-rw-r--r--
2025-10-28 18:03
module_ref.h
421
B
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.c
3.64
KB
-rw-r--r--
2025-10-28 18:03
module_rundown_protection.h
743
B
-rw-r--r--
2025-10-28 18:03
path_tools.h
6.06
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.c
4.2
KB
-rw-r--r--
2025-10-28 18:03
rundown_protection.h
2.83
KB
-rw-r--r--
2025-10-28 18:03
safe_kobject.h
1.28
KB
-rw-r--r--
2025-10-28 18:03
si_common.h
4.3
KB
-rw-r--r--
2025-10-28 18:03
si_fp_properties.h
858
B
-rw-r--r--
2025-10-28 18:03
si_fp_properties_x.h
18.53
KB
-rw-r--r--
2025-10-28 18:03
si_fp_value_types.h
515
B
-rw-r--r--
2025-10-28 18:03
si_fp_value_types_x.h
1.25
KB
-rw-r--r--
2025-10-28 18:03
si_size.h
4.26
KB
-rw-r--r--
2025-10-28 18:03
si_templates.h
2.99
KB
-rw-r--r--
2025-10-28 18:03
si_writer.h
7.52
KB
-rw-r--r--
2025-10-28 18:03
si_writer_common.h
14.63
KB
-rw-r--r--
2025-10-28 18:03
stringify.h
261
B
-rw-r--r--
2025-10-28 18:03
task_info_map.c
17.1
KB
-rw-r--r--
2025-10-28 18:03
task_info_map.h
6.33
KB
-rw-r--r--
2025-10-28 18:03
task_tools.h
1.34
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.c
3.58
KB
-rw-r--r--
2025-10-28 18:03
tracepoints.h
299
B
-rw-r--r--
2025-10-28 18:03
write_protection.h
2.2
KB
-rw-r--r--
2025-10-28 18:03
Save
Rename
/** @file file_contexts.h @brief Store the opened file contexts(inode + pid) @details Copyright (c) 2023 Acronis International GmbH @author Bruce Wang (bruce.wang@acronis.com) @since $Id: $ */ #pragma once #include "interval_tree.h" #include "transport.h" #include "transport_id.h" #include "transport_protocol.h" #define FILE_CONTEXT_MAX_FILE_SIZE (100 * 1024 * 1024) typedef struct { long long tv_sec; long tv_nsec; } timespec_compat_t; typedef struct { file_key_t file_key; timespec_compat_t i_mtime; /* last modify time */ timespec_compat_t i_ctime; /* last change time */ } file_context_key_t; // This struct is stored in msg_t, to keep the necessary information typedef struct { file_context_key_t key; transport_id_t skipped_transport_ids[MAX_TRANSPORT_SIZE]; } file_context_msg_info_t; // Particular event properties that are being cached. typedef union { struct { int flags; } open; struct { uint64_t low; uint64_t high; } rw; } file_context_params_t; // This struct used for all request to add to cache from userspace. typedef struct { // You may pass pid_key==0 to apply per inode instead of per process // pid_key could be either unique_pid or pid_version depending on the caching policy. // For 'MODIFY+CLOSE' events it is unique_pid, for everything else pid_version uint64_t pid_key; file_context_params_t params; uint32_t ttl_s; file_context_key_t key; } file_context_add_cache_request_t; // A struct to store the temporary file context information during message creation hence checking. typedef struct { uint64_t pid_key; file_context_params_t params; file_context_msg_info_t msg_info; } file_context_info_t; // Module is loaded/unloaded functions /** * @brief Initialize the file contexts module. * @return 0 on success, negative value on failure. */ int file_contexts_init(void); /** * @brief Frees all resources allocated assuming that module start has failed. */ void file_contexts_init_fail_free(void); /** * @brief Deinitialize the file contexts module and free all resources. */ void file_contexts_deinit(void); // Internal maintainance function that gets called when inode needs to be removed. // Usually this happens when node is unlinked/created or on 'inode_free'. /** * @brief Remove all cache entries associated with a given file key (inode). * @param file_key Pointer to the file key (inode) to remove from cache. */ void remove_common_cache_all(const file_key_t* file_key); // Reserve context id table from transport allocation/deallocation. /** * @brief Reserve a context ID table entry for a given transport ID. * @param id Transport ID to reserve entry for. * @return 0 on success, negative value on failure. */ int acquire_file_context_entry(transport_id_t id); /** * @brief Release a reserved context ID table entry for a given transport ID. * @param id Transport ID to release entry for. */ void release_file_context_entry(transport_id_t id); // Each file context cache has "message" and "client" sides. // When "message" needs to be generated, "check" functions are used with "file_context_info_t", // when client decides to cache, "add" functions are used with "file_context_add_cache_request_t". /* --- OPEN --- */ /** * @brief Check if an open event is cached for the given transport IDs and file context info. * @param ids Pointer to transport IDs. * @param info Pointer to file context info to check. * @return true if cached, false otherwise. */ bool check_open_cache(const transport_ids_t* ids, file_context_info_t* info); /** * @brief Add an open event to the cache for the given transport ID and request. * @param id Transport ID. * @param req Pointer to the cache request. * @return 0 on success, negative value on failure. */ int add_open_cache(transport_id_t id, const file_context_add_cache_request_t* req); /* --- READ/WRITE --- */ /** * @brief Add a read/write event to the cache for the given transport ID, request, and table type. * @param id Transport ID. * @param req Pointer to the cache request. * @param type Table type (read/write). * @return 0 on success, negative value on failure. */ int add_write_cache(transport_id_t id, const file_context_add_cache_request_t* req); /** * @brief Check and update the read cache for the given transport IDs and file context info. * @param ids Pointer to transport IDs. * @param info Pointer to file context info to check and update. * @return true if cache was updated, false otherwise. */ bool check_and_update_read_cache(const transport_ids_t* ids, file_context_info_t *info); /** * @brief Check the write cache for the given transport IDs, file context info, and table type. * @param ids Pointer to transport IDs. * @param info Pointer to file context info to check. * @param type Table type (write). * @return true if cached, false otherwise. */ bool check_write_cache(const transport_ids_t* ids, file_context_info_t *info); // Special cache that is for "file modify" events. // When any modification event happens (fsnotify_modify), an extra node is added in. // On "close" event is being taken from the cache (check_update) to send file modified flag. /** * @brief Reserve an entry for file modification events in the cache. * @return 0 on success, negative value on failure. */ int acquire_file_modify_entry(void); /** * @brief Release a reserved entry for file modification events in the cache. */ void release_file_modify_entry(void); /** * @brief Add a file modification event to the cache on "MODIFY". * @param info Pointer to the cache request. * @return true on success, false otherwise. */ bool add_file_modify_cache(const file_context_add_cache_request_t *info); /** * @brief Check and update the file modification cache for the given file context info on "CLOSE". * @param info Pointer to file context info to check and update. * @return true if cache was updated, false otherwise. */ bool check_update_file_modify_cache(file_context_info_t *info); /** * @brief Allocate a file context table for the given transport ID and table type. * @param id Transport ID. * @param type Table type to allocate. * @return 0 on success, negative value on failure. */ int acquire_file_context_table(transport_id_t id, file_context_table_type_t type);