Merge branch 'linus' into cont_syslog
[safe/jmp/linux-2.6] / include / linux / security.h
index a42d733..0c88191 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/sched.h>
 #include <linux/key.h>
 #include <linux/xfrm.h>
-#include <linux/gfp.h>
+#include <linux/slab.h>
 #include <net/flow.h>
 
 /* Maximum number of letters for an LSM name string */
@@ -277,10 +277,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @old_path contains the path for the new location of the current root (put_old).
  *     @new_path contains the path for the new root (new_root).
  *     Return 0 if permission is granted.
- * @sb_post_pivotroot:
- *     Update module state after a successful pivot.
- *     @old_path contains the path for the old root.
- *     @new_path contains the path for the new root.
  * @sb_set_mnt_opts:
  *     Set the security relevant mount options used for a superblock
  *     @sb the superblock to set security mount options for
@@ -482,12 +478,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @mnt is the vfsmount where the dentry was looked up
  *     @dentry contains the dentry structure for the file.
  *     Return 0 if permission is granted.
- * @inode_delete:
- *     @inode contains the inode structure for deleted inode.
- *     This hook is called when a deleted inode is released (i.e. an inode
- *     with no hard links has its use count drop to zero).  A security module
- *     can use this hook to release any persistent label associated with the
- *     inode.
  * @inode_setxattr:
  *     Check permission before setting the extended attributes
  *     @value identified by @name for @dentry.
@@ -662,10 +652,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @old points to the original credentials.
  *     @gfp indicates the atomicity of any memory allocations.
  *     Prepare a new set of credentials by copying the data from the old set.
- * @cred_commit:
- *     @new points to the new credentials.
- *     @old points to the original credentials.
- *     Install a new set of credentials.
  * @cred_transfer:
  *     @new points to the new credentials.
  *     @old points to the original credentials.
@@ -688,18 +674,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     userspace to load a kernel module with the given name.
  *     @kmod_name name of the module requested by the kernel
  *     Return 0 if successful.
- * @task_setuid:
- *     Check permission before setting one or more of the user identity
- *     attributes of the current process.  The @flags parameter indicates
- *     which of the set*uid system calls invoked this hook and how to
- *     interpret the @id0, @id1, and @id2 parameters.  See the LSM_SETID
- *     definitions at the beginning of this file for the @flags values and
- *     their meanings.
- *     @id0 contains a uid.
- *     @id1 contains a uid.
- *     @id2 contains a uid.
- *     @flags contains one of the LSM_SETID_* values.
- *     Return 0 if permission is granted.
  * @task_fix_setuid:
  *     Update the module's state after setting one or more of the user
  *     identity attributes of the current process.  The @flags parameter
@@ -709,18 +683,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @old is the set of credentials that are being replaces
  *     @flags contains one of the LSM_SETID_* values.
  *     Return 0 on success.
- * @task_setgid:
- *     Check permission before setting one or more of the group identity
- *     attributes of the current process.  The @flags parameter indicates
- *     which of the set*gid system calls invoked this hook and how to
- *     interpret the @id0, @id1, and @id2 parameters.  See the LSM_SETID
- *     definitions at the beginning of this file for the @flags values and
- *     their meanings.
- *     @id0 contains a gid.
- *     @id1 contains a gid.
- *     @id2 contains a gid.
- *     @flags contains one of the LSM_SETID_* values.
- *     Return 0 if permission is granted.
  * @task_setpgid:
  *     Check permission before setting the process group identifier of the
  *     process @p to @pgid.
@@ -742,11 +704,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @p contains the task_struct for the process and place is into @secid.
  *     In case of failure, @secid will be set to zero.
  *
- * @task_setgroups:
- *     Check permission before setting the supplementary group set of the
- *     current process.
- *     @group_info contains the new group information.
- *     Return 0 if permission is granted.
  * @task_setnice:
  *     Check permission before setting the nice value of @p to @nice.
  *     @p contains the task_struct of process.
@@ -1110,13 +1067,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     Return the length of the string (including terminating NUL) or -ve if
  *      an error.
  *     May also return 0 (and a NULL buffer pointer) if there is no label.
- * @key_session_to_parent:
- *     Forcibly assign the session keyring from a process to its parent
- *     process.
- *     @cred: Pointer to process's credentials
- *     @parent_cred: Pointer to parent process's credentials
- *     @keyring: Proposed new session keyring
- *     Return 0 if permission is granted, -ve error otherwise.
  *
  * Security hooks affecting all System V IPC operations.
  *
