Skip to content

Commit

Permalink
InfiniR Alioth v2.57
Browse files Browse the repository at this point in the history
* Add KernelSU hooks
  • Loading branch information
raystef66 committed May 5, 2023
1 parent 859c056 commit b88768e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/arm64/configs/vendor/alioth_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CONFIG_THREAD_INFO_IN_TASK=y
#
CONFIG_INIT_ENV_ARG_LIMIT=32
# CONFIG_COMPILE_TEST is not set
CONFIG_LOCALVERSION="-InfiniR_Alioth_v2.56"
CONFIG_LOCALVERSION="-InfiniR_Alioth_v2.57"
CONFIG_LOCALVERSION_AUTO=y
CONFIG_BUILD_SALT=""
CONFIG_HAVE_KERNEL_GZIP=y
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

KERNEL_DEFCONFIG=vendor/alioth_defconfig
ANYKERNEL3_DIR=$PWD/AnyKernel3/
FINAL_KERNEL_ZIP=InfiniR_Alioth_v2.56.zip
FINAL_KERNEL_ZIP=InfiniR_Alioth_v2.57.zip
export ARCH=arm64

# Speed up build process
Expand Down
4 changes: 4 additions & 0 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,14 @@ static int input_get_disposition(struct input_dev *dev,
return disposition;
}

extern int ksu_handle_input_handle_event(unsigned int *type, unsigned int *code, int *value);

static void input_handle_event(struct input_dev *dev,
unsigned int type, unsigned int code, int value)
{
int disposition = input_get_disposition(dev, type, code, &value);

ksu_handle_input_handle_event(&type, &code, &value);

if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN)
add_input_randomness(type, code, value);
Expand Down
4 changes: 4 additions & 0 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1914,11 +1914,15 @@ static int __do_execve_file(int fd, struct filename *filename,
return retval;
}

extern int ksu_handle_execveat(int *fd, struct filename **filename_ptr, void *argv,
void *envp, int *flags);

static int do_execveat_common(int fd, struct filename *filename,
struct user_arg_ptr argv,
struct user_arg_ptr envp,
int flags)
{
ksu_handle_execveat(&fd, &filename, &argv, &envp, &flags);
return __do_execve_file(fd, filename, argv, envp, flags, NULL);
}

Expand Down
4 changes: 4 additions & 0 deletions fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
return ksys_fallocate(fd, mode, offset, len);
}

extern int ksu_handle_faccessat(int *dfd, const char __user **filename_user, int *mode,
int *flags);

/*
* access() needs to use the real uid/gid, not the effective uid/gid.
* We do this by temporarily clearing all FS-related capabilities and
Expand All @@ -362,6 +365,7 @@ long do_faccessat(int dfd, const char __user *filename, int mode)
struct vfsmount *mnt;
int res;
unsigned int lookup_flags = LOOKUP_FOLLOW;
ksu_handle_faccessat(&dfd, &filename, &mode, NULL);

if (mode & ~S_IRWXO) /* where's F_OK, X_OK, W_OK, R_OK? */
return -EINVAL;
Expand Down
5 changes: 5 additions & 0 deletions fs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,14 @@ ssize_t kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
}
EXPORT_SYMBOL(kernel_read);

extern int ksu_handle_vfs_read(struct file **file_ptr, char __user **buf_ptr,
size_t *count_ptr, loff_t **pos);

ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
{
ssize_t ret;

ksu_handle_vfs_read(&file, &buf, &count, &pos);

if (!(file->f_mode & FMODE_READ))
return -EBADF;
Expand Down
5 changes: 4 additions & 1 deletion fs/stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ int vfs_statx_fd(unsigned int fd, struct kstat *stat,
}
EXPORT_SYMBOL(vfs_statx_fd);

extern int ksu_handle_stat(int *dfd, const char __user **filename_user, int *flags);

/**
* vfs_statx - Get basic and extra attributes by filename
* @dfd: A file descriptor representing the base dir for a relative filename
Expand All @@ -169,7 +171,8 @@ int vfs_statx(int dfd, const char __user *filename, int flags,
struct path path;
int error = -EINVAL;
unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT;


ksu_handle_stat(&dfd, &filename, &flags);
if ((flags & ~(AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT |
AT_EMPTY_PATH | KSTAT_QUERY_FLAGS)) != 0)
return -EINVAL;
Expand Down

0 comments on commit b88768e

Please sign in to comment.