* [PATCH V2] Fix mounting with MS_I_VERSION
@ 2017-10-18 20:56 Matthew Garrett
2017-10-18 21:43 ` David Howells
2017-10-18 22:52 ` Al Viro
0 siblings, 2 replies; 4+ messages in thread
From: Matthew Garrett @ 2017-10-18 20:56 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Matthew Garrett, David Howells, Alexander Viro, stable
commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from
internal superblock flags") reworked the flags that are passed through
do mount, and in the process dropped MS_I_VERSION. Confusingly, things
continue working if the i_version mount option is used because that's
directly passed to ext4 which interprets it, while iversion is turned
into MS_I_VERSION and dropped on the floor. This breaks IMA and EVM and
my heart. Pass SB_I_VERSION through, and update the consumers to use it
instead of MS_I_VERSION.
Signed-off-by: Matthew Garrett <mjg59@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: stable@vger.kernel.org
---
fs/btrfs/super.c | 2 +-
fs/ext4/super.c | 4 ++--
fs/fuse/inode.c | 2 +-
fs/namespace.c | 3 ++-
fs/xfs/xfs_super.c | 2 +-
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 35a128acfbd1..161694b66038 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1135,7 +1135,7 @@ static int btrfs_fill_super(struct super_block *sb,
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
sb->s_flags |= MS_POSIXACL;
#endif
- sb->s_flags |= MS_I_VERSION;
+ sb->s_flags |= SB_I_VERSION;
sb->s_iflags |= SB_I_CGROUPWB;
err = super_setup_bdi(sb);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b104096fce9e..b0915b734a38 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1677,7 +1677,7 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
sbi->s_mount_flags |= EXT4_MF_FS_ABORTED;
return 1;
case Opt_i_version:
- sb->s_flags |= MS_I_VERSION;
+ sb->s_flags |= SB_I_VERSION;
return 1;
case Opt_lazytime:
sb->s_flags |= MS_LAZYTIME;
@@ -2060,7 +2060,7 @@ static int _ext4_show_options(struct seq_file *seq, struct super_block *sb,
SEQ_OPTS_PRINT("min_batch_time=%u", sbi->s_min_batch_time);
if (nodefs || sbi->s_max_batch_time != EXT4_DEF_MAX_BATCH_TIME)
SEQ_OPTS_PRINT("max_batch_time=%u", sbi->s_max_batch_time);
- if (sb->s_flags & MS_I_VERSION)
+ if (sb->s_flags & SB_I_VERSION)
SEQ_OPTS_PUTS("i_version");
if (nodefs || sbi->s_stripe)
SEQ_OPTS_PRINT("stripe=%lu", sbi->s_stripe);
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 65c88379a3a1..94a745acaef8 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1059,7 +1059,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
if (sb->s_flags & MS_MANDLOCK)
goto err;
- sb->s_flags &= ~(MS_NOSEC | MS_I_VERSION);
+ sb->s_flags &= ~(MS_NOSEC | SB_I_VERSION);
if (!parse_fuse_opt(data, &d, is_bdev))
goto err;
diff --git a/fs/namespace.c b/fs/namespace.c
index 3b601f115b6c..d18deb4c410b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2825,7 +2825,8 @@ long do_mount(const char *dev_name, const char __user *dir_name,
SB_MANDLOCK |
SB_DIRSYNC |
SB_SILENT |
- SB_POSIXACL);
+ SB_POSIXACL |
+ SB_I_VERSION);
if (flags & MS_REMOUNT)
retval = do_remount(&path, flags, sb_flags, mnt_flags,
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 584cf2d573ba..f663022353c0 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1637,7 +1637,7 @@ xfs_fs_fill_super(
/* version 5 superblocks support inode version counters. */
if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5)
- sb->s_flags |= MS_I_VERSION;
+ sb->s_flags |= SB_I_VERSION;
if (mp->m_flags & XFS_MOUNT_DAX) {
xfs_warn(mp,
--
2.15.0.rc1.287.g2b38de12cc-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V2] Fix mounting with MS_I_VERSION
2017-10-18 20:56 [PATCH V2] Fix mounting with MS_I_VERSION Matthew Garrett
@ 2017-10-18 21:43 ` David Howells
2017-10-18 22:52 ` Al Viro
1 sibling, 0 replies; 4+ messages in thread
From: David Howells @ 2017-10-18 21:43 UTC (permalink / raw)
To: Matthew Garrett; +Cc: dhowells, linux-fsdevel, Alexander Viro, stable
Matthew Garrett <mjg59@google.com> wrote:
> commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from
> internal superblock flags") reworked the flags that are passed through
> do mount, and in the process dropped MS_I_VERSION. Confusingly, things
> continue working if the i_version mount option is used because that's
> directly passed to ext4 which interprets it, while iversion is turned
> into MS_I_VERSION and dropped on the floor. This breaks IMA and EVM and
> my heart. Pass SB_I_VERSION through, and update the consumers to use it
> instead of MS_I_VERSION.
>
> Signed-off-by: Matthew Garrett <mjg59@google.com>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: stable@vger.kernel.org
Reviewed-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] Fix mounting with MS_I_VERSION
2017-10-18 20:56 [PATCH V2] Fix mounting with MS_I_VERSION Matthew Garrett
2017-10-18 21:43 ` David Howells
@ 2017-10-18 22:52 ` Al Viro
2017-10-18 22:53 ` Matthew Garrett
1 sibling, 1 reply; 4+ messages in thread
From: Al Viro @ 2017-10-18 22:52 UTC (permalink / raw)
To: Matthew Garrett; +Cc: linux-fsdevel, David Howells, stable
On Wed, Oct 18, 2017 at 01:56:26PM -0700, Matthew Garrett wrote:
> commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from
> internal superblock flags") reworked the flags that are passed through
> do mount, and in the process dropped MS_I_VERSION. Confusingly, things
> continue working if the i_version mount option is used because that's
> directly passed to ext4 which interprets it, while iversion is turned
> into MS_I_VERSION and dropped on the floor. This breaks IMA and EVM and
> my heart. Pass SB_I_VERSION through, and update the consumers to use it
> instead of MS_I_VERSION.
Remaining bits applied on top of "vfs: fix mounting a filesystem with i_version".
And AFAICS Cc:stable is wrong - e462ec50cb5fa is not in 4.13...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V2] Fix mounting with MS_I_VERSION
2017-10-18 22:52 ` Al Viro
@ 2017-10-18 22:53 ` Matthew Garrett
0 siblings, 0 replies; 4+ messages in thread
From: Matthew Garrett @ 2017-10-18 22:53 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, David Howells, stable
On Wed, Oct 18, 2017 at 3:52 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Wed, Oct 18, 2017 at 01:56:26PM -0700, Matthew Garrett wrote:
>> commit e462ec50cb5fa ("VFS: Differentiate mount flags (MS_*) from
>> internal superblock flags") reworked the flags that are passed through
>> do mount, and in the process dropped MS_I_VERSION. Confusingly, things
>> continue working if the i_version mount option is used because that's
>> directly passed to ext4 which interprets it, while iversion is turned
>> into MS_I_VERSION and dropped on the floor. This breaks IMA and EVM and
>> my heart. Pass SB_I_VERSION through, and update the consumers to use it
>> instead of MS_I_VERSION.
>
> Remaining bits applied on top of "vfs: fix mounting a filesystem with i_version".
> And AFAICS Cc:stable is wrong - e462ec50cb5fa is not in 4.13...
Yes, my mistake. Sorry about that.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-18 22:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-18 20:56 [PATCH V2] Fix mounting with MS_I_VERSION Matthew Garrett
2017-10-18 21:43 ` David Howells
2017-10-18 22:52 ` Al Viro
2017-10-18 22:53 ` Matthew Garrett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox