Skip to content

[F94] enforce max_module_length when loading temp module#5134

Open
peterjah wants to merge 1 commit into
mainfrom
5088-f94-missing-bytecode-length-validation-in-load_tmp_module
Open

[F94] enforce max_module_length when loading temp module#5134
peterjah wants to merge 1 commit into
mainfrom
5088-f94-missing-bytecode-length-validation-in-load_tmp_module

Conversation

@peterjah

Copy link
Copy Markdown
Collaborator
  • document all added functions
  • try in sandbox /simulation/labnet
    • if part of node-launch, checked using the resync_check flag
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

@peterjah peterjah changed the title enforce max_module_length when loading temp module [F94] enforce max_module_length when loading temp module Jul 23, 2026
@peterjah peterjah linked an issue Jul 23, 2026 that may be closed by this pull request
condom_limits: CondomLimits,
) -> Result<RuntimeModule, CacheError> {
debug!("load_tmp_module");
if bytecode.is_empty() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that this is redundent as the runtime checks:

if bytecode.len() <= 2 {
    return Err(anyhow!("Too small bytecode"));
}

@Leo-Besancon Leo-Besancon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left a comment, but I saw that load_module does the same check, you can keep the empty check for consistency if you prefer.

Otherwise LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[F94] Missing Bytecode Length Validation in load_tmp_module

3 participants