Explicitly harden some shared prototypes #8738
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refs: endojs/endo#1939
Description
While investigating endojs/endo#1686 I found out that a few prototypes (mostly generators) are not explicitly hardened, resulting on our reliance on harden transitively hardening the prototype chain.
To avoid these cases of late hardening of shared mutable objects, this PR explicitly hardens all found occurrences.
Security Considerations
More explicit hardening brings more security
Scaling Considerations
None
Documentation Considerations
None
Testing Considerations
These occurrences were found by grep for generators, and testing in #8700 which failed in case of implicit hardening of prototypes through instances. There may be others shared prototypes lurking, but until we have shallow hardening actually implemented, we won't find them all.
Upgrade Considerations
All packages changes were split in separate commits.
Some changes only require a chain software upgrade, some change would require a vat upgrade, and one requires an upgrade of all vats to pick up a liveslots change. However the early harden should have no impact on the outcome of a program, and thus can be included when convenient.