Merge tag 'selinux-pr-20190917' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/kernel/linux-rpi.git] / include / linux / lsm_hooks.h
index df1318d..3fced58 100644 (file)
  *     Check for permission to change root directory.
  *     @path contains the path structure.
  *     Return 0 if permission is granted.
+ * @path_notify:
+ *     Check permissions before setting a watch on events as defined by @mask,
+ *     on an object at @path, whose type is defined by @obj_type.
  * @inode_readlink:
  *     Check the permission to read the symbolic link.
  *     @dentry contains the dentry structure for the file link.
@@ -1535,7 +1538,9 @@ union security_list_options {
        int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid);
        int (*path_chroot)(const struct path *path);
 #endif
-
+       /* Needed for inode based security check */
+       int (*path_notify)(const struct path *path, u64 mask,
+                               unsigned int obj_type);
        int (*inode_alloc_security)(struct inode *inode);
        void (*inode_free_security)(struct inode *inode);
        int (*inode_init_security)(struct inode *inode, struct inode *dir,
@@ -1860,6 +1865,8 @@ struct security_hook_heads {
        struct hlist_head path_chown;
        struct hlist_head path_chroot;
 #endif
+       /* Needed for inode based modules as well */
+       struct hlist_head path_notify;
        struct hlist_head inode_alloc_security;
        struct hlist_head inode_free_security;
        struct hlist_head inode_init_security;