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

If the account length is zero, no data region is present #5122

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

seanyoung
Copy link

This only affects unaligned programs, as for aligned programs the resize area address will match the account region address if the data length is zero.

Problem

When an account is length zero, then there is no account data region. Memcpy's across the data should be permitted since there is no data region.

Found by @topointon-jump

Summary of Changes

Fixes #

@seanyoung seanyoung requested a review from a team as a code owner March 3, 2025 15:46
Copy link

mergify bot commented Mar 3, 2025

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@seanyoung seanyoung force-pushed the unaligned-zero-length branch from 52c6d48 to 588be3a Compare March 3, 2025 16:22
This only affects unaligned programs, as for aligned programs the resize
area address will match the account region address if the data length is
zero.
@seanyoung seanyoung force-pushed the unaligned-zero-length branch from 588be3a to 797913c Compare March 3, 2025 18:36
@seanyoung seanyoung merged commit 561023d into anza-xyz:master Mar 4, 2025
45 of 47 checks passed
@seanyoung seanyoung deleted the unaligned-zero-length branch March 4, 2025 08:39
@seanyoung seanyoung added v2.1 Backport to v2.1 branch v2.2 Backport to v2.2 branch labels Mar 4, 2025
Copy link

mergify bot commented Mar 4, 2025

Backports to the stable 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.

Copy link

mergify bot commented Mar 4, 2025

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.

mergify bot pushed a commit that referenced this pull request Mar 4, 2025
This only affects unaligned programs, as for aligned programs the resize
area address will match the account region address if the data length is
zero.

(cherry picked from commit 561023d)
mergify bot pushed a commit that referenced this pull request Mar 4, 2025
This only affects unaligned programs, as for aligned programs the resize
area address will match the account region address if the data length is
zero.

(cherry picked from commit 561023d)
seanyoung added a commit that referenced this pull request Mar 4, 2025
This only affects unaligned programs, as for aligned programs the resize
area address will match the account region address if the data length is
zero.

(cherry picked from commit 561023d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.1 Backport to v2.1 branch v2.2 Backport to v2.2 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants