diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-05 17:58:35 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 17:46:42 +0100 |
commit | a10d7c22b34bcf744679019269bfb33ebf0b75ee (patch) | |
tree | d8061eb8e92296f6a55d683112c8f8a172f33e83 /fs | |
parent | new helper: security_sb_eat_lsm_opts() (diff) | |
download | linux-a10d7c22b34bcf744679019269bfb33ebf0b75ee.tar.xz linux-a10d7c22b34bcf744679019269bfb33ebf0b75ee.zip |
LSM: split ->sb_set_mnt_opts() out of ->sb_kern_mount()
... leaving the "is it kernel-internal" logics in the caller.
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/super.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/super.c b/fs/super.c index d571527cb8b8..1f75fe312597 100644 --- a/fs/super.c +++ b/fs/super.c @@ -1275,10 +1275,16 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data) smp_wmb(); sb->s_flags |= SB_BORN; - error = security_sb_kern_mount(sb, flags, &opts); + error = security_sb_set_mnt_opts(sb, &opts, 0, NULL); if (error) goto out_sb; + if (!(flags & MS_KERNMOUNT)) { + error = security_sb_kern_mount(sb); + if (error) + goto out_sb; + } + /* * filesystems should never set s_maxbytes larger than MAX_LFS_FILESIZE * but s_maxbytes was an unsigned long long for many releases. Throw |