kernel: make path_umount backporting as optional
Since https://github.com/backslashxx/KernelSU/commit/4f8943a, path_umount is no longer needed. Signed-off-by: rsuntk <rsuntk@yukiprjkt.my.id>
This commit is contained in:
@@ -170,13 +170,9 @@ endif
|
|||||||
|
|
||||||
# Do checks before compile
|
# Do checks before compile
|
||||||
ifeq ($(shell grep -q "int\s\+\path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
|
ifeq ($(shell grep -q "int\s\+\path_umount" $(srctree)/fs/namespace.c; echo $$?),0)
|
||||||
$(info -- SukiSU: checks ok. Found path_umount)
|
ccflags-y += -DKSU_HAS_PATH_UMOUNT
|
||||||
else
|
|
||||||
$(info -- SukiSU: checks failed, abort.)
|
|
||||||
$(error -- Backporting path_umount is mandatory !! Read: https://kernelsu.org/guide/how-to-integrate-for-non-gki.html#how-to-backport-path-umount)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
## For susfs stuff ##
|
## For susfs stuff ##
|
||||||
ifeq ($(shell test -e $(srctree)/fs/susfs.c; echo $$?),0)
|
ifeq ($(shell test -e $(srctree)/fs/susfs.c; echo $$?),0)
|
||||||
$(eval SUSFS_VERSION=$(shell cat $(srctree)/include/linux/susfs.h | grep -E '^#define SUSFS_VERSION' | cut -d' ' -f3 | sed 's/"//g'))
|
$(eval SUSFS_VERSION=$(shell cat $(srctree)/include/linux/susfs.h | grep -E '^#define SUSFS_VERSION' | cut -d' ' -f3 | sed 's/"//g'))
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ void ksu_escape_to_root(void)
|
|||||||
{
|
{
|
||||||
struct cred *cred;
|
struct cred *cred;
|
||||||
|
|
||||||
#ifdef KSU_GET_CRED_RCU
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -230,14 +229,6 @@ void ksu_escape_to_root(void)
|
|||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
cred = (struct cred *)__task_cred(current);
|
|
||||||
|
|
||||||
if (cred->euid.val == 0) {
|
|
||||||
pr_warn("Already root, don't escape!\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
|
struct root_profile *profile = ksu_get_root_profile(cred->uid.val);
|
||||||
|
|
||||||
@@ -266,16 +257,10 @@ void ksu_escape_to_root(void)
|
|||||||
sizeof(cred->cap_permitted));
|
sizeof(cred->cap_permitted));
|
||||||
memcpy(&cred->cap_bset, &profile->capabilities.effective,
|
memcpy(&cred->cap_bset, &profile->capabilities.effective,
|
||||||
sizeof(cred->cap_bset));
|
sizeof(cred->cap_bset));
|
||||||
// set ambient caps to all-zero
|
|
||||||
// fixes "operation not permitted" on dbus cap dropping
|
|
||||||
memset(&cred->cap_ambient, 0,
|
|
||||||
sizeof(cred->cap_ambient));
|
|
||||||
|
|
||||||
setup_groups(profile, cred);
|
setup_groups(profile, cred);
|
||||||
|
|
||||||
#ifdef KSU_GET_CRED_RCU
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
#endif
|
|
||||||
|
|
||||||
// Refer to kernel/seccomp.c: seccomp_set_mode_strict
|
// Refer to kernel/seccomp.c: seccomp_set_mode_strict
|
||||||
// When disabling Seccomp, ensure that current->sighand->siglock is held during the operation.
|
// When disabling Seccomp, ensure that current->sighand->siglock is held during the operation.
|
||||||
|
|||||||
Reference in New Issue
Block a user