-
Notifications
You must be signed in to change notification settings - Fork 308
Harden program-cache permissions, binary-path resolution, and coredump helper lifetime #2399
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
base: main
Are you sure you want to change the base?
Changes from all commits
749ff87
a243030
c9e5d5d
1c5eb3e
dc8bb9f
c1d2cce
e911dd7
2f5be65
8d6ee67
1d74206
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -397,9 +397,16 @@ def __init__( | |
| self._entries = self._root / _ENTRIES_SUBDIR | ||
| self._tmp = self._root / _TMP_SUBDIR | ||
| self._max_size_bytes = max_size_bytes | ||
| self._root.mkdir(parents=True, exist_ok=True) | ||
| self._entries.mkdir(exist_ok=True) | ||
| self._tmp.mkdir(exist_ok=True) | ||
| # Cache holds compiled device code loaded via cuLibraryLoadData, so keep | ||
| # it owner-only (0o700) so other local users can't read or replace it. | ||
| # mkdir's mode is umask-masked and exist_ok keeps an existing dir's | ||
| # perms, so re-chmod on POSIX. | ||
| self._root.mkdir(parents=True, exist_ok=True, mode=0o700) | ||
| self._entries.mkdir(exist_ok=True, mode=0o700) | ||
| self._tmp.mkdir(exist_ok=True, mode=0o700) | ||
| if os.name != "nt": | ||
| for d in (self._root, self._entries, self._tmp): | ||
| os.chmod(d, 0o700) | ||
|
Comment on lines
+400
to
+409
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure this is acceptable. One can imagine in a compute cluster a group of users want to share the same kernel cache. If the directory already exists, we should use it as-is without changing the permission.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| # Opportunistic startup sweep of orphaned temp files left by any | ||
| # crashed writers. Age-based so concurrent in-flight writes from | ||
| # other processes are preserved. | ||
|
|
||
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 code is part of cybind (which @mdboom is improving). Let's not touch it.