Skip to content

Harden VTL memory protection function#763

Open
sangho2 wants to merge 3 commits intomainfrom
sanghle/lvbs/fix_mem_protection_range
Open

Harden VTL memory protection function#763
sangho2 wants to merge 3 commits intomainfrom
sanghle/lvbs/fix_mem_protection_range

Conversation

@sangho2
Copy link
Copy Markdown
Contributor

@sangho2 sangho2 commented Apr 10, 2026

This PR hardens the VTL memory protection function(s). Currently, the VTL memory protection function doesn't check whether the given physical memory range belongs to VTL0 or VTL1. This potentially lets the adversary tamper with the VTL1's memory protection.

@sangho2 sangho2 marked this pull request as ready for review April 10, 2026 17:00
Comment thread litebox_platform_lvbs/src/mshv/vsm.rs Outdated
@sangho2 sangho2 force-pushed the sanghle/lvbs/fix_mem_protection_range branch 2 times, most recently from c58e8d6 to b443bd8 Compare April 13, 2026 18:31
@sangho2 sangho2 force-pushed the sanghle/lvbs/fix_mem_protection_range branch 4 times, most recently from c71d1d1 to 666ce54 Compare May 6, 2026 22:57
);

if is_bsp {
if let Ok((start, size)) = get_vtl1_memory_info() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does get_vtl1_memory_info() guarantee to return page aligned start and size?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all HEKI kexec/trampoline physical ranges guaranteed to be page-aligned?

Copy link
Copy Markdown
Contributor Author

@sangho2 sangho2 May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. These start and size are from early boot and they are trusted. If they are malformed, no way to securely boot this VM. And we do use containing_address.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HekiPage data structure does have an is_valid method for various sanity checks.

@sangho2 sangho2 force-pushed the sanghle/lvbs/fix_mem_protection_range branch from 666ce54 to b11dc14 Compare May 8, 2026 23:51
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🤖 SemverChecks 🤖 No breaking API changes detected

Note: this does not mean API is unchanged, or even that there are no breaking changes; simply, none of the detections triggered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants