diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-11-17 12:09:18 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-12-21 11:46:00 -0500 |
commit | f5c0c26d9008b355babb6d16f3d7c4de3bada0e7 (patch) | |
tree | 27370bd41579aa94dd36056956554e922a4455f9 /include/linux/security.h | |
parent | c039bc3c2498724946304a8f964244a9b6af1043 (diff) | |
download | lwn-f5c0c26d9008b355babb6d16f3d7c4de3bada0e7.tar.gz lwn-f5c0c26d9008b355babb6d16f3d7c4de3bada0e7.zip |
new helper: security_sb_eat_lsm_opts()
combination of alloc_secdata(), security_sb_copy_data(),
security_sb_parse_opt_str() and free_secdata().
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index 4fc6d98bc7a6..262e59838803 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -248,7 +248,7 @@ void security_bprm_committing_creds(struct linux_binprm *bprm); void security_bprm_committed_creds(struct linux_binprm *bprm); int security_sb_alloc(struct super_block *sb); void security_sb_free(struct super_block *sb); -int security_sb_copy_data(char *orig, char *copy); +int security_sb_eat_lsm_opts(char *options, struct security_mnt_opts *opts); int security_sb_remount(struct super_block *sb, struct security_mnt_opts *opts); int security_sb_kern_mount(struct super_block *sb, int flags, struct security_mnt_opts *opts); @@ -556,7 +556,8 @@ static inline int security_sb_alloc(struct super_block *sb) static inline void security_sb_free(struct super_block *sb) { } -static inline int security_sb_copy_data(char *orig, char *copy) +static inline int security_sb_eat_lsm_opts(char *options, + struct security_mnt_opts *opts) { return 0; } @@ -1823,28 +1824,5 @@ static inline void security_bpf_prog_free(struct bpf_prog_aux *aux) #endif /* CONFIG_SECURITY */ #endif /* CONFIG_BPF_SYSCALL */ -#ifdef CONFIG_SECURITY - -static inline char *alloc_secdata(void) -{ - return (char *)get_zeroed_page(GFP_KERNEL); -} - -static inline void free_secdata(void *secdata) -{ - free_page((unsigned long)secdata); -} - -#else - -static inline char *alloc_secdata(void) -{ - return (char *)1; -} - -static inline void free_secdata(void *secdata) -{ } -#endif /* CONFIG_SECURITY */ - #endif /* ! __LINUX_SECURITY_H */ |