]> www.infradead.org Git - users/willy/linux.git/commit
vfs: Add LSM hooks for the new mount API
authorDavid Howells <dhowells@redhat.com>
Tue, 11 Sep 2018 21:20:54 +0000 (22:20 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 23 Oct 2018 16:38:56 +0000 (17:38 +0100)
commitdbcf22bfca6dde0a8bfa98892df16a44dc0be336
tree92a18b1aa0ffc4e764b45ce0db70246a230d30c5
parent229e55402816034ecc80f12b9b25f7f32ca6b127
vfs: Add LSM hooks for the new mount API

Add LSM hooks for use by the new mount API and filesystem context code.
This includes:

 (1) Hooks to handle allocation, duplication and freeing of the security
     record attached to a filesystem context.

 (2) A hook to snoop source specifications.  There may be multiple of these
     if the filesystem supports it.  They will to be local files/devices if
     fs_context::source_is_dev is true and will be something else, possibly
     remote server specifications, if false.

 (3) A hook to snoop superblock configuration options in key[=val] form.
     If the LSM decides it wants to handle it, it can suppress the option
     being passed to the filesystem.  Note that 'val' may include commas
     and binary data with the fsopen patch.

 (4) A hook to perform validation and allocation after the configuration
     has been done but before the superblock is allocated and set up.

 (5) A hook to transfer the security from the context to a newly created
     superblock.

 (6) A hook to rule on whether a path point can be used as a mountpoint.

These are intended to replace:

security_sb_copy_data
security_sb_kern_mount
security_sb_mount
security_sb_set_mnt_opts
security_sb_clone_mnt_opts
security_sb_parse_opts_str

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-security-module@vger.kernel.org
include/linux/lsm_hooks.h
include/linux/security.h
security/security.c