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

td-payload: check the size for init_shared_memory #663

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions td-payload/src/mm/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ use crate::arch::shared::decrypt;
static SHARED_MEMORY_ALLOCATOR: LockedHeap = LockedHeap::empty();

pub fn init_shared_memory(start: u64, size: usize) {
if size % SIZE_4K != 0 {
panic!("Failed to initialize shared memory: size needs to be aligned with 0x1000");
}

// Set the shared memory region to be shared
decrypt(start, size);
// Initialize the shared memory allocator
Expand Down
Loading