Skip to content

Commit b71db54

Browse files
author
Miklos Szeredi
committed
ovl: don't require "metacopy=on" for "verity"
This allows the "verity" mount option to be used with "userxattr" data-only layer(s). Also it allows dropping the "metacopy=on" option when the "datadir+" option is to be used. This cleanly separates the two features that have been lumped together under "metacopy=on": - data-redirect: data access is redirected to the data-only layer - meta-copy: copy up metadata only if possible Previous patches made sure that with "userxattr" metacopy only works in the lower -> data scenario. In this scenario the lower (metadata) layer must be secured against tampering, in which case the verity checksums contained in this layer can ensure integrity of data even in the case of an untrusted data layer. Reviewed-by: Amir Goldstein <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 5ef7bcd commit b71db54

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

fs/overlayfs/params.c

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -871,37 +871,20 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
871871
config->uuid = OVL_UUID_NULL;
872872
}
873873

874-
/* Resolve verity -> metacopy dependency */
875-
if (config->verity_mode && !config->metacopy) {
876-
/* Don't allow explicit specified conflicting combinations */
877-
if (set.metacopy) {
878-
pr_err("conflicting options: metacopy=off,verity=%s\n",
879-
ovl_verity_mode(config));
880-
return -EINVAL;
881-
}
882-
/* Otherwise automatically enable metacopy. */
883-
config->metacopy = true;
884-
}
885-
886874
/*
887875
* This is to make the logic below simpler. It doesn't make any other
888876
* difference, since redirect_dir=on is only used for upper.
889877
*/
890878
if (!config->upperdir && config->redirect_mode == OVL_REDIRECT_FOLLOW)
891879
config->redirect_mode = OVL_REDIRECT_ON;
892880

893-
/* Resolve verity -> metacopy -> redirect_dir dependency */
881+
/* metacopy -> redirect_dir dependency */
894882
if (config->metacopy && config->redirect_mode != OVL_REDIRECT_ON) {
895883
if (set.metacopy && set.redirect) {
896884
pr_err("conflicting options: metacopy=on,redirect_dir=%s\n",
897885
ovl_redirect_mode(config));
898886
return -EINVAL;
899887
}
900-
if (config->verity_mode && set.redirect) {
901-
pr_err("conflicting options: verity=%s,redirect_dir=%s\n",
902-
ovl_verity_mode(config), ovl_redirect_mode(config));
903-
return -EINVAL;
904-
}
905888
if (set.redirect) {
906889
/*
907890
* There was an explicit redirect_dir=... that resulted
@@ -970,7 +953,7 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
970953
}
971954

972955

973-
/* Resolve userxattr -> !redirect && !metacopy && !verity dependency */
956+
/* Resolve userxattr -> !redirect && !metacopy dependency */
974957
if (config->userxattr) {
975958
if (set.redirect &&
976959
config->redirect_mode != OVL_REDIRECT_NOFOLLOW) {
@@ -982,11 +965,6 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx,
982965
pr_err("conflicting options: userxattr,metacopy=on\n");
983966
return -EINVAL;
984967
}
985-
if (config->verity_mode) {
986-
pr_err("conflicting options: userxattr,verity=%s\n",
987-
ovl_verity_mode(config));
988-
return -EINVAL;
989-
}
990968
/*
991969
* Silently disable default setting of redirect and metacopy.
992970
* This shall be the default in the future as well: these

0 commit comments

Comments
 (0)