v3.0: Fix - Restrict address space of sysvar syscalls in SIMD-0219 (backport of #7832)#7959
Merged
Conversation
* Restrict address space of sysvar syscalls as well (similar to CPI). * Adds a test for the new restriction. (cherry picked from commit 2581e3f)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v3.0 #7959 +/- ##
=======================================
Coverage 83.4% 83.4%
=======================================
Files 810 810
Lines 365311 365317 +6
=======================================
+ Hits 304985 304994 +9
+ Misses 60326 60323 -3 🚀 New features to boost your workflow:
|
buffalojoec
previously approved these changes
Sep 9, 2025
LucasSte
previously approved these changes
Sep 9, 2025
|
Should the rekey be part of the same backport PR? |
|
Yep, discussed it on the backports meeting. |
buffalojoec
approved these changes
Sep 10, 2025
bw-solana
approved these changes
Sep 11, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
ABI v1 aligns the account input region to 8 bytes. Direct mapping however uses the account data allocations which align to at least 16 bytes. Syscalls check the host alignment of translated pointers. This means that syscalls which require a 16 byte alignment suddenly pass the alignment check even if their virtual address is only divisible by 8 but not 16. Currently, only the sysvars syscall has a 16 byte alignment requirement. Thus, preventing that from accessing the account input section masks this behavior.
The SDK uses the stack as destination except for the generic
get_sysvar()syscall, which could have the account input region as destination. Also, see section "Syscall parameters" in SIMD-0219.Summary of Changes
Restricts the
var_addrparameter of all sysvar syscalls whenstricter_abi_and_runtime_constraintsis active.This is an automatic backport of pull request #7832 done by [Mergify](https://mergify.com).