From 2a5fb76f95482cf7a55822cbf36c24ba72db4b3b Mon Sep 17 00:00:00 2001 From: weishu Date: Tue, 6 Jun 2023 20:56:19 +0800 Subject: [PATCH] manager: sync kernel struct and bump profile version --- manager/app/src/main/cpp/ksu.h | 4 ++-- manager/app/src/main/java/me/weishu/kernelsu/Natives.kt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/manager/app/src/main/cpp/ksu.h b/manager/app/src/main/cpp/ksu.h index 4060bb3c..8f9c4c0b 100644 --- a/manager/app/src/main/cpp/ksu.h +++ b/manager/app/src/main/cpp/ksu.h @@ -17,7 +17,7 @@ bool uid_should_umount(int uid); bool is_safe_mode(); -#define KSU_APP_PROFILE_VER 1 +#define KSU_APP_PROFILE_VER 2 #define KSU_MAX_PACKAGE_NAME 256 // NGROUPS_MAX for Linux is 65535 generally, but we only supports 32 groups. #define KSU_MAX_GROUPS 32 @@ -29,8 +29,8 @@ struct root_profile { int32_t uid; int32_t gid; - int32_t groups[KSU_MAX_GROUPS]; int32_t groups_count; + int32_t groups[KSU_MAX_GROUPS]; // kernel_cap_t is u32[2] for capabilities v3 struct { diff --git a/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt b/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt index 2afb97ba..218f72d6 100644 --- a/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt +++ b/manager/app/src/main/java/me/weishu/kernelsu/Natives.kt @@ -14,7 +14,8 @@ object Natives { // 10915: allowlist breaking change, add app profile // 10931: app profile struct add 'version' field // 10946: add capabilities - const val MINIMAL_SUPPORTED_KERNEL = 10946 + // 10977: change groups_count and groups to avoid overflow write + const val MINIMAL_SUPPORTED_KERNEL = 10977 init { System.loadLibrary("kernelsu")