Skip to content

wasmtime-cache: Reject overflowing duration values - #14060

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
racequite:fix/cache-duration-overflow
Aug 3, 2026
Merged

wasmtime-cache: Reject overflowing duration values#14060
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
racequite:fix/cache-duration-overflow

Conversation

@racequite

Copy link
Copy Markdown
Contributor

The cache configuration duration deserializer uses unchecked multiplication when converting minutes, hours, and days to seconds. Oversized values therefore panic when overflow checks are enabled and wrap otherwise. For example, 307445734561825861m wraps to 44 seconds in a release build and is then accepted by configuration validation.

Use u64::checked_mul for the affected units so overflow is reported through the existing invalid-configuration path. Add regression coverage for the first overflowing minute, hour, and day values.

@racequite
racequite requested a review from a team as a code owner August 1, 2026 17:49
@racequite
racequite requested review from dicej and removed request for a team August 1, 2026 17:49
@alexcrichton
alexcrichton added this pull request to the merge queue Aug 3, 2026
Merged via the queue into bytecodealliance:main with commit a240184 Aug 3, 2026
53 checks passed
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.

2 participants