Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

[bug fix] Remove incorrect overflow guard #1034

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

tnowacki
Copy link
Member

@tnowacki tnowacki commented Apr 12, 2023

Motivation

Thanks to Zellic and @fcremo for the find and fix!

The guard in get_successors was intended to prevent an overflow, but the check erroneously assumed that the last instruction was a return or an abort. In the case that it was an unconditional jump, the successors would not be captured in the CFG. And as such, the target code would not be visited (if this was the only predecessor). This means that locals safety and reference safety (and any custom, control flow based checks) would not be run on the skipped code.

Test Plan

  • New tests

- Removed incorrect overflow guard
- Added tests
Copy link
Member

@runtian-zhou runtian-zhou left a comment

Choose a reason for hiding this comment

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

Thanks Todd!

@tnowacki tnowacki merged commit dfef14a into move-language:main Apr 12, 2023
@tnowacki tnowacki deleted the offset-fix branch April 12, 2023 23:19
tnowacki added a commit to MystenLabs/sui that referenced this pull request Apr 13, 2023
## Description 

Copying move-language/move#1034

Thanks to [Zellic](https://www.zellic.io/) and @fcremo for the find and
fix!


## Test Plan 

- It is tests

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
bmwill pushed a commit to move-language/move-sui that referenced this pull request Apr 18, 2024
## Description 

Copying move-language/move#1034

Thanks to [Zellic](https://www.zellic.io/) and @fcremo for the find and
fix!


## Test Plan 

- It is tests

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants