You've already forked KernelSU
mirror of
https://github.com/tiann/KernelSU.git
synced 2025-08-27 23:46:34 +00:00
kernel: fix issue with dfd parameter retrieval (#1543)
Although in most cases, this system call might not be used, or when called, AT_FDCWD(-100) is passed in.
This commit is contained in:
@@ -134,7 +134,7 @@ int ksu_handle_execveat_sucompat(int *fd, struct filename **filename_ptr,
|
|||||||
|
|
||||||
__maybe_unused static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
__maybe_unused static int faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
int *dfd = (int *)PT_REGS_PARM1(regs);
|
int *dfd = (int *)&PT_REGS_PARM1(regs);
|
||||||
const char __user **filename_user = (const char **)&PT_REGS_PARM2(regs);
|
const char __user **filename_user = (const char **)&PT_REGS_PARM2(regs);
|
||||||
int *mode = (int *)&PT_REGS_PARM3(regs);
|
int *mode = (int *)&PT_REGS_PARM3(regs);
|
||||||
// Both sys_ and do_ is C function
|
// Both sys_ and do_ is C function
|
||||||
@@ -150,7 +150,7 @@ static int sys_faccessat_handler_pre(struct kprobe *p, struct pt_regs *regs)
|
|||||||
#else
|
#else
|
||||||
struct pt_regs *real_regs = regs;
|
struct pt_regs *real_regs = regs;
|
||||||
#endif
|
#endif
|
||||||
int *dfd = (int *)PT_REGS_PARM1(real_regs);
|
int *dfd = (int *)&PT_REGS_PARM1(real_regs);
|
||||||
const char __user **filename_user = (const char **)&PT_REGS_PARM2(real_regs);
|
const char __user **filename_user = (const char **)&PT_REGS_PARM2(real_regs);
|
||||||
int *mode = (int *)&PT_REGS_PARM3(real_regs);
|
int *mode = (int *)&PT_REGS_PARM3(real_regs);
|
||||||
|
|
||||||
@@ -261,4 +261,4 @@ void ksu_sucompat_exit() {
|
|||||||
unregister_kprobe(&newfstatat_kp);
|
unregister_kprobe(&newfstatat_kp);
|
||||||
unregister_kprobe(&faccessat_kp);
|
unregister_kprobe(&faccessat_kp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user