snap-update-ns incorrectly sorts mount profile entries
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
High
|
Samuele Pedroni |
Bug Description
When snap-update-ns processes a pair of mount profiles, current and desired, to determine what needs to be done to transform the current mount profile into the desired mount profile.
The diff-like algorithm works on an array of structures that describe a fstab-like mount entry. Each entry has a destination, or mount location, a mount source and some mount options. The structures are sorted by mount destination, with some quirks, like always doing "over mount" type operations ahead of all other operations.
I believe this algorithm is incorrect because of the following observations:
- a layout creating a tmpfs in $SNAP/foo is sorted AFTER a content bind mount creating a file in $SNAP/foo/a
- the algorithm does not understand bind mounts, where both the mount destination and a mount source is a path, considering only the destination path.
I believe the algorithm should be changed to topological sorting where bind mounts are represented by nodes with two outgoing edges and regular mounts are represented by nodes with only one edge.
description: | updated |
Changed in snapd: | |
assignee: | nobody → Zygmunt Krynicki (zyga) |
importance: | Undecided → High |
Changed in snapd: | |
status: | New → Triaged |
Changed in snapd: | |
assignee: | Zygmunt Krynicki (zyga) → Samuele Pedroni (pedronis) |
Zygmunt was this work ever done?