Skip to content

Commit

Permalink
Revert "kernel: deny all unexpected signature block"
Browse files Browse the repository at this point in the history
This reverts commit 869cd50.
  • Loading branch information
tiann committed Mar 30, 2024
1 parent d533c27 commit 942866d
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions kernel/apk_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,28 +241,19 @@ static __always_inline bool check_v2_signature(char *path,
offset = 4;
if (id == 0x7109871au) {
v2_signing_blocks++;
if (v2_signing_blocks > 1) {
pr_info("Unexpected v2 signature count: %d\n",
v2_signing_blocks);
v2_signing_valid = false;
goto clean;
}
v2_signing_valid =
check_block(fp, &size4, &pos, &offset,
expected_size, expected_sha256);
} else if (id == 0xf05368c0u) {
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#73
v3_signing_exist = true;
pr_warn("Unexpected V3 sigauture exist!\n");
goto clean;
} else if (id == 0x1b93ad61u) {
// http://aospxref.com/android-14.0.0_r2/xref/frameworks/base/core/java/android/util/apk/ApkSignatureSchemeV3Verifier.java#74
v3_1_signing_exist = true;
pr_warn("Unexpected V3_1 sigauture exist!\n");
goto clean;
} else {
pr_info("Unknown singature block id: 0x%08x\n", id);
goto clean;
#ifdef CONFIG_KSU_DEBUG
pr_info("Unknown id: 0x%08x\n", id);
#endif
}
pos += (size8 - offset);
}
Expand Down Expand Up @@ -315,8 +306,8 @@ static struct kernel_param_ops expected_size_ops = {
.get = param_get_uint,
};

module_param_cb(ksu_debug_manager_uid, &expected_size_ops,
&ksu_debug_manager_uid, S_IRUSR | S_IWUSR);
module_param_cb(ksu_debug_manager_uid, &expected_size_ops, &ksu_debug_manager_uid,
S_IRUSR | S_IWUSR);

#endif

Expand Down

0 comments on commit 942866d

Please sign in to comment.