diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-02 04:42:44 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 17:45:30 +0100 |
commit | 6be8750b4cba8c37170f46b29841d112f1be749b (patch) | |
tree | 0b3386c080d73fc666afcdcd1db5290b990af349 /security/selinux | |
parent | smack: make smack_parse_opts_str() clean up on failure (diff) | |
download | linux-6be8750b4cba8c37170f46b29841d112f1be749b.tar.xz linux-6be8750b4cba8c37170f46b29841d112f1be749b.zip |
LSM: lift parsing LSM options into the caller of ->sb_kern_mount()
This paves the way for retaining the LSM options from a common filesystem
mount context during a mount parameter parsing phase to be instituted prior
to actual mount/reconfiguration actions.
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 4bd6f9435e2f..ba229d4a64d3 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2897,30 +2897,12 @@ out_bad_option: goto out_free_opts; } -static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data) +static int selinux_sb_kern_mount(struct super_block *sb, int flags, + struct security_mnt_opts *opts) { - char *options = data; const struct cred *cred = current_cred(); struct common_audit_data ad; - int rc = 0; - struct security_mnt_opts opts; - - security_init_mnt_opts(&opts); - - if (!data) - goto out; - - BUG_ON(sb->s_type->fs_flags & FS_BINARY_MOUNTDATA); - - rc = selinux_parse_opts_str(options, &opts); - if (rc) - goto out_err; - -out: - rc = selinux_set_mnt_opts(sb, &opts, 0, NULL); - -out_err: - security_free_mnt_opts(&opts); + int rc = selinux_set_mnt_opts(sb, opts, 0, NULL); if (rc) return rc; |