Allow fscrypt to work in containers#213
Allow fscrypt to work in containers#213ebiggers merged 1 commit intogoogle:masterfrom ebiggers:container-support
Conversation
Update the /proc/self/mountinfo parsing code to allow selecting a Mount with Subtree != "/", i.e. a Mount not of the full filesystem. This is needed to allow fscrypt to work in containers, where the root of the filesystem may not be mounted. See findMainMount() for details about the algorithm used. Resolves #211
|
@josephlr, are you planning to review this? |
|
Hey, sorry for not looking at this sooner. My main concern with any change like this is that we would be too permissive and we would put the What about the following algorithm (for when a device has multiple mounts)?
Note: For all of these (as before) we prefer R/W to R/O if things are otherwise identical. If neither (1) nor (2) identity a unique mount (or they disagree), we say the situation is ambiguous. This also seems easier to explain/document, and is still a strict extension of the existing behavior, as only picking non-bind mounts (i.e. Subtree = "/") is a subset of (2). With this simplification, all the tests would stay passing except for It's not clear to me that any of those are the "main" mountpoint (despite the algorithm choosing Would we lose anything by implementing this simplification? |
|
The problem is that if someone had independent subtrees in one mountpoint tree (like the first three entries above, or like the example from #211 but rooted somewhere other than |
|
@ebiggers that makes sense to me. We take the mounts, discard contained subtrees, then find the the mountpoint that contains all remaining mounts (if it exists). Thanks again for dealing with the complexity in fixing this!! |
Update the /proc/self/mountinfo parsing code to allow selecting a Mount
with Subtree != "/", i.e. a Mount not of the full filesystem. This is
needed to allow fscrypt to work in containers, where the root of the
filesystem may not be mounted.
See findMainMount() for details about the algorithm used.
Resolves #211