Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: RuntimeDxe Virtualizes the FVB Protocol Function Pointers #877

Closed
1 task done
os-d opened this issue May 29, 2024 · 2 comments
Closed
1 task done

[Bug]: RuntimeDxe Virtualizes the FVB Protocol Function Pointers #877

os-d opened this issue May 29, 2024 · 2 comments
Assignees
Labels
state:needs-triage Needs to triaged to determine next steps state:stale Has not been updated in a long time type:bug Something isn't working urgency:medium Important with a moderate impact

Comments

@os-d
Copy link
Contributor

os-d commented May 29, 2024

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

RuntimeDxe virtualizes the pointers for the FVB protocol, which is not the typical way that UEFI operates, of virtualize your own pointers. See:

EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->GetBlockSize);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->GetPhysicalAddress);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->GetAttributes);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->SetAttributes);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->Read);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->Write);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance->EraseBlocks);
EfiConvertPointer (0x0, (VOID **)&mVariableModuleGlobal->FvbInstance);
.

This is potentially dangerous, a different FVB protocol provider may do the canonical behavior and virtualize their own protocol pointers, which could harmlessly fail EfiConvertPointer calls or worse could already have been converted into a virtual address that itself maps to a physical address in the VirtualAddressMap and so the second EfiConvertPointer call could succeed and return a new virtual address and have us execute in a random point in the code.

Expected Behavior

The FVB protocol should virtualize the pointers to its protocol itself and not rely on RuntimeDxe to do so.

Steps To Reproduce

Look at code.

Build Environment

- OS(s):
- Tool Chain(s):
- Targets Impacted:
All

Version Information

Top of tree.

Urgency

Medium

Are you going to fix this?

I will fix it

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

@os-d os-d added state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working labels May 29, 2024
@github-actions github-actions bot added urgency:medium Important with a moderate impact labels May 29, 2024
Copy link

This issue has been automatically marked as stale because it has not had activity in 45 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label Aug 24, 2024
Copy link

This issue has been automatically been closed because it did not have any activity in 45 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:needs-triage Needs to triaged to determine next steps state:stale Has not been updated in a long time type:bug Something isn't working urgency:medium Important with a moderate impact
Projects
None yet
Development

No branches or pull requests

1 participant