-
Notifications
You must be signed in to change notification settings - Fork 346
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
Return an error when passing unsupported mount options #2308
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2308 +/- ##
==========================================
- Coverage 64.88% 64.80% -0.08%
==========================================
Files 129 129
Lines 15179 15171 -8
==========================================
- Hits 9849 9832 -17
- Misses 5330 5339 +9 |
Signed-off-by: utam0k <k0ma@utam0k.jp>
@@ -118,7 +159,12 @@ pub fn parse_mount(m: &Mount) -> MountOptionConfig { | |||
"norelatime" => Some((true, MsFlags::MS_RELATIME)), | |||
"strictatime" => Some((true, MsFlags::MS_STRICTATIME)), | |||
"nostrictatime" => Some((true, MsFlags::MS_STRICTATIME)), | |||
_ => None, | |||
unknown => { |
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.
Wouldn't this silently ignore unknown mount options that are not idmap? I think we should always return an error here.
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.
For example, mode=755
should be passed these codes, but we don't need to set MsFlags
.
https://github.com/opencontainers/runtime-spec/blob/main/config.md#linux-mount-options
Runtimes SHOULD pass unknown options to mount(2) via the fifth argument (const void *data).
idmap
and ridmap
are defined in OCI Runtime Spec, So users may think these options will affect their mounts and pass them on. But we do not support them and would like to return an error to be safe in this case.
Signed-off-by: utam0k <k0ma@utam0k.jp>
Relate: #2307
https://github.com/opencontainers/runtime-spec/blob/main/config.md#linux-mount-options