mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
MdeModulePkg/UfsPassThruDxe: Fix v2 protocol backward compatibility
Commit b58ce4c226 broke backward compatibility with v2 platform
protocols by incorrectly skipping HCE re-enable for v2 implementations.
When used with a UfsPlatform.efi binary that was compiled against
an older stable tag, (where EDKII_UFS_HC_PLATFORM_PROTOCOL_VERSION
is defined as 2), the code attempted to read the v3-only
SkipHceReenable/SkipLinkStartup fields beyond the v2 struct boundary,
reading garbage memory and potentially skipping initialization.
Add explicit version check to ensure v2 protocols follow normal
initialization path, preventing out-of-bounds struct access.
TEST=build/boot google/yaviks with UFS storage
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
parent
ef437b30ad
commit
6b18142fdb
1 changed files with 1 additions and 0 deletions
|
|
@ -1866,6 +1866,7 @@ UfsEnableHostController (
|
|||
}
|
||||
|
||||
if ((mUfsHcPlatform == NULL) ||
|
||||
(mUfsHcPlatform->Version < 3) ||
|
||||
((mUfsHcPlatform->Version >= 3) && !mUfsHcPlatform->SkipHceReenable))
|
||||
{
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue