-
Notifications
You must be signed in to change notification settings - Fork 2k
landlock: check path exists on setup #27149
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
Conversation
197a075 to
0db1d9f
Compare
gulducat
left a comment
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.
lgtm!
just a pedantic nitpick on the code comment
| // Add the initial directories, checking for existence | ||
| // prior to adding them. | ||
| for p, mode := range initialDirs { | ||
| _, err := os.Stat(p) | ||
| if err == nil { |
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.
strictly speaking, it's not only checking existence. I suspect we do want to skip adding ones that produce an error of any kind (https://pkg.go.dev/os#pkg-variables) as you do here, but the comment is a tad misleading.
0db1d9f to
9c31a45
Compare
9c31a45 to
47ad7eb
Compare
When setting up landlock with the base set of directories, validate that each directory exists prior to including it within the landlock setup to prevent errors. If other errors are encountered when attempting to stat the path, ignore the path but log the error.
47ad7eb to
c69940e
Compare
gulducat
left a comment
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.
hooray for logging!
Description
When setting up landlock with the base set of directories, validate
that each directory exists prior to including it within the landlock
setup to prevent errors.
Testing & Reproduction steps
Links
Fixes #18721
Contributor Checklist
changelog entry using the
make clcommand.ensure regressions will be caught.
and job configuration, please update the Nomad product documentation, which is stored in the
web-unified-docsrepo. Refer to theweb-unified-docscontributor guide for docs guidelines.Please also consider whether the change requires notes within the upgrade
guide. If you would like help with the docs, tag the
nomad-docsteam in this PR.Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.