bis_protect: guard against autorcm on rcm-patched units

This commit is contained in:
Michael Scire 2019-04-01 17:24:15 -07:00
parent 350dccff3d
commit 262d6af519
3 changed files with 16 additions and 2 deletions

View file

@ -40,6 +40,11 @@ void fuse_init(void)
fuse_make_regs_visible();
fuse_secondary_private_key_disable();
fuse_disable_programming();
/* TODO: Should we allow this to be done later? */
if (!g_has_checked_for_rcm_bug_patch) {
(void)(fuse_has_rcm_bug_patch());
}
/* TODO: Overrides (iROM patches) and various reads happen here */
}

View file

@ -24,7 +24,16 @@ static HosMutex g_boot0_mutex;
static u8 g_boot0_bct_buffer[Boot0Storage::BctEndOffset];
bool Boot0Storage::CanModifyBctPubks() {
return this->title_id != TitleId_Ns;
if (IsRcmBugPatched()) {
/* RCM bug patched. */
/* Only allow NS to update the BCT pubks. */
/* AutoRCM on a patched unit will cause a brick, so homebrew should NOT be allowed to write. */
return this->title_id == TitleId_Ns;
} else {
/* RCM bug unpatched. */
/* Allow homebrew but not NS to update the BCT pubks. */
return this->title_id != TitleId_Ns;
}
}
Result Boot0Storage::Read(void *_buffer, size_t size, u64 offset) {

@ -1 +1 @@
Subproject commit 37b74c7d754c6e6e73278864264940cba4f651db
Subproject commit b6ca2d89ae5106ea21454f332f07076159ad2e92