kernel: fix memory leaks and x86_64 args
This commit is contained in:
@@ -54,9 +54,11 @@ static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs) {
|
||||
}
|
||||
if (!memcmp(filename->name, su, sizeof(su))) {
|
||||
pr_info("faccessat su->sh!\n");
|
||||
regs->regs[1] = sh_user_path();
|
||||
PT_REGS_PARM2(regs) = sh_user_path();
|
||||
}
|
||||
|
||||
putname(filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -76,9 +78,11 @@ static int newfstatat_handler_pre(struct kprobe *p, struct pt_regs *regs) {
|
||||
}
|
||||
if (!memcmp(filename->name, su, sizeof(su))) {
|
||||
pr_info("newfstatat su->sh!\n");
|
||||
regs->regs[1] = sh_user_path();
|
||||
PT_REGS_PARM2(regs) = sh_user_path();
|
||||
}
|
||||
|
||||
putname(filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -104,6 +108,8 @@ static int execve_handler_pre(struct kprobe *p, struct pt_regs *regs) {
|
||||
escape_to_root(false);
|
||||
}
|
||||
|
||||
putname(filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user