From cd2419fbc65555718e0c176d6f06a6c14aae6b24 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Fri, 28 Jun 2024 15:00:49 +0900 Subject: [PATCH] [WIP]: 00 --- mali_shrinker_mmap32.c | 86 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/mali_shrinker_mmap32.c b/mali_shrinker_mmap32.c index b43f631..7349f4c 100644 --- a/mali_shrinker_mmap32.c +++ b/mali_shrinker_mmap32.c @@ -84,10 +84,49 @@ ADD_COMMIT = add x8, x8, #0x(Last 3 digits of COMMIT_CRED) * Maintained by Syuugo */ +// TAB-A05-BD 00.04.000 +#define COMMIT_CREDS_CTX_00_04_000 0x5a120 +#define AVC_DENY_CTX_00_04_000 0x35acc8 +#define SEL_READ_ENFORCE_CTX_00_04_000 0x3653a8 +#define SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000 0x365d80 +#define INIT_CRED_CTX_00_04_000 0x11553f0 +#define SELINUX_ENFORCING_CTX_00_04_000 0x129d9bc +#define ADD_INIT_CTX_00_04_000 0x910fc000 +#define ADD_COMMIT_CTX_00_04_000 0x91048108 + +// TAB-A05-BD 00.05.000 +#define COMMIT_CREDS_CTX_00_05_000 0x5a120 +#define AVC_DENY_CTX_00_05_000 0x35acc8 +#define SEL_READ_ENFORCE_CTX_00_05_000 0x3653a8 +#define SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000 0x365d80 +#define INIT_CRED_CTX_00_05_000 0x11553f0 +#define SELINUX_ENFORCING_CTX_00_05_000 0x129d9bc +#define ADD_INIT_CTX_00_05_000 0x910fc000 +#define ADD_COMMIT_CTX_00_05_000 0x91048108 + +// TAB-A05-BD 00.08.000 +#define COMMIT_CREDS_CTX_00_08_000 0x5a120 +#define AVC_DENY_CTX_00_08_000 0x35acc8 +#define SEL_READ_ENFORCE_CTX_00_08_000 0x3653a8 +#define SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000 0x365d80 +#define INIT_CRED_CTX_00_08_000 0x11553f0 +#define SELINUX_ENFORCING_CTX_00_08_000 0x129d9bc +#define ADD_INIT_CTX_00_08_000 0x910fc000 +#define ADD_COMMIT_CTX_00_08_000 0x91048108 + +// TAB-A05-BD 00.09.000 +#define COMMIT_CREDS_CTX_00_09_000 0x5a120 +#define AVC_DENY_CTX_00_09_000 0x35acc8 +#define SEL_READ_ENFORCE_CTX_00_09_000 0x3653a8 +#define SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000 0x365d80 +#define INIT_CRED_CTX_00_09_000 0x11553f0 +#define SELINUX_ENFORCING_CTX_00_09_000 0x129d9bc +#define ADD_INIT_CTX_00_09_000 0x910fc000 +#define ADD_COMMIT_CTX_00_09_000 0x91048108 + // TAB-A05-BD 01.00.000 #define COMMIT_CREDS_CTX_01_00_000 0x5a120 #define AVC_DENY_CTX_01_00_000 0x35acc8 -#define SELINUX_ENFORCING_CTX_01_00_000 0x129d9bc #define SEL_READ_ENFORCE_CTX_01_00_000 0x3653a8 #define SEL_READ_HANDLE_UNKNOWN_CTX_01_00_000 0x365d80 #define INIT_CRED_CTX_01_00_000 0x11553f0 @@ -125,6 +164,16 @@ ADD_COMMIT = add x8, x8, #0x(Last 3 digits of COMMIT_CRED) #define ADD_INIT_CTX_01_11_000 0x910fc000 #define ADD_COMMIT_CTX_01_11_000 0x91048108 +// TAB-A05-BA1 00.03.000 +#define COMMIT_CREDS_CTZ_00_03_000 0x5a120 +#define AVC_DENY_CTZ_00_03_000 0x359c20 +#define SEL_READ_ENFORCE_CTZ_00_03_000 0x364370 +#define SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000 0x364d48 +#define INIT_CRED_CTZ_00_03_000 0x11653f0 +#define SELINUX_ENFORCING_CTZ_00_03_000 0x12d49bc +#define ADD_INIT_CTZ_00_03_000 0x910fc000 +#define ADD_COMMIT_CTZ_00_03_000 0x91048108 + // TAB-A05-BA1 01.00.000 #define COMMIT_CREDS_CTZ_01_00_000 0x5a120 #define AVC_DENY_CTZ_01_00_000 0x359c20 @@ -729,6 +778,34 @@ void select_offset() { int len = __system_property_get("ro.build.fingerprint", fingerprint); LOG("fingerprint: %s\n", fingerprint); + if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.04.000/00.04.000:user/release-keys")) { + selinux_enforcing = SELINUX_ENFORCING_CTX_00_04_000; + sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000; + fixup_root_shell(INIT_CRED_CTX_00_04_000, COMMIT_CREDS_CTX_00_04_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_04_000, ADD_INIT_CTX_00_04_000, ADD_COMMIT_CTX_00_04_000); + return; + } + + if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.05.000/00.05.000:user/release-keys")) { + selinux_enforcing = SELINUX_ENFORCING_CTX_00_05_000; + sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000; + fixup_root_shell(INIT_CRED_CTX_00_05_000, COMMIT_CREDS_CTX_00_05_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_05_000, ADD_INIT_CTX_00_05_000, ADD_COMMIT_CTX_00_05_000); + return; + } + + if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.08.000/00.08.000:user/release-keys")) { + selinux_enforcing = SELINUX_ENFORCING_CTX_00_08_000; + sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000; + fixup_root_shell(INIT_CRED_CTX_00_08_000, COMMIT_CREDS_CTX_00_08_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_08_000, ADD_INIT_CTX_00_08_000, ADD_COMMIT_CTX_00_08_000); + return; + } + + if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/00.09.000/00.09.000:user/release-keys")) { + selinux_enforcing = SELINUX_ENFORCING_CTX_00_09_000; + sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000; + fixup_root_shell(INIT_CRED_CTX_00_09_000, COMMIT_CREDS_CTX_00_09_000, SEL_READ_HANDLE_UNKNOWN_CTX_00_09_000, ADD_INIT_CTX_00_09_000, ADD_COMMIT_CTX_00_09_000); + return; + } + if (!strcmp(fingerprint, "benesse/TAB-A05-BD/TAB-A05-BD:9/01.00.000/01.00.000:user/release-keys")) { selinux_enforcing = SELINUX_ENFORCING_CTX_01_00_000; sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTX_01_00_000; @@ -757,6 +834,13 @@ void select_offset() { return; } + if (!strcmp(fingerprint, "Panasonic/TAB-A05-BA1/TAB-A05-BA1:9/00.03.000/00.03.000:user/release-keys")) { + selinux_enforcing = SELINUX_ENFORCING_CTZ_00_03_000; + sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000; + fixup_root_shell(INIT_CRED_CTZ_00_03_000, COMMIT_CREDS_CTZ_00_03_000, SEL_READ_HANDLE_UNKNOWN_CTZ_00_03_000, ADD_INIT_CTZ_00_03_000, ADD_COMMIT_CTZ_00_03_000); + return; + } + if (!strcmp(fingerprint, "Panasonic/TAB-A05-BA1/TAB-A05-BA1:9/01.00.000/01.00.000:user/release-keys")) { selinux_enforcing = SELINUX_ENFORCING_CTZ_01_00_000; sel_read_handle_unknown = SEL_READ_HANDLE_UNKNOWN_CTZ_01_00_000;