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

cpi: direct_mapping: always zero spare capacity if account alloc changes #34141

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

alessandrod
Copy link
Contributor

If the vector holding an account is reallocated during execution of a callee, we must zero the spare capacity regardless of whether the account size changed, because the underlying vector might contain uninitialized memory in the spare capacity.

@alessandrod alessandrod added the v1.17 PRs that should be backported to v1.17 label Nov 17, 2023
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #34141 (814862f) into master (9a7b681) will decrease coverage by 0.1%.
The diff coverage is 83.8%.

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #34141     +/-   ##
=========================================
- Coverage    81.9%    81.9%   -0.1%     
=========================================
  Files         819      819             
  Lines      218926   218926             
=========================================
- Hits       179323   179322      -1     
- Misses      39603    39604      +1     

Copy link
Contributor

mergify bot commented Nov 17, 2023

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

If the vector holding an account is reallocated during execution of a callee,
we must zero the spare capacity regardless of whether the account size changed,
because the underlying vector might contain uninitialized memory in the spare
capacity.
@alessandrod alessandrod merged commit d9147d7 into solana-labs:master Nov 20, 2023
32 checks passed
mergify bot pushed a commit that referenced this pull request Nov 20, 2023
…ges (#34141)

If the vector holding an account is reallocated during execution of a callee,
we must zero the spare capacity regardless of whether the account size changed,
because the underlying vector might contain uninitialized memory in the spare
capacity.

(cherry picked from commit d9147d7)

# Conflicts:
#	programs/bpf_loader/src/syscalls/cpi.rs
alessandrod added a commit that referenced this pull request Nov 28, 2023
…ges (#34141)

If the vector holding an account is reallocated during execution of a callee,
we must zero the spare capacity regardless of whether the account size changed,
because the underlying vector might contain uninitialized memory in the spare
capacity.
alessandrod added a commit that referenced this pull request Nov 28, 2023
…oc changes (backport of #34141) (#34177)

cpi: direct_mapping: always zero spare capacity if account alloc changes (#34141)

If the vector holding an account is reallocated during execution of a callee,
we must zero the spare capacity regardless of whether the account size changed,
because the underlying vector might contain uninitialized memory in the spare
capacity.

Co-authored-by: Alessandro Decina <alessandro.d@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.17 PRs that should be backported to v1.17
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants