diff --git a/security/slsm/lsm.c b/security/slsm/lsm.c index 1b8ef8d23f188fbff1483a2824321a7662d75fd3..6f4c3f6a34bb7132a99746024cab82233a50948c 100644 --- a/security/slsm/lsm.c +++ b/security/slsm/lsm.c @@ -298,7 +298,7 @@ static int passt_file_open(struct file *file, const struct cred *cred) { return passt_path_common(&file->f_path, cred, perms_want); } -static int passt_path_link(struct dentry *old_dentry, struct path *new_dir, +static int passt_path_link(struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry) { const struct cred *cred = current_cred(); const struct passt_task *pt = cred->security; @@ -336,44 +336,44 @@ cleanup: return ret; } -static int passt_path_symlink(struct path *dir, struct dentry *dentry, +static int passt_path_symlink(const struct path *dir, struct dentry *dentry, const char *old_name) { /* Symlinks are always followed so there's no need to verify the * target here. */ return passt_path_common(dir, current_cred(), SLSM_PERMS_W); } -static int passt_path_unlink(struct path *dir, struct dentry *dentry) { +static int passt_path_unlink(const struct path *dir, struct dentry *dentry) { return passt_path_common(dir, current_cred(), SLSM_PERMS_W); } -static int passt_path_rename(struct path *old_dir, struct dentry *old_dentry, - struct path *new_dir, struct dentry *new_dentry) { +static int passt_path_rename(const struct path *old_dir, struct dentry *old_dentry, + const struct path *new_dir, struct dentry *new_dentry) { if (passt_path_common(old_dir, current_cred(), SLSM_PERMS_W) || passt_path_common(new_dir, current_cred(), SLSM_PERMS_W)) return -EACCES; return 0; } -static int passt_path_mkdir(struct path *dir, struct dentry *dentry, +static int passt_path_mkdir(const struct path *dir, struct dentry *dentry, umode_t mode) { return passt_path_common(dir, current_cred(), SLSM_PERMS_W); } -static int passt_path_rmdir(struct path *dir, struct dentry *dentry) { +static int passt_path_rmdir(const struct path *dir, struct dentry *dentry) { return passt_path_common(dir, current_cred(), SLSM_PERMS_W); } -static int passt_path_mknod(struct path *dir, struct dentry *dentry, +static int passt_path_mknod(const struct path *dir, struct dentry *dentry, umode_t mode, unsigned int dev) { return passt_path_common(dir, current_cred(), SLSM_PERMS_W); } -static int passt_path_chmod(struct path *path, umode_t mode) { +static int passt_path_chmod(const struct path *path, umode_t mode) { return passt_path_common(path, current_cred(), SLSM_PERMS_W); } -static int passt_path_chown(struct path *path, kuid_t uid, kgid_t gid) { +static int passt_path_chown(const struct path *path, kuid_t uid, kgid_t gid) { return passt_path_common(path, current_cred(), SLSM_PERMS_W); }