@@ -1304,13 +1254,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
  *     @cap contains the capability <include/linux/capability.h>.
  *     @audit: Whether to write an audit message or not
  *     Return 0 if the capability is granted for @tsk.
- * @acct:
- *     Check permission before enabling or disabling process accounting.  If
- *     accounting is being enabled, then @file refers to the open file used to
- *     store accounting records.  If accounting is being disabled, then @file
- *     is NULL.
- *     @file contains the file structure for the accounting file (may be NULL).
- *     Return 0 if permission is granted.
  * @sysctl:
  *     Check permission before accessing the @table sysctl variable in the
  *     manner specified by @op.
@@ -1433,7 +1376,6 @@ struct security_operations {
                       const kernel_cap_t *permitted);
        int (*capable) (struct task_struct *tsk, const struct cred *cred,
                        int cap, int audit);
-       int (*acct) (struct file *file);
        int (*sysctl) (struct ctl_table *table, int op);
        int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
        int (*quota_on) (struct dentry *dentry);
@@ -1458,8 +1400,6 @@ struct security_operations {
        int (*sb_umount) (struct vfsmount *mnt, int flags);
        int (*sb_pivotroot) (struct path *old_path,
                             struct path *new_path);
-       void (*sb_post_pivotroot) (struct path *old_path,
-                                  struct path *new_path);
        int (*sb_set_mnt_opts) (struct super_block *sb,
                                struct security_mnt_opts *opts);
        void (*sb_clone_mnt_opts) (const struct super_block *oldsb,
@@ -1508,7 +1448,6 @@ struct security_operations {
        int (*inode_permission) (struct inode *inode, int mask);
        int (*inode_setattr)    (struct dentry *dentry, struct iattr *attr);
        int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
-       void (*inode_delete) (struct inode *inode);
        int (*inode_setxattr) (struct dentry *dentry, const char *name,
                               const void *value, size_t size, int flags);
        void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
@@ -1549,20 +1488,16 @@ struct security_operations {
        void (*cred_free) (struct cred *cred);
        int (*cred_prepare)(struct cred *new, const struct cred *old,
                            gfp_t gfp);
-       void (*cred_commit)(struct cred *new, const struct cred *old);
        void (*cred_transfer)(struct cred *new, const struct cred *old);
        int (*kernel_act_as)(struct cred *new, u32 secid);
        int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
        int (*kernel_module_request)(char *kmod_name);
-       int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
        int (*task_fix_setuid) (struct cred *new, const struct cred *old,
                                int flags);
-       int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags);
        int (*task_setpgid) (struct task_struct *p, pid_t pgid);
        int (*task_getpgid) (struct task_struct *p);
        int (*task_getsid) (struct task_struct *p);
        void (*task_getsecid) (struct task_struct *p, u32 *secid);
-       int (*task_setgroups) (struct group_info *group_info);
        int (*task_setnice) (struct task_struct *p, int nice);
        int (*task_setioprio) (struct task_struct *p, int ioprio);
        int (*task_getioprio) (struct task_struct *p);
@@ -1692,9 +1627,6 @@ struct security_operations {
                               const struct cred *cred,
                               key_perm_t perm);
        int (*key_getsecurity)(struct key *key, char **_buffer);
-       int (*key_session_to_parent)(const struct cred *cred,
-                                    const struct cred *parent_cred,
-                                    struct key *key);
 #endif /* CONFIG_KEYS */
 
 #ifdef CONFIG_AUDIT
@@ -1725,7 +1657,6 @@ int security_capset(struct cred *new, const struct cred *old,
 int security_capable(int cap);
 int security_real_capable(struct task_struct *tsk, int cap);
 int security_real_capable_noaudit(struct task_struct *tsk, int cap);
-int security_acct(struct file *file);
 int security_sysctl(struct ctl_table *table, int op);
 int security_quotactl(int cmds, int type, int id, struct super_block *sb);
 int security_quota_on(struct dentry *dentry);
@@ -1749,7 +1680,6 @@ int security_sb_mount(char *dev_name, struct path *path,
                      char *type, unsigned long flags, void *data);
 int security_sb_umount(struct vfsmount *mnt, int flags);
 int security_sb_pivotroot(struct path *old_path, struct path *new_path);
-void security_sb_post_pivotroot(struct path *old_path, struct path *new_path);
 int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
 void security_sb_clone_mnt_opts(const struct super_block *oldsb,
                                struct super_block *newsb);
@@ -1775,7 +1705,6 @@ int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
 int security_inode_permission(struct inode *inode, int mask);
 int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
 int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
-void security_inode_delete(struct inode *inode);
 int security_inode_setxattr(struct dentry *dentry, const char *name,
                            const void *value, size_t size, int flags);
 void security_inode_post_setxattr(struct dentry *dentry, const char *name,
@@ -1809,20 +1738,16 @@ int security_task_create(unsigned long clone_flags);
 int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
 void security_cred_free(struct cred *cred);
 int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
-void security_commit_creds(struct cred *new, const struct cred *old);
 void security_transfer_creds(struct cred *new, const struct cred *old);
 int security_kernel_act_as(struct cred *new, u32 secid);
 int security_kernel_create_files_as(struct cred *new, struct inode *inode);
 int security_kernel_module_request(char *kmod_name);
-int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
 int security_task_fix_setuid(struct cred *new, const struct cred *old,
                             int flags);
-int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags);
 int security_task_setpgid(struct task_struct *p, pid_t pgid);
 int security_task_getpgid(struct task_struct *p);
 int security_task_getsid(struct task_struct *p);
 void security_task_getsecid(struct task_struct *p, u32 *secid);
-int security_task_setgroups(struct group_info *group_info);
 int security_task_setnice(struct task_struct *p, int nice);
 int security_task_setioprio(struct task_struct *p, int ioprio);
 int security_task_getioprio(struct task_struct *p);
@@ -1949,11 +1874,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap)
        return ret;
 }
 
-static inline int security_acct(struct file *file)
-{
-       return 0;
-}
-
 static inline int security_sysctl(struct ctl_table *table, int op)
 {
        return 0;
@@ -2069,10 +1989,6 @@ static inline int security_sb_pivotroot(struct path *old_path,
        return 0;
 }
 
-static inline void security_sb_post_pivotroot(struct path *old_path,
-                                             struct path *new_path)
-{ }
-
 static inline int security_sb_set_mnt_opts(struct super_block *sb,
                                           struct security_mnt_opts *opts)
 {
@@ -2188,9 +2104,6 @@ static inline int security_inode_getattr(struct vfsmount *mnt,
        return 0;
 }
 
-static inline void security_inode_delete(struct inode *inode)
-{ }
-
 static inline int security_inode_setxattr(struct dentry *dentry,
                const char *name, const void *value, size_t size, int flags)
 {
@@ -2337,11 +2250,6 @@ static inline int security_prepare_creds(struct cred *new,
        return 0;
 }
 
-static inline void security_commit_creds(struct cred *new,
-                                        const struct cred *old)
-{
-}
-
 static inline void security_transfer_creds(struct cred *new,
                                           const struct cred *old)
 {
@@ -2363,12 +2271,6 @@ static inline int security_kernel_module_request(char *kmod_name)
        return 0;
 }
 
-static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2,
-                                      int flags)
-{
-       return 0;
-}
-
 static inline int security_task_fix_setuid(struct cred *new,
                                           const struct cred *old,
                                           int flags)
@@ -2376,12 +2278,6 @@ static inline int security_task_fix_setuid(struct cred *new,
        return cap_task_fix_setuid(new, old, flags);
 }
 
-static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2,
-                                      int flags)
-{
-       return 0;
-}
-
 static inline int security_task_setpgid(struct task_struct *p, pid_t pgid)
 {
        return 0;
@@ -2402,11 +2298,6 @@ static inline void security_task_getsecid(struct task_struct *p, u32 *secid)
        *secid = 0;
 }
 
-static inline int security_task_setgroups(struct group_info *group_info)
-{
-       return 0;
-}
-
 static inline int security_task_setnice(struct task_struct *p, int nice)
 {
        return cap_task_setnice(p, nice);
@@ -3003,9 +2894,6 @@ void security_key_free(struct key *key);
 int security_key_permission(key_ref_t key_ref,
                            const struct cred *cred, key_perm_t perm);
 int security_key_getsecurity(struct key *key, char **_buffer);
-int security_key_session_to_parent(const struct cred *cred,
-                                  const struct cred *parent_cred,
-                                  struct key *key);
 
 #else
 
@@ -3033,13 +2921,6 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer)
        return 0;
 }
 
-static inline int security_key_session_to_parent(const struct cred *cred,
-                                                const struct cred *parent_cred,
-                                                struct key *key)
-{
-       return 0;
-}
-
 #endif
 #endif /* CONFIG_KEYS */