Skip to content
Snippets Groups Projects
  • Al Viro's avatar
    a65001e8
    btrfs: sanitize security_mnt_opts use · a65001e8
    Al Viro authored
    
    1) keeping a copy in btrfs_fs_info is completely pointless - we never
    use it for anything.  Getting rid of that allows for simpler calling
    conventions for setup_security_options() (caller is responsible for
    freeing mnt_opts in all cases).
    
    2) on remount we want to use ->sb_remount(), not ->sb_set_mnt_opts(),
    same as we would if not for FS_BINARY_MOUNTDATA.  Behaviours *are*
    close (in fact, selinux sb_set_mnt_opts() ought to punt to
    sb_remount() in "already initialized" case), but let's handle
    that uniformly.  And the only reason why the original btrfs changes
    didn't go for security_sb_remount() in btrfs_remount() case is that
    it hadn't been exported.  Let's export it for a while - it'll be
    going away soon anyway.
    
    Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    a65001e8
    History
    btrfs: sanitize security_mnt_opts use
    Al Viro authored
    
    1) keeping a copy in btrfs_fs_info is completely pointless - we never
    use it for anything.  Getting rid of that allows for simpler calling
    conventions for setup_security_options() (caller is responsible for
    freeing mnt_opts in all cases).
    
    2) on remount we want to use ->sb_remount(), not ->sb_set_mnt_opts(),
    same as we would if not for FS_BINARY_MOUNTDATA.  Behaviours *are*
    close (in fact, selinux sb_set_mnt_opts() ought to punt to
    sb_remount() in "already initialized" case), but let's handle
    that uniformly.  And the only reason why the original btrfs changes
    didn't go for security_sb_remount() in btrfs_remount() case is that
    it hadn't been exported.  Let's export it for a while - it'll be
    going away soon anyway.
    
    Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.