Skip to content

Comments

[ER] Fix a soundness hole in parameter access#230

Merged
vswarte merged 4 commits intovswarte:mainfrom
fswap:param-safety
Feb 21, 2026
Merged

[ER] Fix a soundness hole in parameter access#230
vswarte merged 4 commits intovswarte:mainfrom
fswap:param-safety

Conversation

@nex3
Copy link
Collaborator

@nex3 nex3 commented Feb 16, 2026

As discussed on Discord, providing non-unsafe access to parameters through SoloParamRepository (even immutable access) while also providing mutable access through FD4ParamRepository is a soundness hole unless we explicitly require that only one of these singletons be accessed at a time.

This fixes the issue by making access via FD4ParamRepository require an unsafe block with the condition that no other parameters have access. For a detailed account of why we went this direction, see the comment on FD4ParamRepository.

As discussed on Discord, providing non-`unsafe` access to parameters
through `SoloParamRepository` (even immutable access) while also
providing mutable access through `FD4ParamRepository` is a soundness
hole unless we explicitly require that only one of these singletons be
accessed at a time.

This fixes the issue by making access via `FD4ParamRepository` require
an `unsafe` block with the condition that no other parameters have
access. For a detailed account of why we went this direction, see the
comment on `FD4ParamRepository`.
@nex3 nex3 requested a review from vswarte February 18, 2026 11:04
.find_index(param_id)

// Double-check that the parameter we found is the one we're epxecting.
if res_cap.matches_param::<P>() {
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed to a debug-only assert

@nex3 nex3 requested a review from vswarte February 21, 2026 03:01
@vswarte vswarte merged commit ad93330 into vswarte:main Feb 21, 2026
1 check passed
@nex3 nex3 deleted the param-safety branch February 21, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants