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

Fix sol_get_processed_sibling_instruction on 32-bit hosts #26522

Merged

Conversation

riptl
Copy link
Contributor

@riptl riptl commented Jul 8, 2022

Problem

Syscall sol_get_processed_sibling_instruction writes struct ProcessedSiblingInstruction to VM memory. This struct contains usize parameters, which have different lengths across different architectures. The de-facto host usize is 64-bit on Solana, of course.

32-bit hosts such as wasm32 would write 32-bit values, causing memory corruption in the VM.

Summary of Changes

Changes usize parameters in ProcessedSiblingInstruction to u64. This is a no-op on 64-bit host architectures.

Fixes #

@mergify mergify bot added the community Community contribution label Jul 8, 2022
@mergify mergify bot requested a review from a team July 8, 2022 23:29
@riptl riptl force-pushed the fix-processed-sibling-instruction branch from 5504dcf to 5de4f4b Compare July 9, 2022 00:31
Lichtso
Lichtso previously approved these changes Jul 11, 2022
@Lichtso Lichtso requested a review from jackcmay July 11, 2022 13:06
@riptl riptl force-pushed the fix-processed-sibling-instruction branch from 5de4f4b to c41462e Compare July 27, 2022 15:55
@mergify mergify bot dismissed Lichtso’s stale review July 27, 2022 15:55

Pull request has been modified.

@jackcmay jackcmay merged commit a9a3c62 into solana-labs:master Aug 5, 2022
@jackcmay jackcmay added the v1.11 label Aug 5, 2022
@riptl riptl deleted the fix-processed-sibling-instruction branch August 5, 2022 19:06
mergify bot pushed a commit that referenced this pull request Aug 5, 2022
mergify bot added a commit that referenced this pull request Aug 5, 2022
…26522) (#26958)

Fix sol_get_processed_sibling_instruction on 32-bit hosts (#26522)

(cherry picked from commit a9a3c62)

Co-authored-by: Richard Patel <[email protected]>
apfitzge pushed a commit to apfitzge/agave that referenced this pull request Aug 9, 2022
xiangzhu70 pushed a commit to xiangzhu70/solana that referenced this pull request Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants