kernel: make kernel correctly response CMD_GRANT_ROOT (#73)

This commit is contained in:
Scirese
2023-01-15 20:11:21 +08:00
committed by GitHub
parent a30aab1da6
commit 4f99d865cb

View File

@@ -240,6 +240,9 @@ static int handler_pre(struct kprobe *p, struct pt_regs *regs)
if (is_allow_su()) { if (is_allow_su()) {
pr_info("allow root for: %d\n", current_uid()); pr_info("allow root for: %d\n", current_uid());
escape_to_root(); escape_to_root();
if (copy_to_user(result, &reply_ok, sizeof(reply_ok))) {
pr_err("grant_root: prctl reply error\n");
}
} else { } else {
pr_info("deny root for: %d\n", current_uid()); pr_info("deny root for: %d\n", current_uid());
// add it to deny list! // add it to deny list!