-
Notifications
You must be signed in to change notification settings - Fork 58
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
Conversation
54f6cbb
to
aa90167
Compare
c42f3f5
to
21cd1fa
Compare
There was a problem hiding this 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.
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. |
21cd1fa
to
524efe0
Compare
I've added the recursion limit. |
Cockpit tests failed for commit 524efe0. @martinpitt, @jelly, @mvollmer please check. |
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Related to latchset/clevis#241