Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fs_context: drop the unused lsm_flags member

This isn't ever used by VFS now, and it couldn't even work. Any FS that
uses the SECURITY_LSM_NATIVE_LABELS flag needs to also process the
value returned back from the LSM, so it needs to do its
security_sb_set_mnt_opts() call on its own anyway.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>

authored by

Ondrej Mosnacek and committed by
Christian Brauner (Microsoft)
4e04143c 74e60b8b

+1 -6
-1
Documentation/filesystems/mount_api.rst
··· 79 79 unsigned int sb_flags; 80 80 unsigned int sb_flags_mask; 81 81 unsigned int s_iflags; 82 - unsigned int lsm_flags; 83 82 enum fs_context_purpose purpose:8; 84 83 ... 85 84 };
-3
fs/nfs/super.c
··· 1274 1274 if (ctx->clone_data.sb->s_flags & SB_SYNCHRONOUS) 1275 1275 fc->sb_flags |= SB_SYNCHRONOUS; 1276 1276 1277 - if (server->caps & NFS_CAP_SECURITY_LABEL) 1278 - fc->lsm_flags |= SECURITY_LSM_NATIVE_LABELS; 1279 - 1280 1277 /* Get a superblock - note that we may end up sharing one that already exists */ 1281 1278 fc->s_fs_info = server; 1282 1279 s = sget_fc(fc, compare_super, nfs_set_super);
-1
include/linux/fs_context.h
··· 104 104 unsigned int sb_flags; /* Proposed superblock flags (SB_*) */ 105 105 unsigned int sb_flags_mask; /* Superblock flags that were changed */ 106 106 unsigned int s_iflags; /* OR'd with sb->s_iflags */ 107 - unsigned int lsm_flags; /* Information flags from the fs to the LSM */ 108 107 enum fs_context_purpose purpose:8; 109 108 enum fs_context_phase phase:8; /* The phase the context is in */ 110 109 bool need_free:1; /* Need to call ops->free() */
+1 -1
include/linux/security.h
··· 68 68 /* If capable is being called by a setid function */ 69 69 #define CAP_OPT_INSETID BIT(2) 70 70 71 - /* LSM Agnostic defines for fs_context::lsm_flags */ 71 + /* LSM Agnostic defines for security_sb_set_mnt_opts() flags */ 72 72 #define SECURITY_LSM_NATIVE_LABELS 1 73 73 74 74 struct ctl_table;