This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Enforce host aligned memory for program regions #16590
Merged
jackcmay
merged 2 commits into
solana-labs:master
from
jackcmay:enforce-aligned-host_addrs
Apr 20, 2021
Merged
Enforce host aligned memory for program regions #16590
jackcmay
merged 2 commits into
solana-labs:master
from
jackcmay:enforce-aligned-host_addrs
Apr 20, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jackcmay
added
work in progress
This isn't quite right yet
noCI
Suppress CI on this Pull Request
and removed
noCI
Suppress CI on this Pull Request
work in progress
This isn't quite right yet
labels
Apr 16, 2021
jackcmay
force-pushed
the
enforce-aligned-host_addrs
branch
from
April 16, 2021 23:02
d32c5a9
to
0ccb93d
Compare
Codecov Report
@@ Coverage Diff @@
## master #16590 +/- ##
=========================================
- Coverage 83.0% 83.0% -0.1%
=========================================
Files 415 415
Lines 114881 114999 +118
=========================================
+ Hits 95436 95462 +26
- Misses 19445 19537 +92 |
jackcmay
force-pushed
the
enforce-aligned-host_addrs
branch
from
April 19, 2021 20:42
4cb6704
to
7eb149f
Compare
As you are about to bump the RBPF version please re-enable the code here too: solana/programs/bpf_loader/src/syscalls.rs Line 2219 in 7eb149f
|
Lichtso
approved these changes
Apr 20, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓
|
||
if enforce_aligned_host_addrs | ||
&& loader_id != &bpf_loader_deprecated::id() | ||
&& (host_addr as *mut T).align_offset(align_of::<T>()) != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓
// Text search anchor so that it is easier to find: solana_rbpf = "=0.2.7" | ||
// memory_mapping.resize_region::<BpfError>(0, 1).unwrap(); | ||
// assert!(translate_type::<Instruction>(&memory_mapping, 100, &bpf_loader::id()).is_err()); | ||
memory_mapping.resize_region::<BpfError>(0, 1).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✓
mergify bot
pushed a commit
that referenced
this pull request
Apr 20, 2021
(cherry picked from commit 08d5253) # Conflicts: # cli/Cargo.toml # programs/bpf/Cargo.toml # programs/bpf/benches/bpf_loader.rs # programs/bpf/tests/programs.rs # programs/bpf_loader/Cargo.toml # programs/bpf_loader/src/lib.rs
mergify bot
added a commit
that referenced
this pull request
Apr 21, 2021
…6683) * Enforce host aligned memory for program regions (#16590) (cherry picked from commit 08d5253) # Conflicts: # cli/Cargo.toml # programs/bpf/Cargo.toml # programs/bpf/benches/bpf_loader.rs # programs/bpf/tests/programs.rs # programs/bpf_loader/Cargo.toml # programs/bpf_loader/src/lib.rs * fix conflicts Co-authored-by: Jack May <jack@solana.com>
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Depending on the Rust allocator the memory-mapped into the program space could be miss-aligned.
Summary of Changes
This change is wip because it depends on the release of rbpf with: solana-labs/rbpf#154
Fixes #