Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix StoreBuilder::inherit_limited_network #2541

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Jun 3, 2024

Previously, this called WasiCtxBuilder::inherit_network, but that had no effect since StoreBuilder::build_with_data later overwrites that setting by calling WasiCtxBuilder::socket_addr_check with a lambda that uses StoreBuilder::net_pool to check addresses. In this case, StoreBuilder::net_pool has not had any subnets added to it, so it denies everything, which is the opposite of what we intended.

The solution is to have StoreBuilder::inherit_limited_network update net_pool to allow all IPv4 and IPv6 networks.

@dicej dicej requested a review from rylev June 3, 2024 19:24
@dicej dicej force-pushed the fix-inherit-limited-network branch from 3896596 to 672e048 Compare June 3, 2024 19:30
Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

Just some nits, but it looks good.

crates/core/src/store.rs Show resolved Hide resolved
crates/core/src/store.rs Show resolved Hide resolved
@dicej dicej enabled auto-merge (squash) June 4, 2024 19:20
@rylev
Copy link
Collaborator

rylev commented Jun 7, 2024

@dicej looks like this got stuck for some reason. I'm not sure, but a rebase might fix things?

@itowlson
Copy link
Contributor

itowlson commented Jun 9, 2024

The DCO app got borked for a while. It is now healthy but it seems like you have to re-push to get it to regenerate status.

Previously, this called `WasiCtxBuilder::inherit_network`, but that had no
effect since `StoreBuilder::build_with_data` later overwrites that setting by
calling `WasiCtxBuilder::socket_addr_check` with a lambda that uses
`StoreBuilder::net_pool` to check addresses.  In this cases,
`StoreBuilder::net_pool` has not had any subnets added to it, so it denies
everything, which is the opposite of what we intended.

The solution is to have `StoreBuilder::inherit_limited_network` update
`net_pool` to allow all IPv4 and IPv6 networks.

Signed-off-by: Joel Dice <[email protected]>

address review feedback

- Rename `StoreBuilder::inherit_limited_network` to `inherit_network`
- Add comments explaining use of `Pool` and CIDR addresses

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej force-pushed the fix-inherit-limited-network branch from e7dcb42 to f08c69b Compare June 10, 2024 14:04
@dicej dicej merged commit 13a133f into fermyon:main Jun 10, 2024
17 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.

3 participants