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

[TieredStorage] Boundary check for accessing hot account meta #34349

Merged
merged 7 commits into from
Dec 18, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
* formatting
  • Loading branch information
yhchiang-sol committed Dec 18, 2023
commit 09059901a1e157e21315f65010fda657a904f6e0
7 changes: 4 additions & 3 deletions accounts-db/src/tiered_storage/hot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@ impl HotStorageReader {
) -> TieredStorageResult<&HotAccountMeta> {
let internal_account_offset = account_offset.offset();
assert!(
internal_account_offset <=
(self.footer.index_block_offset as usize)
.saturating_sub(std::mem::size_of::<HotAccountMeta>()));
internal_account_offset
<= (self.footer.index_block_offset as usize)
.saturating_sub(std::mem::size_of::<HotAccountMeta>())
);

let (meta, _) = get_pod::<HotAccountMeta>(&self.mmap, internal_account_offset)?;
Ok(meta)
Expand Down