~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to include/linux/security.h

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Luke Yelavich, Upstream Kernel Changes
  • Date: 2012-03-30 09:03:19 UTC
  • Revision ID: package-import@ubuntu.com-20120330090319-5445yb1865swhoiv
Tags: 3.2.0-21.29
[ Luke Yelavich ]

* [Config] Update configs after rebase against Ubuntu-3.2.0-21.34

[ Upstream Kernel Changes ]

* Low-latency: Rebase against Ubuntu-3.2.0-21.34

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
 * These functions are in security/capability.c and are used
55
55
 * as the default capabilities functions
56
56
 */
57
 
extern int cap_capable(struct task_struct *tsk, const struct cred *cred,
58
 
                       struct user_namespace *ns, int cap, int audit);
 
57
extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
 
58
                       int cap, int audit);
59
59
extern int cap_settime(const struct timespec *ts, const struct timezone *tz);
60
60
extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode);
61
61
extern int cap_ptrace_traceme(struct task_struct *parent);
1271
1271
 * @capable:
1272
1272
 *      Check whether the @tsk process has the @cap capability in the indicated
1273
1273
 *      credentials.
1274
 
 *      @tsk contains the task_struct for the process.
1275
1274
 *      @cred contains the credentials to use.
1276
1275
 *      @ns contains the user namespace we want the capability in
1277
1276
 *      @cap contains the capability <include/linux/capability.h>.
1395
1394
                       const kernel_cap_t *effective,
1396
1395
                       const kernel_cap_t *inheritable,
1397
1396
                       const kernel_cap_t *permitted);
1398
 
        int (*capable) (struct task_struct *tsk, const struct cred *cred,
1399
 
                        struct user_namespace *ns, int cap, int audit);
 
1397
        int (*capable) (const struct cred *cred, struct user_namespace *ns,
 
1398
                        int cap, int audit);
1400
1399
        int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1401
1400
        int (*quota_on) (struct dentry *dentry);
1402
1401
        int (*syslog) (int type);
1429
1428
 
1430
1429
#ifdef CONFIG_SECURITY_PATH
1431
1430
        int (*path_unlink) (struct path *dir, struct dentry *dentry);
1432
 
        int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode);
 
1431
        int (*path_mkdir) (struct path *dir, struct dentry *dentry, umode_t mode);
1433
1432
        int (*path_rmdir) (struct path *dir, struct dentry *dentry);
1434
 
        int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode,
 
1433
        int (*path_mknod) (struct path *dir, struct dentry *dentry, umode_t mode,
1435
1434
                           unsigned int dev);
1436
1435
        int (*path_truncate) (struct path *path);
1437
1436
        int (*path_symlink) (struct path *dir, struct dentry *dentry,
1440
1439
                          struct dentry *new_dentry);
1441
1440
        int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1442
1441
                            struct path *new_dir, struct dentry *new_dentry);
1443
 
        int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt,
1444
 
                           mode_t mode);
 
1442
        int (*path_chmod) (struct path *path, umode_t mode);
1445
1443
        int (*path_chown) (struct path *path, uid_t uid, gid_t gid);
1446
1444
        int (*path_chroot) (struct path *path);
1447
1445
#endif
1884
1882
static inline int security_capable(struct user_namespace *ns,
1885
1883
                                   const struct cred *cred, int cap)
1886
1884
{
1887
 
        return cap_capable(current, cred, ns, cap, SECURITY_CAP_AUDIT);
 
1885
        return cap_capable(cred, ns, cap, SECURITY_CAP_AUDIT);
1888
1886
}
1889
1887
 
1890
1888
static inline int security_real_capable(struct task_struct *tsk, struct user_namespace *ns, int cap)
1892
1890
        int ret;
1893
1891
 
1894
1892
        rcu_read_lock();
1895
 
        ret = cap_capable(tsk, __task_cred(tsk), ns, cap, SECURITY_CAP_AUDIT);
 
1893
        ret = cap_capable(__task_cred(tsk), ns, cap, SECURITY_CAP_AUDIT);
1896
1894
        rcu_read_unlock();
1897
1895
        return ret;
1898
1896
}
1903
1901
        int ret;
1904
1902
 
1905
1903
        rcu_read_lock();
1906
 
        ret = cap_capable(tsk, __task_cred(tsk), ns, cap,
1907
 
                               SECURITY_CAP_NOAUDIT);
 
1904
        ret = cap_capable(__task_cred(tsk), ns, cap, SECURITY_CAP_NOAUDIT);
1908
1905
        rcu_read_unlock();
1909
1906
        return ret;
1910
1907
}
2865
2862
 
2866
2863
#ifdef CONFIG_SECURITY_PATH
2867
2864
int security_path_unlink(struct path *dir, struct dentry *dentry);
2868
 
int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode);
 
2865
int security_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode);
2869
2866
int security_path_rmdir(struct path *dir, struct dentry *dentry);
2870
 
int security_path_mknod(struct path *dir, struct dentry *dentry, int mode,
 
2867
int security_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode,
2871
2868
                        unsigned int dev);
2872
2869
int security_path_truncate(struct path *path);
2873
2870
int security_path_symlink(struct path *dir, struct dentry *dentry,
2876
2873
                       struct dentry *new_dentry);
2877
2874
int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2878
2875
                         struct path *new_dir, struct dentry *new_dentry);
2879
 
int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
2880
 
                        mode_t mode);
 
2876
int security_path_chmod(struct path *path, umode_t mode);
2881
2877
int security_path_chown(struct path *path, uid_t uid, gid_t gid);
2882
2878
int security_path_chroot(struct path *path);
2883
2879
#else   /* CONFIG_SECURITY_PATH */
2887
2883
}
2888
2884
 
2889
2885
static inline int security_path_mkdir(struct path *dir, struct dentry *dentry,
2890
 
                                      int mode)
 
2886
                                      umode_t mode)
2891
2887
{
2892
2888
        return 0;
2893
2889
}
2898
2894
}
2899
2895
 
2900
2896
static inline int security_path_mknod(struct path *dir, struct dentry *dentry,
2901
 
                                      int mode, unsigned int dev)
 
2897
                                      umode_t mode, unsigned int dev)
2902
2898
{
2903
2899
        return 0;
2904
2900
}
2929
2925
        return 0;
2930
2926
}
2931
2927
 
2932
 
static inline int security_path_chmod(struct dentry *dentry,
2933
 
                                      struct vfsmount *mnt,
2934
 
                                      mode_t mode)
 
2928
static inline int security_path_chmod(struct path *path, umode_t mode)
2935
2929
{
2936
2930
        return 0;
2937
2931
}
3020
3014
 
3021
3015
#ifdef CONFIG_SECURITYFS
3022
3016
 
3023
 
extern struct dentry *securityfs_create_file(const char *name, mode_t mode,
 
3017
extern struct dentry *securityfs_create_file(const char *name, umode_t mode,
3024
3018
                                             struct dentry *parent, void *data,
3025
3019
                                             const struct file_operations *fops);
3026
3020
extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent);
3035
3029
}
3036
3030
 
3037
3031
static inline struct dentry *securityfs_create_file(const char *name,
3038
 
                                                    mode_t mode,
 
3032
                                                    umode_t mode,
3039
3033
                                                    struct dentry *parent,
3040
3034
                                                    void *data,
3041
3035
                                                    const struct file_operations *fops)