kernel: Modified dynamic signature All files have been renamed to the correct names: Dynamic Manager
This commit is contained in:
@@ -47,8 +47,12 @@
|
||||
#include "selinux/selinux.h"
|
||||
#include "throne_tracker.h"
|
||||
#include "kernel_compat.h"
|
||||
#include "kpm/kpm.h"
|
||||
#include "include/ksu_creds.h"
|
||||
#include "dynamic_manager.h"
|
||||
|
||||
#ifdef CONFIG_KPM
|
||||
#include "kpm/kpm.h"
|
||||
#endif
|
||||
|
||||
static bool ksu_module_mounted = false;
|
||||
|
||||
@@ -357,36 +361,36 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Allow the root manager to configure dynamic signatures
|
||||
if (arg2 == CMD_DYNAMIC_SIGN) {
|
||||
if (!from_root && !from_manager) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct dynamic_sign_user_config config;
|
||||
|
||||
if (copy_from_user(&config, (void __user *)arg3,
|
||||
// Allow the root manager to configure dynamic manageratures
|
||||
if (arg2 == CMD_DYNAMIC_MANAGER) {
|
||||
if (!from_root && !from_manager) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct dynamic_manager_user_config config;
|
||||
|
||||
if (copy_from_user(&config, (void __user *)arg3,
|
||||
sizeof(config))) {
|
||||
pr_err("copy dynamic sign config failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = ksu_handle_dynamic_sign(&config);
|
||||
|
||||
if (ret == 0 && config.operation == DYNAMIC_SIGN_OP_GET) {
|
||||
if (copy_to_user((void __user *)arg3, &config,
|
||||
pr_err("copy dynamic manager config failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = ksu_handle_dynamic_manager(&config);
|
||||
|
||||
if (ret == 0 && config.operation == DYNAMIC_MANAGER_OP_GET) {
|
||||
if (copy_to_user((void __user *)arg3, &config,
|
||||
sizeof(config))) {
|
||||
pr_err("copy dynamic sign config back failed\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||
pr_err("dynamic_sign: prctl reply error\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
pr_err("copy dynamic manager config back failed\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
|
||||
pr_err("dynamic_manager: prctl reply error\n");
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Allow root manager to get active managers
|
||||
@@ -423,8 +427,8 @@ int ksu_handle_prctl(int option, unsigned long arg2, unsigned long arg3,
|
||||
pr_info("post-fs-data triggered\n");
|
||||
on_post_fs_data();
|
||||
// Initializing Dynamic Signatures
|
||||
ksu_dynamic_sign_init();
|
||||
pr_info("Dynamic sign config loaded during post-fs-data\n");
|
||||
ksu_dynamic_manager_init();
|
||||
pr_info("Dynamic manager config loaded during post-fs-data\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user