]> git.baikalelectronics.ru Git - kernel.git/commit
LSM: hide struct security_mnt_opts from any generic code
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 13 Dec 2018 18:41:47 +0000 (13:41 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 Dec 2018 16:48:34 +0000 (11:48 -0500)
commitb260c365ccda70bceb4289598f180248aa4875f6
treeb372464222a21a2a0356fde8421eb86cb991a378
parent3e4e7bab49ac84f7d91277701d57aa934c9345ce
LSM: hide struct security_mnt_opts from any generic code

Keep void * instead, allocate on demand (in parse_str_opts, at the
moment).  Eventually both selinux and smack will be better off
with private structures with several strings in those, rather than
this "counter and two pointers to dynamically allocated arrays"
ugliness.  This commit allows to do that at leisure, without
disrupting anything outside of given module.

Changes:
* instead of struct security_mnt_opt use an opaque pointer
initialized to NULL.
* security_sb_eat_lsm_opts(), security_sb_parse_opts_str() and
security_free_mnt_opts() take it as var argument (i.e. as void **);
call sites are unchanged.
* security_sb_set_mnt_opts() and security_sb_remount() take
it by value (i.e. as void *).
* new method: ->sb_free_mnt_opts().  Takes void *, does
whatever freeing that needs to be done.
* ->sb_set_mnt_opts() and ->sb_remount() might get NULL as
mnt_opts argument, meaning "empty".

Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/super.c
fs/namespace.c
fs/nfs/internal.h
fs/nfs/super.c
fs/super.c
include/linux/lsm_hooks.h
include/linux/security.h
security/security.c
security/selinux/hooks.c
security/smack/smack_lsm.c