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

Add overflow check in codecopy #444

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Add overflow check in codecopy #444

merged 1 commit into from
Jul 25, 2024

Conversation

Nashtare
Copy link
Collaborator

Addresses Issue I of the audit report.

@Nashtare Nashtare requested a review from muursh as a code owner July 24, 2024 22:06
@github-actions github-actions bot added the crate: evm_arithmetization Anything related to the evm_arithmetization crate. label Jul 24, 2024
// stack: offset + size, total_size, segment, src_ctx, kexit_info, dest_offset, offset, size
SUB // extra_size = offset + size - total_size
// stack: extra_size, segment, src_ctx, kexit_info, dest_offset, offset, size
DUP1 DUP8 SUB
// stack: copy_size = size - extra_size, extra_size, segment, src_ctx, kexit_info, dest_offset, offset, size

// Compute the new dest_offset after actual copies, at which we will start padding with zeroes.
DUP1 DUP7 ADD
DUP1 DUP7 ADD // We already checked for overflow.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(the check is done prior entering codecopy_after_checks)

@Nashtare Nashtare self-assigned this Jul 24, 2024
@Nashtare Nashtare merged commit ed6a657 into develop Jul 25, 2024
14 checks passed
@Nashtare Nashtare deleted the codecopy_overflow branch July 25, 2024 12:55
@Nashtare Nashtare added this to the Type 1 - Q3 2024 milestone Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate: evm_arithmetization Anything related to the evm_arithmetization crate.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants