mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
security_dentry_init_security(): constify qstr argument
Nothing outside of fs/dcache.c has any business modifying dentry names; passing &dentry->d_name as an argument should have that argument declared as a const pointer. Acked-by: Casey Schaufler <casey@schaufler-ca.com> # smack part Acked-by: Paul Moore <paul@paul-moore.com> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -85,7 +85,7 @@ LSM_HOOK(int, -EOPNOTSUPP, dentry_init_security, struct dentry *dentry,
|
||||
int mode, const struct qstr *name, const char **xattr_name,
|
||||
struct lsm_context *cp)
|
||||
LSM_HOOK(int, 0, dentry_create_files_as, struct dentry *dentry, int mode,
|
||||
struct qstr *name, const struct cred *old, struct cred *new)
|
||||
const struct qstr *name, const struct cred *old, struct cred *new)
|
||||
|
||||
#ifdef CONFIG_SECURITY_PATH
|
||||
LSM_HOOK(int, 0, path_unlink, const struct path *dir, struct dentry *dentry)
|
||||
|
||||
@@ -391,7 +391,7 @@ int security_dentry_init_security(struct dentry *dentry, int mode,
|
||||
const char **xattr_name,
|
||||
struct lsm_context *lsmcxt);
|
||||
int security_dentry_create_files_as(struct dentry *dentry, int mode,
|
||||
struct qstr *name,
|
||||
const struct qstr *name,
|
||||
const struct cred *old,
|
||||
struct cred *new);
|
||||
int security_path_notify(const struct path *path, u64 mask,
|
||||
@@ -871,7 +871,7 @@ static inline int security_dentry_init_security(struct dentry *dentry,
|
||||
}
|
||||
|
||||
static inline int security_dentry_create_files_as(struct dentry *dentry,
|
||||
int mode, struct qstr *name,
|
||||
int mode, const struct qstr *name,
|
||||
const struct cred *old,
|
||||
struct cred *new)
|
||||
{
|
||||
|
||||
@@ -1775,7 +1775,7 @@ EXPORT_SYMBOL(security_dentry_init_security);
|
||||
* Return: Returns 0 on success, error on failure.
|
||||
*/
|
||||
int security_dentry_create_files_as(struct dentry *dentry, int mode,
|
||||
struct qstr *name,
|
||||
const struct qstr *name,
|
||||
const struct cred *old, struct cred *new)
|
||||
{
|
||||
return call_int_hook(dentry_create_files_as, dentry, mode,
|
||||
|
||||
@@ -2901,7 +2901,7 @@ static int selinux_dentry_init_security(struct dentry *dentry, int mode,
|
||||
}
|
||||
|
||||
static int selinux_dentry_create_files_as(struct dentry *dentry, int mode,
|
||||
struct qstr *name,
|
||||
const struct qstr *name,
|
||||
const struct cred *old,
|
||||
struct cred *new)
|
||||
{
|
||||
|
||||
@@ -4908,7 +4908,7 @@ static int smack_inode_copy_up_xattr(struct dentry *src, const char *name)
|
||||
}
|
||||
|
||||
static int smack_dentry_create_files_as(struct dentry *dentry, int mode,
|
||||
struct qstr *name,
|
||||
const struct qstr *name,
|
||||
const struct cred *old,
|
||||
struct cred *new)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user