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

[CSI] Do not allow stage_publish_base_dir to be a sub-directory of mount_dir #19440

Closed
ggriffiths opened this issue Dec 12, 2023 · 4 comments · Fixed by #19441
Closed

[CSI] Do not allow stage_publish_base_dir to be a sub-directory of mount_dir #19440

ggriffiths opened this issue Dec 12, 2023 · 4 comments · Fixed by #19441
Assignees
Milestone

Comments

@ggriffiths
Copy link
Contributor

ggriffiths commented Dec 12, 2023

Nomad version

Any nomad version 1.3.0 or greater

Operating system and Environment details

Any OS

Issue

If a CSI plugin uses mount_dir = /var/lib/test and stage_publish_base_dir = /var/lib/test/publish, then this line will cause all mount points and underlying data to be at risk:
https://github.com/hashicorp/nomad/blob/v1.3.0/client/allocrunner/taskrunner/plugin_supervisor_hook.go#L427-L430

Reproduction steps

Use mount_dir = /var/lib/test and stage_publish_base_dir = /var/lib/test/publish for any CSI driver, and the mount point will not resolve properly and data could be at risk on CSI Plugin restart.

Expected Result

CSI Plugin Stanza validation should fail if stage_publish_base_dir is inside of mount_dir

Actual Result

CSI plugin stanza validation succeeds

Job file (if appropriate)

n/a - CSI plugin and job configuration

Nomad Server logs (if appropriate)

n/a

Nomad Client logs (if appropriate)

n/a

@tgross
Copy link
Member

tgross commented Dec 12, 2023

Hi @ggriffiths! This makes sense to me. I've reviewed your PR and made some comments.

@tgross
Copy link
Member

tgross commented Dec 13, 2023

#19441 has been merged and will ship in Nomad 1.7.2 (plus backports to 1.6 and 1.5)

@ggriffiths
Copy link
Contributor Author

Thank you @tgross !

Copy link

github-actions bot commented Jan 2, 2025

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants