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

Do verification on the stratisd side for Clevis configs to avoid hanging #3613

Merged
merged 2 commits into from
May 16, 2024

Conversation

jbaublitz
Copy link
Member

Related to latchset/clevis#241

@jbaublitz jbaublitz requested a review from mulkieran May 7, 2024 15:34
@jbaublitz jbaublitz self-assigned this May 7, 2024
@jbaublitz jbaublitz added this to In progress (long term) in 2024May via automation May 7, 2024
@jbaublitz jbaublitz moved this from In progress (long term) to In progress in 2024May May 7, 2024
@jbaublitz jbaublitz force-pushed the issue-clevis-241 branch 8 times, most recently from c42f3f5 to 21cd1fa Compare May 8, 2024 19:30
@jbaublitz jbaublitz mentioned this pull request May 8, 2024
@jbaublitz jbaublitz moved this from In progress to In review in 2024May May 8, 2024
Copy link
Member

@mulkieran mulkieran left a comment

Choose a reason for hiding this comment

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

This all makes sense to me. My only concern is that it might be possible to pass a config that causes a stack overflow during the recursive execution of all_tang_configs_have_thp. I think there should be some way to prevent that from happening.

@mulkieran mulkieran moved this from In review to In progress in 2024May May 8, 2024
@jbaublitz
Copy link
Member Author

That is arguably already possible in other parts of the code given that we take a similar recursive approach when parsing Clevis tokens from disk to provide the reconstructed config to the user over the D-Bus. How would you recommend approaching preventing this in both cases? Adding a parameter to limit the number of recursions we can reach?

@mulkieran
Copy link
Member

That is arguably already possible in other parts of the code given that we take a similar recursive approach when parsing Clevis tokens from disk to provide the reconstructed config to the user over the D-Bus. How would you recommend approaching preventing this in both cases? Adding a parameter to limit the number of recursions we can reach?

Until now, we weren't recursively exploring the config, we were essentially passing it directly through to Clevis. But now that we're recursively exploring something that is sent over the D-Bus, I think that the additional caution is warranted. I'm not sure if parsing the Clevis tokens from disk is analogous, but it may well be.

A recursion limit would be fine, I think.

@jbaublitz jbaublitz moved this from In progress to In review in 2024May May 14, 2024
@jbaublitz
Copy link
Member Author

I've added the recursion limit.

Copy link

Cockpit tests failed for commit 524efe0. @martinpitt, @jelly, @mvollmer please check.

@jbaublitz
Copy link
Member Author

@martinpitt Is this a known issue with cockpit? It seems to be affecting all new PRs with stratisd. @mulkieran believes this is not a problem in our master branch.

@jbaublitz jbaublitz requested a review from mulkieran May 14, 2024 15:53
Copy link
Member

@mulkieran mulkieran left a comment

Choose a reason for hiding this comment

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

Looks good.

@jbaublitz jbaublitz merged commit d51d987 into stratis-storage:master May 16, 2024
46 of 47 checks passed
2024May automation moved this from In review to Done May 16, 2024
@mulkieran mulkieran moved this from Done (2) to Done (3) in 2024May May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2024May
Done (3)
Development

Successfully merging this pull request may close these issues.

None yet

2 participants