/
var
/
lib
/
dkms
/
file_protector
/
1.1-1507
/
source
/
File Upload :
llllll
Current File: //var/lib/dkms/file_protector/1.1-1507/source/module.c
/** @file @brief Linux kernel 'module' @details Copyright (c) 2017 Acronis International GmbH @author Mikhail Krivtsov (mikhail.krivtsov@acronis.com) @since $Id: $ */ #include "debug.h" // DPRINTF #include "module_rundown_protection.h" #include "syscall_common.h" #include "task_info_map.h" #include "tracepoints.h" #include "transport.h" #include <linux/module.h> #include <linux/version.h> // LINUX_VERSION_CODE, KERNEL_VERSION() /* Initialization order is very important. 'transport' depends on 'pid_bw_list' 'syscall_hooks' and 'tracepoints' depend on 'transport' */ static int __init module_init_impl(void) { int ret; IPRINTF("DRIVER_VERSION=%s", DRIVER_VERSION_STRING); IPRINTF("LINUX_VERSION_CODE=%u.%u.%u", LINUX_VERSION_CODE >> 16, (LINUX_VERSION_CODE >> 8) & 0xFF, LINUX_VERSION_CODE & 0xFF); #if defined RHEL_RELEASE_CODE IPRINTF("RHEL_RELEASE_CODE=%u.%u", RHEL_RELEASE_CODE >> 8, RHEL_RELEASE_CODE & 0xFF); #endif ret = task_info_map_init(); if (ret) { EPRINTF("'%s()' failure %i", "task_info_map_init", ret); goto out; } ret = transport_mod_init(); if (ret) { EPRINTF("'%s()' failure %i", "transport_mod_init", ret); goto shutdown_task_info_map; } ret = syscall_hooks_init(); if (ret) { EPRINTF("'%s()' failure %i", "syscall_hooks_init", ret); goto shutdown_transport; } mod_rundown_protection_init(false /*not ready*/); // Note: 'ret' is already 0 here goto out; shutdown_transport: transport_mod_down(); shutdown_task_info_map: task_info_map_down(); out: DPRINTF("ret=%i", ret); return ret; } static void __exit module_down_impl(void) { IPRINTF("module unload started"); syscall_hooks_exit(); transport_mod_down(); task_info_map_down(); IPRINTF("module unload finished"); } MODULE_AUTHOR("Acronis International GmbH"); MODULE_DESCRIPTION("APL (Active Protection for Linux)"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRIVER_VERSION_STRING); module_init(module_init_impl); module_exit(module_down_impl);
Copyright ©2k19 -
Hexid
|
Tex7ure