-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sbpf: undo rodata footprint optimization
This commit increases the ELF loader's rodata_footprint to be equal to the ELF file size. This increases memory usage by 5-10% for most contracts. The ELF loader made an incorrect assumption that relocations outside of the rodata segment are invisible to the virtual machine. The loader therefore reduced the rodata segment size and skipped those relocations. This is problematic for two reasons: 1) R_BPF_64_32 can read ~15 bytes past the end of the rodata region and conditionally fails loading depending on the content that was read. 2) Some relocations move information from high bits to low bits within a 64-bit value. Chaining those relocations thus allows moving information from outside the rodata segment into the rodata segment. fd_sbpf_loader would have the wrong execution result in both cases.
- Loading branch information
1 parent
225a251
commit 2e27ed1
Showing
2 changed files
with
6 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters