Tighten storage pool permissions (from Incus)#16904
Merged
Merged
Conversation
Related to lxc/incus#2641 Signed-off-by: Stéphane Graber <stgraber@stgraber.org> (cherry picked from commit b0c6c0bac42c6ac27d536984cc043a6ec02b9e7c) Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com> License: Apache-2.0
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the storage pool directory structure by introducing configurable file mode permissions for different volume types. It replaces the simple string slice mapping with a structured approach that includes both directory paths and their associated permissions.
Key Changes
- Introduced
baseDirectorystruct to store both directory paths and file mode permissions - Updated
BaseDirectoriesmap to use the new struct, with 0o711 for containers/VMs/buckets and 0o700 for custom volumes/images - Added a patch to retroactively apply correct permissions to existing storage pools
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lxd/storage/drivers/volume.go | Defines new baseDirectory struct and updates BaseDirectories map with mode permissions |
| lxd/storage/drivers/generic_vfs.go | Updates volume listing to access BaseDirectories[volType].Paths |
| lxd/storage/drivers/driver_zfs_utils.go | Updates initial dataset creation to access BaseDirectories[volType].Paths |
| lxd/storage/drivers/driver_btrfs.go | Updates subvolume deletion to access BaseDirectories[volType].Paths |
| lxd/storage/backend_lxd.go | Updates storage structure creation to use both .Paths and .Mode from new struct, improves error checking with errors.Is(err, fs.ErrExist) |
| lxd/patches.go | Adds patch to apply correct permissions to existing storage pool directories |
7619742 to
f0277a6
Compare
…seDirectories permissions Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
Related to lxc/incus#2641 Signed-off-by: Stéphane Graber <stgraber@stgraber.org> (cherry picked from commit 3abdc12cf6a8dce391d28d340a32c137125357dd) Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com> License: Apache-2.0
973a3f5 to
2fc60bd
Compare
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
MusicDin
approved these changes
Nov 10, 2025
Contributor
|
Is there a timeline for getting this fix into the |
Member
Author
Hi @gibmat I'm working on the backports now:
|
This was referenced Nov 11, 2025
tomponline
added a commit
that referenced
this pull request
Nov 11, 2025
Pulls in fix from lxc/incus#2642 (via #16904) Related to lxc/incus#2641 Fix for [GHSA-56mx-8g9f-5crf](GHSA-56mx-8g9f-5crf) CVE-2025-64507
tomponline
added a commit
that referenced
this pull request
Nov 11, 2025
Pulls in fix from lxc/incus#2642 (from #16904 via #16922) Related to lxc/incus#2641 Fix for [GHSA-56mx-8g9f-5crf](GHSA-56mx-8g9f-5crf) CVE-2025-64507
tomponline
added a commit
that referenced
this pull request
Nov 11, 2025
Pulls in fix from lxc/incus#2642 (from #16904 via #16923) Related to lxc/incus#2641 Fix for [GHSA-56mx-8g9f-5crf](GHSA-56mx-8g9f-5crf) CVE-2025-64507
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pulls in fix from lxc/incus#2642
Related to lxc/incus#2641
Fix for GHSA-56mx-8g9f-5crf CVE-2025-64507