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
+43
−15
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
Lichtso
reviewed
Feb 19, 2024
sdk/src/account.rs
Outdated
if account.data().is_empty() { | ||
// First, check if the account is empty or all zeros. Empty or all zeros | ||
// accounts are not executable. | ||
if account.data().is_empty() || account.data().iter().all(|&x| x == 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.
That check is too expensive, better to test if the ELF header exists in RBPF.
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.
yeah. That sound like a better idea.
HaoranYi
changed the title
all zeros account should not be executable
Check elf header for executable
Feb 20, 2024
HaoranYi
force-pushed
the
feature/executable
branch
from
February 20, 2024 21:44
2d6684c
to
dbd32e1
Compare
HaoranYi
force-pushed
the
feature/executable
branch
from
February 21, 2024 15:57
0d88a89
to
f237c22
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #35215 +/- ##
=========================================
- Coverage 81.6% 81.6% -0.1%
=========================================
Files 834 834
Lines 224827 224846 +19
=========================================
+ Hits 183538 183553 +15
- Misses 41289 41293 +4 |
This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave |
Moved to anza/agave |
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
Verify elf header for executable for bpf_loader programs.
Summary of Changes
Check elf header for executable
Fixes #