aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/lsm_hooks.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 21:48:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-07 21:48:09 -0400
commitf72dae20891d7bcc43e9263ab206960b6ae5209f (patch)
tree59a5b8c026adad15855d3824d1a7014468033274 /include/linux/lsm_hooks.h
parent498e8631f27ed649bd3e31998a00b2b9b288cf3a (diff)
parent35a196bef449b5824033865b963ed9a43fb8c730 (diff)
Merge tag 'selinux-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux updates from Paul Moore: "We've got a few SELinux patches for the v5.2 merge window, the highlights are below: - Add LSM hooks, and the SELinux implementation, for proper labeling of kernfs. While we are only including the SELinux implementation here, the rest of the LSM folks have given the hooks a thumbs-up. - Update the SELinux mdp (Make Dummy Policy) script to actually work on a modern system. - Disallow userspace to change the LSM credentials via /proc/self/attr when the task's credentials are already overridden. The change was made in procfs because all the LSM folks agreed this was the Right Thing To Do and duplicating it across each LSM was going to be annoying" * tag 'selinux-pr-20190507' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: proc: prevent changes to overridden credentials selinux: Check address length before reading address family kernfs: fix xattr name handling in LSM helpers MAINTAINERS: update SELinux file patterns selinux: avoid uninitialized variable warning selinux: remove useless assignments LSM: lsm_hooks.h - fix missing colon in docstring selinux: Make selinux_kernfs_init_security static kernfs: initialize security of newly created nodes selinux: implement the kernfs_init_security hook LSM: add new hook for kernfs node initialization kernfs: use simple_xattrs for security attributes selinux: try security xattr after genfs for kernfs filesystems kernfs: do not alloc iattrs in kernfs_xattr_get kernfs: clean up struct kernfs_iattrs scripts/selinux: fix build selinux: use kernel linux/socket.h for genheaders and mdp scripts/selinux: modernize mdp
Diffstat (limited to 'include/linux/lsm_hooks.h')
-rw-r--r--include/linux/lsm_hooks.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index a240a3fc5fc4..f7e55d0d2672 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -445,6 +445,15 @@
445 * to abort the copy up. Note that the caller is responsible for reading 445 * to abort the copy up. Note that the caller is responsible for reading
446 * and writing the xattrs as this hook is merely a filter. 446 * and writing the xattrs as this hook is merely a filter.
447 * 447 *
448 * Security hooks for kernfs node operations
449 *
450 * @kernfs_init_security:
451 * Initialize the security context of a newly created kernfs node based
452 * on its own and its parent's attributes.
453 *
454 * @kn_dir the parent kernfs node
455 * @kn the new child kernfs node
456 *
448 * Security hooks for file operations 457 * Security hooks for file operations
449 * 458 *
450 * @file_permission: 459 * @file_permission:
@@ -1570,6 +1579,9 @@ union security_list_options {
1570 int (*inode_copy_up)(struct dentry *src, struct cred **new); 1579 int (*inode_copy_up)(struct dentry *src, struct cred **new);
1571 int (*inode_copy_up_xattr)(const char *name); 1580 int (*inode_copy_up_xattr)(const char *name);
1572 1581
1582 int (*kernfs_init_security)(struct kernfs_node *kn_dir,
1583 struct kernfs_node *kn);
1584
1573 int (*file_permission)(struct file *file, int mask); 1585 int (*file_permission)(struct file *file, int mask);
1574 int (*file_alloc_security)(struct file *file); 1586 int (*file_alloc_security)(struct file *file);
1575 void (*file_free_security)(struct file *file); 1587 void (*file_free_security)(struct file *file);
@@ -1871,6 +1883,7 @@ struct security_hook_heads {
1871 struct hlist_head inode_getsecid; 1883 struct hlist_head inode_getsecid;
1872 struct hlist_head inode_copy_up; 1884 struct hlist_head inode_copy_up;
1873 struct hlist_head inode_copy_up_xattr; 1885 struct hlist_head inode_copy_up_xattr;
1886 struct hlist_head kernfs_init_security;
1874 struct hlist_head file_permission; 1887 struct hlist_head file_permission;
1875 struct hlist_head file_alloc_security; 1888 struct hlist_head file_alloc_security;
1876 struct hlist_head file_free_security; 1889 struct hlist_head file_free_security;