Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

Al Viro f9fadf23 b320789d

+6 -6
+1 -1
include/linux/lsm_hook_defs.h
··· 85 85 int mode, const struct qstr *name, const char **xattr_name, 86 86 struct lsm_context *cp) 87 87 LSM_HOOK(int, 0, dentry_create_files_as, struct dentry *dentry, int mode, 88 - struct qstr *name, const struct cred *old, struct cred *new) 88 + const struct qstr *name, const struct cred *old, struct cred *new) 89 89 90 90 #ifdef CONFIG_SECURITY_PATH 91 91 LSM_HOOK(int, 0, path_unlink, const struct path *dir, struct dentry *dentry)
+2 -2
include/linux/security.h
··· 391 391 const char **xattr_name, 392 392 struct lsm_context *lsmcxt); 393 393 int security_dentry_create_files_as(struct dentry *dentry, int mode, 394 - struct qstr *name, 394 + const struct qstr *name, 395 395 const struct cred *old, 396 396 struct cred *new); 397 397 int security_path_notify(const struct path *path, u64 mask, ··· 871 871 } 872 872 873 873 static inline int security_dentry_create_files_as(struct dentry *dentry, 874 - int mode, struct qstr *name, 874 + int mode, const struct qstr *name, 875 875 const struct cred *old, 876 876 struct cred *new) 877 877 {
+1 -1
security/security.c
··· 1775 1775 * Return: Returns 0 on success, error on failure. 1776 1776 */ 1777 1777 int security_dentry_create_files_as(struct dentry *dentry, int mode, 1778 - struct qstr *name, 1778 + const struct qstr *name, 1779 1779 const struct cred *old, struct cred *new) 1780 1780 { 1781 1781 return call_int_hook(dentry_create_files_as, dentry, mode,
+1 -1
security/selinux/hooks.c
··· 2901 2901 } 2902 2902 2903 2903 static int selinux_dentry_create_files_as(struct dentry *dentry, int mode, 2904 - struct qstr *name, 2904 + const struct qstr *name, 2905 2905 const struct cred *old, 2906 2906 struct cred *new) 2907 2907 {
+1 -1
security/smack/smack_lsm.c
··· 4908 4908 } 4909 4909 4910 4910 static int smack_dentry_create_files_as(struct dentry *dentry, int mode, 4911 - struct qstr *name, 4911 + const struct qstr *name, 4912 4912 const struct cred *old, 4913 4913 struct cred *new) 4914 4914 {