Skip to content

Large bulk operations to not have fuel checks/preemption points in the middle #14047

Description

@alexcrichton

For Wasmtime's original 46.0.0 release it originally contained a crop of changes where bulk operations (e.g. memory.copy) were updated to chunk the operation internally when fuel/epochs were enabled with preemption checks in the middle. The goal of this translation was to ensure that a very large memory.copy, such as moving 2GiB of data, wouldn't represent an uninterrputible chunk of work the guest could perform. This was later discovered to be the source of a number of possible security vulnerabilities with epoch callbacks, and this behavior was reverted in #14045 to only check for epochs/fuel at the start of an operation instead of during an operation. This results in a doc block on epochs/fuel, however, that large bulk operations represent uninterruptible chunks of work where the only way to limit them is to limit the total size of a linear memory itself.

This isn't a great situation and we should probably somehow figure out how to add preemption checks in the middle. This'll need to be done relatively carefully to avoid reintroducing the problems that were fixed in #14045.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions