Skip to content

Commit f5a30ce

Browse files
committed
KSU:Manually call KernelSU
1 parent 98020e9 commit f5a30ce

File tree

5 files changed

+185
-162
lines changed

5 files changed

+185
-162
lines changed

arch/arm64/configs/vendor/gauguin_user_defconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y
599599
# CONFIG_JUMP_LABEL is not set
600600
CONFIG_UPROBES=y
601601
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
602-
CONFIG_KPROBES=y
602+
# CONFIG_KPROBES=y
603603
CONFIG_HAVE_KPROBES=y
604604
CONFIG_HAVE_KRETPROBES=y
605605
CONFIG_HAVE_NMI=y

fs/exec.c

+3
Original file line numberDiff line numberDiff line change
@@ -1912,11 +1912,14 @@ static int __do_execve_file(int fd, struct filename *filename,
19121912
return retval;
19131913
}
19141914

1915+
extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,
1916+
void *envp, int *flags);
19151917
static int do_execveat_common(int fd, struct filename *filename,
19161918
struct user_arg_ptr argv,
19171919
struct user_arg_ptr envp,
19181920
int flags)
19191921
{
1922+
ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags);
19201923
return __do_execve_file(fd, filename, argv, envp, flags, NULL);
19211924
}
19221925

fs/open.c

+3
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,16 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
348348
return ksys_fallocate(fd, mode, offset, len);
349349
}
350350

351+
extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,
352+
int *flags);
351353
/*
352354
* access() needs to use the real uid/gid, not the effective uid/gid.
353355
* We do this by temporarily clearing all FS-related capabilities and
354356
* switching the fsuid/fsgid around to the real ones.
355357
*/
356358
long do_faccessat(int dfd, const char __user *filename, int mode)
357359
{
360+
ksu_handle_faccessat(&dfd, &filename, &mode, NULL);
358361
const struct cred *old_cred;
359362
struct cred *override_cred;
360363
struct path path;

0 commit comments

Comments
 (0)