linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] dynamic_dname(): drop unused dentry argument
@ 2022-08-18  2:57 Al Viro
  2022-08-18  2:58 ` [PATCH 2/5] ksmbd: don't open-code file_path() Al Viro
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Al Viro @ 2022-08-18  2:57 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/dma-buf/dma-buf.c | 2 +-
 fs/anon_inodes.c          | 2 +-
 fs/d_path.c               | 3 +--
 fs/nsfs.c                 | 2 +-
 fs/pipe.c                 | 2 +-
 include/linux/dcache.h    | 4 ++--
 net/socket.c              | 2 +-
 7 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index efb4990b29e1..5ec2f314b6e9 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -53,7 +53,7 @@ static char *dmabuffs_dname(struct dentry *dentry, char *buffer, int buflen)
 		ret = strlcpy(name, dmabuf->name, DMA_BUF_NAME_LEN);
 	spin_unlock(&dmabuf->name_lock);
 
-	return dynamic_dname(dentry, buffer, buflen, "/%s:%s",
+	return dynamic_dname(buffer, buflen, "/%s:%s",
 			     dentry->d_name.name, ret > 0 ? name : "");
 }
 
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index e0c3e33c4177..24192a7667ed 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -32,7 +32,7 @@ static struct inode *anon_inode_inode;
  */
 static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen)
 {
-	return dynamic_dname(dentry, buffer, buflen, "anon_inode:%s",
+	return dynamic_dname(buffer, buflen, "anon_inode:%s",
 				dentry->d_name.name);
 }
 
diff --git a/fs/d_path.c b/fs/d_path.c
index e4e0ebad1f15..ce8d9d49e1e7 100644
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -297,8 +297,7 @@ EXPORT_SYMBOL(d_path);
 /*
  * Helper function for dentry_operations.d_dname() members
  */
-char *dynamic_dname(struct dentry *dentry, char *buffer, int buflen,
-			const char *fmt, ...)
+char *dynamic_dname(char *buffer, int buflen, const char *fmt, ...)
 {
 	va_list args;
 	char temp[64];
diff --git a/fs/nsfs.c b/fs/nsfs.c
index 800c1d0eb0d0..3506f6074288 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -28,7 +28,7 @@ static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)
 	struct inode *inode = d_inode(dentry);
 	const struct proc_ns_operations *ns_ops = dentry->d_fsdata;
 
-	return dynamic_dname(dentry, buffer, buflen, "%s:[%lu]",
+	return dynamic_dname(buffer, buflen, "%s:[%lu]",
 		ns_ops->name, inode->i_ino);
 }
 
diff --git a/fs/pipe.c b/fs/pipe.c
index 74ae9fafd25a..42c7ff41c2db 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -860,7 +860,7 @@ static struct vfsmount *pipe_mnt __read_mostly;
  */
 static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
 {
-	return dynamic_dname(dentry, buffer, buflen, "pipe:[%lu]",
+	return dynamic_dname(buffer, buflen, "pipe:[%lu]",
 				d_inode(dentry)->i_ino);
 }
 
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 92c78ed02b54..54d46518c481 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -287,8 +287,8 @@ static inline unsigned d_count(const struct dentry *dentry)
 /*
  * helper function for dentry_operations.d_dname() members
  */
-extern __printf(4, 5)
-char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
+extern __printf(3, 4)
+char *dynamic_dname(char *, int, const char *, ...);
 
 extern char *__d_path(const struct path *, const struct path *, char *, int);
 extern char *d_absolute_path(const struct path *, char *, int);
diff --git a/net/socket.c b/net/socket.c
index 9b27c5e4e5ba..d183e83e0cdf 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -355,7 +355,7 @@ static const struct super_operations sockfs_ops = {
  */
 static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen)
 {
-	return dynamic_dname(dentry, buffer, buflen, "socket:[%lu]",
+	return dynamic_dname(buffer, buflen, "socket:[%lu]",
 				d_inode(dentry)->i_ino);
 }
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/5] ksmbd: don't open-code file_path()
  2022-08-18  2:57 [PATCH 1/5] dynamic_dname(): drop unused dentry argument Al Viro
@ 2022-08-18  2:58 ` Al Viro
  2022-08-18  6:19   ` Namjae Jeon
  2022-08-18  2:58 ` [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM Al Viro
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2022-08-18  2:58 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/ksmbd/smb2pdu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index 9751cc92c111..0e1924a6476d 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -5416,7 +5416,7 @@ static int smb2_rename(struct ksmbd_work *work,
 	if (!pathname)
 		return -ENOMEM;
 
-	abs_oldname = d_path(&fp->filp->f_path, pathname, PATH_MAX);
+	abs_oldname = file_path(fp->filp, pathname, PATH_MAX);
 	if (IS_ERR(abs_oldname)) {
 		rc = -EINVAL;
 		goto out;
@@ -5551,7 +5551,7 @@ static int smb2_create_link(struct ksmbd_work *work,
 	}
 
 	ksmbd_debug(SMB, "link name is %s\n", link_name);
-	target_name = d_path(&filp->f_path, pathname, PATH_MAX);
+	target_name = file_path(filp, pathname, PATH_MAX);
 	if (IS_ERR(target_name)) {
 		rc = -EINVAL;
 		goto out;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM...
  2022-08-18  2:57 [PATCH 1/5] dynamic_dname(): drop unused dentry argument Al Viro
  2022-08-18  2:58 ` [PATCH 2/5] ksmbd: don't open-code file_path() Al Viro
@ 2022-08-18  2:58 ` Al Viro
  2022-08-18 18:34   ` Schaufler, Casey
  2022-08-26  7:45   ` Christian Brauner
  2022-08-18  2:59 ` [PATCH 4/5] ksmbd: don't open-code %pf Al Viro
  2022-08-18  2:59 ` [PATCH 5/5] d_path.c: typo fix Al Viro
  3 siblings, 2 replies; 15+ messages in thread
From: Al Viro @ 2022-08-18  2:58 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

cast of ->d_name.name to char * is completely wrong - nothing is
allowed to modify its contents.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/proc/base.c                | 2 +-
 include/linux/lsm_hook_defs.h | 2 +-
 include/linux/security.h      | 4 ++--
 security/apparmor/lsm.c       | 2 +-
 security/security.c           | 4 ++--
 security/selinux/hooks.c      | 2 +-
 security/smack/smack_lsm.c    | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 93f7e3d971e4..e347b8ce140c 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2728,7 +2728,7 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf,
 		return -ESRCH;
 
 	length = security_getprocattr(task, PROC_I(inode)->op.lsm,
-				      (char*)file->f_path.dentry->d_name.name,
+				      file->f_path.dentry->d_name.name,
 				      &p);
 	put_task_struct(task);
 	if (length > 0)
diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
index 806448173033..03360d27bedf 100644
--- a/include/linux/lsm_hook_defs.h
+++ b/include/linux/lsm_hook_defs.h
@@ -253,7 +253,7 @@ LSM_HOOK(int, 0, sem_semop, struct kern_ipc_perm *perm, struct sembuf *sops,
 LSM_HOOK(int, 0, netlink_send, struct sock *sk, struct sk_buff *skb)
 LSM_HOOK(void, LSM_RET_VOID, d_instantiate, struct dentry *dentry,
 	 struct inode *inode)
-LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, char *name,
+LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, const char *name,
 	 char **value)
 LSM_HOOK(int, -EINVAL, setprocattr, const char *name, void *value, size_t size)
 LSM_HOOK(int, 0, ismaclabel, const char *name)
diff --git a/include/linux/security.h b/include/linux/security.h
index 1bc362cb413f..93488c01d9bd 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -461,7 +461,7 @@ int security_sem_semctl(struct kern_ipc_perm *sma, int cmd);
 int security_sem_semop(struct kern_ipc_perm *sma, struct sembuf *sops,
 			unsigned nsops, int alter);
 void security_d_instantiate(struct dentry *dentry, struct inode *inode);
-int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
+int security_getprocattr(struct task_struct *p, const char *lsm, const char *name,
 			 char **value);
 int security_setprocattr(const char *lsm, const char *name, void *value,
 			 size_t size);
@@ -1301,7 +1301,7 @@ static inline void security_d_instantiate(struct dentry *dentry,
 { }
 
 static inline int security_getprocattr(struct task_struct *p, const char *lsm,
-				       char *name, char **value)
+				       const char *name, char **value)
 {
 	return -EINVAL;
 }
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index e29cade7b662..f56070270c69 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -614,7 +614,7 @@ static int apparmor_sb_pivotroot(const struct path *old_path,
 	return error;
 }
 
-static int apparmor_getprocattr(struct task_struct *task, char *name,
+static int apparmor_getprocattr(struct task_struct *task, const char *name,
 				char **value)
 {
 	int error = -ENOENT;
diff --git a/security/security.c b/security/security.c
index 14d30fec8a00..d8227531e2fd 100644
--- a/security/security.c
+++ b/security/security.c
@@ -2057,8 +2057,8 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode)
 }
 EXPORT_SYMBOL(security_d_instantiate);
 
-int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
-				char **value)
+int security_getprocattr(struct task_struct *p, const char *lsm,
+			 const char *name, char **value)
 {
 	struct security_hook_list *hp;
 
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 79573504783b..c8168d19fb96 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -6327,7 +6327,7 @@ static void selinux_d_instantiate(struct dentry *dentry, struct inode *inode)
 }
 
 static int selinux_getprocattr(struct task_struct *p,
-			       char *name, char **value)
+			       const char *name, char **value)
 {
 	const struct task_security_struct *__tsec;
 	u32 sid;
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 001831458fa2..434b348d8fcd 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3479,7 +3479,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
  *
  * Returns the length of the smack label or an error code
  */
-static int smack_getprocattr(struct task_struct *p, char *name, char **value)
+static int smack_getprocattr(struct task_struct *p, const char *name, char **value)
 {
 	struct smack_known *skp = smk_of_task_struct_obj(p);
 	char *cp;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-18  2:57 [PATCH 1/5] dynamic_dname(): drop unused dentry argument Al Viro
  2022-08-18  2:58 ` [PATCH 2/5] ksmbd: don't open-code file_path() Al Viro
  2022-08-18  2:58 ` [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM Al Viro
@ 2022-08-18  2:59 ` Al Viro
  2022-08-18  6:08   ` Namjae Jeon
  2022-08-18  2:59 ` [PATCH 5/5] d_path.c: typo fix Al Viro
  3 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2022-08-18  2:59 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/ksmbd/vfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
index 78d01033604c..a0fafba8b5d0 100644
--- a/fs/ksmbd/vfs.c
+++ b/fs/ksmbd/vfs.c
@@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
 	*total_size_written = 0;
 
 	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
-		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
+		pr_err("no right to read(%pf)\n", src_fp->filp);
 		return -EACCES;
 	}
 	if (!(dst_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
-		pr_err("no right to write(%pd)\n", dst_fp->filp->f_path.dentry);
+		pr_err("no right to write(%pf)\n", dst_fp->filp);
 		return -EACCES;
 	}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/5] d_path.c: typo fix...
  2022-08-18  2:57 [PATCH 1/5] dynamic_dname(): drop unused dentry argument Al Viro
                   ` (2 preceding siblings ...)
  2022-08-18  2:59 ` [PATCH 4/5] ksmbd: don't open-code %pf Al Viro
@ 2022-08-18  2:59 ` Al Viro
  3 siblings, 0 replies; 15+ messages in thread
From: Al Viro @ 2022-08-18  2:59 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/d_path.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/d_path.c b/fs/d_path.c
index ce8d9d49e1e7..56a6ee4c6331 100644
--- a/fs/d_path.c
+++ b/fs/d_path.c
@@ -34,7 +34,7 @@ static bool prepend_char(struct prepend_buffer *p, unsigned char c)
 }
 
 /*
- * The source of the prepend data can be an optimistoc load
+ * The source of the prepend data can be an optimistic load
  * of a dentry name and length. And because we don't hold any
  * locks, the length and the pointer to the name may not be
  * in sync if a concurrent rename happens, and the kernel
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-18  2:59 ` [PATCH 4/5] ksmbd: don't open-code %pf Al Viro
@ 2022-08-18  6:08   ` Namjae Jeon
  2022-08-18 20:35     ` Al Viro
  0 siblings, 1 reply; 15+ messages in thread
From: Namjae Jeon @ 2022-08-18  6:08 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

2022-08-18 11:59 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
>  fs/ksmbd/vfs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
> index 78d01033604c..a0fafba8b5d0 100644
> --- a/fs/ksmbd/vfs.c
> +++ b/fs/ksmbd/vfs.c
> @@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work
> *work,
>  	*total_size_written = 0;
>
>  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
> -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
> +		pr_err("no right to read(%pf)\n", src_fp->filp);
Isn't this probably %pD?

Thanks.
>  		return -EACCES;
>  	}
>  	if (!(dst_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
> -		pr_err("no right to write(%pd)\n", dst_fp->filp->f_path.dentry);
> +		pr_err("no right to write(%pf)\n", dst_fp->filp);
>  		return -EACCES;
>  	}
>
> --
> 2.30.2
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/5] ksmbd: don't open-code file_path()
  2022-08-18  2:58 ` [PATCH 2/5] ksmbd: don't open-code file_path() Al Viro
@ 2022-08-18  6:19   ` Namjae Jeon
  0 siblings, 0 replies; 15+ messages in thread
From: Namjae Jeon @ 2022-08-18  6:19 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, linux-kernel, CIFS

2022-08-18 11:58 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>

Thanks!
> ---
>  fs/ksmbd/smb2pdu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
> index 9751cc92c111..0e1924a6476d 100644
> --- a/fs/ksmbd/smb2pdu.c
> +++ b/fs/ksmbd/smb2pdu.c
> @@ -5416,7 +5416,7 @@ static int smb2_rename(struct ksmbd_work *work,
>  	if (!pathname)
>  		return -ENOMEM;
>
> -	abs_oldname = d_path(&fp->filp->f_path, pathname, PATH_MAX);
> +	abs_oldname = file_path(fp->filp, pathname, PATH_MAX);
>  	if (IS_ERR(abs_oldname)) {
>  		rc = -EINVAL;
>  		goto out;
> @@ -5551,7 +5551,7 @@ static int smb2_create_link(struct ksmbd_work *work,
>  	}
>
>  	ksmbd_debug(SMB, "link name is %s\n", link_name);
> -	target_name = d_path(&filp->f_path, pathname, PATH_MAX);
> +	target_name = file_path(filp, pathname, PATH_MAX);
>  	if (IS_ERR(target_name)) {
>  		rc = -EINVAL;
>  		goto out;
> --
> 2.30.2
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM...
  2022-08-18  2:58 ` [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM Al Viro
@ 2022-08-18 18:34   ` Schaufler, Casey
  2022-08-26  7:45   ` Christian Brauner
  1 sibling, 0 replies; 15+ messages in thread
From: Schaufler, Casey @ 2022-08-18 18:34 UTC (permalink / raw)
  To: Al Viro, linux-fsdevel; +Cc: linux-kernel, linux-security-module

> -----Original Message-----
> From: Al Viro <viro@ftp.linux.org.uk> On Behalf Of Al Viro
> Sent: Wednesday, August 17, 2022 7:59 PM
> To: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Subject: [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM...
> 
> cast of ->d_name.name to char * is completely wrong - nothing is
> allowed to modify its contents.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Could we please have the LSM list included when making changes in
the security sub-system?

Thank you.

> ---
>  fs/proc/base.c                | 2 +-
>  include/linux/lsm_hook_defs.h | 2 +-
>  include/linux/security.h      | 4 ++--
>  security/apparmor/lsm.c       | 2 +-
>  security/security.c           | 4 ++--
>  security/selinux/hooks.c      | 2 +-
>  security/smack/smack_lsm.c    | 2 +-
>  7 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 93f7e3d971e4..e347b8ce140c 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2728,7 +2728,7 @@ static ssize_t proc_pid_attr_read(struct file * file,
> char __user * buf,
>  		return -ESRCH;
> 
>  	length = security_getprocattr(task, PROC_I(inode)->op.lsm,
> -				      (char*)file->f_path.dentry-
> >d_name.name,
> +				      file->f_path.dentry->d_name.name,
>  				      &p);
>  	put_task_struct(task);
>  	if (length > 0)
> diff --git a/include/linux/lsm_hook_defs.h b/include/linux/lsm_hook_defs.h
> index 806448173033..03360d27bedf 100644
> --- a/include/linux/lsm_hook_defs.h
> +++ b/include/linux/lsm_hook_defs.h
> @@ -253,7 +253,7 @@ LSM_HOOK(int, 0, sem_semop, struct kern_ipc_perm
> *perm, struct sembuf *sops,
>  LSM_HOOK(int, 0, netlink_send, struct sock *sk, struct sk_buff *skb)
>  LSM_HOOK(void, LSM_RET_VOID, d_instantiate, struct dentry *dentry,
>  	 struct inode *inode)
> -LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, char *name,
> +LSM_HOOK(int, -EINVAL, getprocattr, struct task_struct *p, const char
> *name,
>  	 char **value)
>  LSM_HOOK(int, -EINVAL, setprocattr, const char *name, void *value, size_t
> size)
>  LSM_HOOK(int, 0, ismaclabel, const char *name)
> diff --git a/include/linux/security.h b/include/linux/security.h
> index 1bc362cb413f..93488c01d9bd 100644
> --- a/include/linux/security.h
> +++ b/include/linux/security.h
> @@ -461,7 +461,7 @@ int security_sem_semctl(struct kern_ipc_perm *sma,
> int cmd);
>  int security_sem_semop(struct kern_ipc_perm *sma, struct sembuf *sops,
>  			unsigned nsops, int alter);
>  void security_d_instantiate(struct dentry *dentry, struct inode *inode);
> -int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
> +int security_getprocattr(struct task_struct *p, const char *lsm, const char
> *name,
>  			 char **value);
>  int security_setprocattr(const char *lsm, const char *name, void *value,
>  			 size_t size);
> @@ -1301,7 +1301,7 @@ static inline void security_d_instantiate(struct
> dentry *dentry,
>  { }
> 
>  static inline int security_getprocattr(struct task_struct *p, const char *lsm,
> -				       char *name, char **value)
> +				       const char *name, char **value)
>  {
>  	return -EINVAL;
>  }
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index e29cade7b662..f56070270c69 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -614,7 +614,7 @@ static int apparmor_sb_pivotroot(const struct path
> *old_path,
>  	return error;
>  }
> 
> -static int apparmor_getprocattr(struct task_struct *task, char *name,
> +static int apparmor_getprocattr(struct task_struct *task, const char *name,
>  				char **value)
>  {
>  	int error = -ENOENT;
> diff --git a/security/security.c b/security/security.c
> index 14d30fec8a00..d8227531e2fd 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -2057,8 +2057,8 @@ void security_d_instantiate(struct dentry *dentry,
> struct inode *inode)
>  }
>  EXPORT_SYMBOL(security_d_instantiate);
> 
> -int security_getprocattr(struct task_struct *p, const char *lsm, char *name,
> -				char **value)
> +int security_getprocattr(struct task_struct *p, const char *lsm,
> +			 const char *name, char **value)
>  {
>  	struct security_hook_list *hp;
> 
> diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
> index 79573504783b..c8168d19fb96 100644
> --- a/security/selinux/hooks.c
> +++ b/security/selinux/hooks.c
> @@ -6327,7 +6327,7 @@ static void selinux_d_instantiate(struct dentry
> *dentry, struct inode *inode)
>  }
> 
>  static int selinux_getprocattr(struct task_struct *p,
> -			       char *name, char **value)
> +			       const char *name, char **value)
>  {
>  	const struct task_security_struct *__tsec;
>  	u32 sid;
> diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
> index 001831458fa2..434b348d8fcd 100644
> --- a/security/smack/smack_lsm.c
> +++ b/security/smack/smack_lsm.c
> @@ -3479,7 +3479,7 @@ static void smack_d_instantiate(struct dentry
> *opt_dentry, struct inode *inode)
>   *
>   * Returns the length of the smack label or an error code
>   */
> -static int smack_getprocattr(struct task_struct *p, char *name, char
> **value)
> +static int smack_getprocattr(struct task_struct *p, const char *name, char
> **value)
>  {
>  	struct smack_known *skp = smk_of_task_struct_obj(p);
>  	char *cp;
> --
> 2.30.2


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-18  6:08   ` Namjae Jeon
@ 2022-08-18 20:35     ` Al Viro
  2022-08-18 23:26       ` Namjae Jeon
  0 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2022-08-18 20:35 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

On Thu, Aug 18, 2022 at 03:08:36PM +0900, Namjae Jeon wrote:
> 2022-08-18 11:59 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> > ---
> >  fs/ksmbd/vfs.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
> > index 78d01033604c..a0fafba8b5d0 100644
> > --- a/fs/ksmbd/vfs.c
> > +++ b/fs/ksmbd/vfs.c
> > @@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work
> > *work,
> >  	*total_size_written = 0;
> >
> >  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
> > -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
> > +		pr_err("no right to read(%pf)\n", src_fp->filp);
> Isn't this probably %pD?

*blink*

It certainly is; thanks for catching that braino...  While we are at it,
there's several more places of the same form these days, so fixed and
updated variant follows:

ksmbd: don't open-code %pD
    
a bunch of places used %pd with file->f_path.dentry; shorter (and saner)
way to spell that is %pD with file...
    
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---

diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index 0e1924a6476d..bed670410c37 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -3897,8 +3897,7 @@ int smb2_query_dir(struct ksmbd_work *work)
 	    inode_permission(file_mnt_user_ns(dir_fp->filp),
 			     file_inode(dir_fp->filp),
 			     MAY_READ | MAY_EXEC)) {
-		pr_err("no right to enumerate directory (%pd)\n",
-		       dir_fp->filp->f_path.dentry);
+		pr_err("no right to enumerate directory (%pD)\n", dir_fp->filp);
 		rc = -EACCES;
 		goto err_out2;
 	}
@@ -6269,8 +6268,8 @@ int smb2_read(struct ksmbd_work *work)
 		goto out;
 	}
 
-	ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
-		    fp->filp->f_path.dentry, offset, length);
+	ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
+		    fp->filp, offset, length);
 
 	work->aux_payload_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO);
 	if (!work->aux_payload_buf) {
@@ -6534,8 +6533,8 @@ int smb2_write(struct ksmbd_work *work)
 		data_buf = (char *)(((char *)&req->hdr.ProtocolId) +
 				    le16_to_cpu(req->DataOffset));
 
-		ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
-			    fp->filp->f_path.dentry, offset, length);
+		ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
+			    fp->filp, offset, length);
 		err = ksmbd_vfs_write(work, fp, data_buf, length, &offset,
 				      writethrough, &nbytes);
 		if (err < 0)
diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
index 78d01033604c..0c04a59cbe60 100644
--- a/fs/ksmbd/vfs.c
+++ b/fs/ksmbd/vfs.c
@@ -377,8 +377,7 @@ int ksmbd_vfs_read(struct ksmbd_work *work, struct ksmbd_file *fp, size_t count,
 
 	if (work->conn->connection_type) {
 		if (!(fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
-			pr_err("no right to read(%pd)\n",
-			       fp->filp->f_path.dentry);
+			pr_err("no right to read(%pD)\n", fp->filp);
 			return -EACCES;
 		}
 	}
@@ -487,8 +486,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
 
 	if (work->conn->connection_type) {
 		if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
-			pr_err("no right to write(%pd)\n",
-			       fp->filp->f_path.dentry);
+			pr_err("no right to write(%pD)\n", fp->filp);
 			err = -EACCES;
 			goto out;
 		}
@@ -527,8 +525,8 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
 	if (sync) {
 		err = vfs_fsync_range(filp, offset, offset + *written, 0);
 		if (err < 0)
-			pr_err("fsync failed for filename = %pd, err = %d\n",
-			       fp->filp->f_path.dentry, err);
+			pr_err("fsync failed for filename = %pD, err = %d\n",
+			       fp->filp, err);
 	}
 
 out:
@@ -1743,11 +1741,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work *work,
 	*total_size_written = 0;
 
 	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
-		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
+		pr_err("no right to read(%pD)\n", src_fp->filp);
 		return -EACCES;
 	}
 	if (!(dst_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
-		pr_err("no right to write(%pd)\n", dst_fp->filp->f_path.dentry);
+		pr_err("no right to write(%pD)\n", dst_fp->filp);
 		return -EACCES;
 	}
 

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-18 20:35     ` Al Viro
@ 2022-08-18 23:26       ` Namjae Jeon
  2022-08-20  3:47         ` Al Viro
  0 siblings, 1 reply; 15+ messages in thread
From: Namjae Jeon @ 2022-08-18 23:26 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

2022-08-19 5:35 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> On Thu, Aug 18, 2022 at 03:08:36PM +0900, Namjae Jeon wrote:
>> 2022-08-18 11:59 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
>> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>> > ---
>> >  fs/ksmbd/vfs.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
>> > index 78d01033604c..a0fafba8b5d0 100644
>> > --- a/fs/ksmbd/vfs.c
>> > +++ b/fs/ksmbd/vfs.c
>> > @@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct
>> > ksmbd_work
>> > *work,
>> >  	*total_size_written = 0;
>> >
>> >  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
>> > -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
>> > +		pr_err("no right to read(%pf)\n", src_fp->filp);
>> Isn't this probably %pD?
>
> *blink*
>
> It certainly is; thanks for catching that braino...  While we are at it,
> there's several more places of the same form these days, so fixed and
> updated variant follows:
Thanks for updating the patch!
>
> ksmbd: don't open-code %pD
>
> a bunch of places used %pd with file->f_path.dentry; shorter (and saner)
> way to spell that is %pD with file...
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>

Thanks!
> ---
>
> diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
> index 0e1924a6476d..bed670410c37 100644
> --- a/fs/ksmbd/smb2pdu.c
> +++ b/fs/ksmbd/smb2pdu.c
> @@ -3897,8 +3897,7 @@ int smb2_query_dir(struct ksmbd_work *work)
>  	    inode_permission(file_mnt_user_ns(dir_fp->filp),
>  			     file_inode(dir_fp->filp),
>  			     MAY_READ | MAY_EXEC)) {
> -		pr_err("no right to enumerate directory (%pd)\n",
> -		       dir_fp->filp->f_path.dentry);
> +		pr_err("no right to enumerate directory (%pD)\n", dir_fp->filp);
>  		rc = -EACCES;
>  		goto err_out2;
>  	}
> @@ -6269,8 +6268,8 @@ int smb2_read(struct ksmbd_work *work)
>  		goto out;
>  	}
>
> -	ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
> -		    fp->filp->f_path.dentry, offset, length);
> +	ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
> +		    fp->filp, offset, length);
>
>  	work->aux_payload_buf = kvmalloc(length, GFP_KERNEL | __GFP_ZERO);
>  	if (!work->aux_payload_buf) {
> @@ -6534,8 +6533,8 @@ int smb2_write(struct ksmbd_work *work)
>  		data_buf = (char *)(((char *)&req->hdr.ProtocolId) +
>  				    le16_to_cpu(req->DataOffset));
>
> -		ksmbd_debug(SMB, "filename %pd, offset %lld, len %zu\n",
> -			    fp->filp->f_path.dentry, offset, length);
> +		ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
> +			    fp->filp, offset, length);
>  		err = ksmbd_vfs_write(work, fp, data_buf, length, &offset,
>  				      writethrough, &nbytes);
>  		if (err < 0)
> diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
> index 78d01033604c..0c04a59cbe60 100644
> --- a/fs/ksmbd/vfs.c
> +++ b/fs/ksmbd/vfs.c
> @@ -377,8 +377,7 @@ int ksmbd_vfs_read(struct ksmbd_work *work, struct
> ksmbd_file *fp, size_t count,
>
>  	if (work->conn->connection_type) {
>  		if (!(fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
> -			pr_err("no right to read(%pd)\n",
> -			       fp->filp->f_path.dentry);
> +			pr_err("no right to read(%pD)\n", fp->filp);
>  			return -EACCES;
>  		}
>  	}
> @@ -487,8 +486,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct
> ksmbd_file *fp,
>
>  	if (work->conn->connection_type) {
>  		if (!(fp->daccess & FILE_WRITE_DATA_LE)) {
> -			pr_err("no right to write(%pd)\n",
> -			       fp->filp->f_path.dentry);
> +			pr_err("no right to write(%pD)\n", fp->filp);
>  			err = -EACCES;
>  			goto out;
>  		}
> @@ -527,8 +525,8 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct
> ksmbd_file *fp,
>  	if (sync) {
>  		err = vfs_fsync_range(filp, offset, offset + *written, 0);
>  		if (err < 0)
> -			pr_err("fsync failed for filename = %pd, err = %d\n",
> -			       fp->filp->f_path.dentry, err);
> +			pr_err("fsync failed for filename = %pD, err = %d\n",
> +			       fp->filp, err);
>  	}
>
>  out:
> @@ -1743,11 +1741,11 @@ int ksmbd_vfs_copy_file_ranges(struct ksmbd_work
> *work,
>  	*total_size_written = 0;
>
>  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
> -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
> +		pr_err("no right to read(%pD)\n", src_fp->filp);
>  		return -EACCES;
>  	}
>  	if (!(dst_fp->daccess & (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE))) {
> -		pr_err("no right to write(%pd)\n", dst_fp->filp->f_path.dentry);
> +		pr_err("no right to write(%pD)\n", dst_fp->filp);
>  		return -EACCES;
>  	}
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-18 23:26       ` Namjae Jeon
@ 2022-08-20  3:47         ` Al Viro
  2022-08-20  5:44           ` Namjae Jeon
  0 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2022-08-20  3:47 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

On Fri, Aug 19, 2022 at 08:26:55AM +0900, Namjae Jeon wrote:
> 2022-08-19 5:35 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> > On Thu, Aug 18, 2022 at 03:08:36PM +0900, Namjae Jeon wrote:
> >> 2022-08-18 11:59 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> >> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> >> > ---
> >> >  fs/ksmbd/vfs.c | 4 ++--
> >> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
> >> > index 78d01033604c..a0fafba8b5d0 100644
> >> > --- a/fs/ksmbd/vfs.c
> >> > +++ b/fs/ksmbd/vfs.c
> >> > @@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct
> >> > ksmbd_work
> >> > *work,
> >> >  	*total_size_written = 0;
> >> >
> >> >  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
> >> > -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
> >> > +		pr_err("no right to read(%pf)\n", src_fp->filp);
> >> Isn't this probably %pD?
> >
> > *blink*
> >
> > It certainly is; thanks for catching that braino...  While we are at it,
> > there's several more places of the same form these days, so fixed and
> > updated variant follows:
> Thanks for updating the patch!

OK...  FWIW, I've another ksmbd patch hanging around and it might be
less PITA if I put it + those two patches into never-rebased branch
(for-ksmbd) for ksmbd folks to pull from.  Fewer pointless conflicts
that way...  The third patch is below:

ksmbd: constify struct path
    
... in particular, there should never be a non-const pointers to
any file->f_path.
    
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---

diff --git a/fs/ksmbd/misc.c b/fs/ksmbd/misc.c
index df991107ad2c..364a0a463dfc 100644
--- a/fs/ksmbd/misc.c
+++ b/fs/ksmbd/misc.c
@@ -159,7 +159,7 @@ int parse_stream_name(char *filename, char **stream_name, int *s_type)
  */
 
 char *convert_to_nt_pathname(struct ksmbd_share_config *share,
-			     struct path *path)
+			     const struct path *path)
 {
 	char *pathname, *ab_pathname, *nt_pathname;
 	int share_path_len = share->path_sz;
diff --git a/fs/ksmbd/misc.h b/fs/ksmbd/misc.h
index aae2a252945f..5a0ae2f8e5e7 100644
--- a/fs/ksmbd/misc.h
+++ b/fs/ksmbd/misc.h
@@ -15,7 +15,7 @@ int match_pattern(const char *str, size_t len, const char *pattern);
 int ksmbd_validate_filename(char *filename);
 int parse_stream_name(char *filename, char **stream_name, int *s_type);
 char *convert_to_nt_pathname(struct ksmbd_share_config *share,
-			     struct path *path);
+			     const struct path *path);
 int get_nlink(struct kstat *st);
 void ksmbd_conv_path_to_unix(char *path);
 void ksmbd_strip_last_slash(char *path);
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
index bed670410c37..2b7b9dad94fc 100644
--- a/fs/ksmbd/smb2pdu.c
+++ b/fs/ksmbd/smb2pdu.c
@@ -2183,7 +2183,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
  * Return:	0 on success, otherwise error
  */
 static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
-		       struct path *path)
+		       const struct path *path)
 {
 	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
 	char *attr_name = NULL, *value;
@@ -2270,7 +2270,7 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
 	return rc;
 }
 
-static noinline int smb2_set_stream_name_xattr(struct path *path,
+static noinline int smb2_set_stream_name_xattr(const struct path *path,
 					       struct ksmbd_file *fp,
 					       char *stream_name, int s_type)
 {
@@ -2309,7 +2309,7 @@ static noinline int smb2_set_stream_name_xattr(struct path *path,
 	return 0;
 }
 
-static int smb2_remove_smb_xattrs(struct path *path)
+static int smb2_remove_smb_xattrs(const struct path *path)
 {
 	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
 	char *name, *xattr_list = NULL;
@@ -2343,7 +2343,7 @@ static int smb2_remove_smb_xattrs(struct path *path)
 	return err;
 }
 
-static int smb2_create_truncate(struct path *path)
+static int smb2_create_truncate(const struct path *path)
 {
 	int rc = vfs_truncate(path, 0);
 
@@ -2362,7 +2362,7 @@ static int smb2_create_truncate(struct path *path)
 	return rc;
 }
 
-static void smb2_new_xattrs(struct ksmbd_tree_connect *tcon, struct path *path,
+static void smb2_new_xattrs(struct ksmbd_tree_connect *tcon, const struct path *path,
 			    struct ksmbd_file *fp)
 {
 	struct xattr_dos_attrib da = {0};
@@ -2385,7 +2385,7 @@ static void smb2_new_xattrs(struct ksmbd_tree_connect *tcon, struct path *path,
 }
 
 static void smb2_update_xattrs(struct ksmbd_tree_connect *tcon,
-			       struct path *path, struct ksmbd_file *fp)
+			       const struct path *path, struct ksmbd_file *fp)
 {
 	struct xattr_dos_attrib da;
 	int rc;
@@ -2445,7 +2445,7 @@ static int smb2_creat(struct ksmbd_work *work, struct path *path, char *name,
 
 static int smb2_create_sd_buffer(struct ksmbd_work *work,
 				 struct smb2_create_req *req,
-				 struct path *path)
+				 const struct path *path)
 {
 	struct create_context *context;
 	struct create_sd_buf_req *sd_buf;
@@ -4160,7 +4160,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct ksmbd_file *fp,
 	int rc, name_len, value_len, xattr_list_len, idx;
 	ssize_t buf_free_len, alignment_bytes, next_offset, rsp_data_cnt = 0;
 	struct smb2_ea_info_req *ea_req = NULL;
-	struct path *path;
+	const struct path *path;
 	struct user_namespace *user_ns = file_mnt_user_ns(fp->filp);
 
 	if (!(fp->daccess & FILE_READ_EA_LE)) {
@@ -4497,7 +4497,7 @@ static void get_file_stream_info(struct ksmbd_work *work,
 	struct smb2_file_stream_info *file_info;
 	char *stream_name, *xattr_list = NULL, *stream_buf;
 	struct kstat stat;
-	struct path *path = &fp->filp->f_path;
+	const struct path *path = &fp->filp->f_path;
 	ssize_t xattr_list_len;
 	int nbytes = 0, streamlen, stream_name_len, next, idx = 0;
 	int buf_free_len;
diff --git a/fs/ksmbd/smbacl.c b/fs/ksmbd/smbacl.c
index 3781bca2c8fc..85c4de640ed3 100644
--- a/fs/ksmbd/smbacl.c
+++ b/fs/ksmbd/smbacl.c
@@ -991,7 +991,7 @@ static void smb_set_ace(struct smb_ace *ace, const struct smb_sid *sid, u8 type,
 }
 
 int smb_inherit_dacl(struct ksmbd_conn *conn,
-		     struct path *path,
+		     const struct path *path,
 		     unsigned int uid, unsigned int gid)
 {
 	const struct smb_sid *psid, *creator = NULL;
@@ -1185,7 +1185,7 @@ bool smb_inherit_flags(int flags, bool is_dir)
 	return false;
 }
 
-int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
+int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
 			__le32 *pdaccess, int uid)
 {
 	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
@@ -1352,7 +1352,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
 }
 
 int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
-		 struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
+		 const struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
 		 bool type_check)
 {
 	int rc;
diff --git a/fs/ksmbd/smbacl.h b/fs/ksmbd/smbacl.h
index fcb2c83f2992..f06abf247445 100644
--- a/fs/ksmbd/smbacl.h
+++ b/fs/ksmbd/smbacl.h
@@ -201,12 +201,12 @@ void posix_state_to_acl(struct posix_acl_state *state,
 			struct posix_acl_entry *pace);
 int compare_sids(const struct smb_sid *ctsid, const struct smb_sid *cwsid);
 bool smb_inherit_flags(int flags, bool is_dir);
-int smb_inherit_dacl(struct ksmbd_conn *conn, struct path *path,
+int smb_inherit_dacl(struct ksmbd_conn *conn, const struct path *path,
 		     unsigned int uid, unsigned int gid);
-int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
+int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
 			__le32 *pdaccess, int uid);
 int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
-		 struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
+		 const struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
 		 bool type_check);
 void id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid);
 void ksmbd_init_domain(u32 *sub_auth);
diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
index 0c04a59cbe60..4fcf96a01c16 100644
--- a/fs/ksmbd/vfs.c
+++ b/fs/ksmbd/vfs.c
@@ -541,7 +541,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
  *
  * Return:	0 on success, otherwise error
  */
-int ksmbd_vfs_getattr(struct path *path, struct kstat *stat)
+int ksmbd_vfs_getattr(const struct path *path, struct kstat *stat)
 {
 	int err;
 
@@ -1166,7 +1166,7 @@ static int __caseless_lookup(struct dir_context *ctx, const char *name,
  *
  * Return:	0 on success, otherwise error
  */
-static int ksmbd_vfs_lookup_in_dir(struct path *dir, char *name, size_t namelen)
+static int ksmbd_vfs_lookup_in_dir(const struct path *dir, char *name, size_t namelen)
 {
 	int ret;
 	struct file *dfilp;
diff --git a/fs/ksmbd/vfs.h b/fs/ksmbd/vfs.h
index 70da4c0ba7ad..d7542a2dab52 100644
--- a/fs/ksmbd/vfs.h
+++ b/fs/ksmbd/vfs.h
@@ -85,7 +85,7 @@ int ksmbd_vfs_fsync(struct ksmbd_work *work, u64 fid, u64 p_id);
 int ksmbd_vfs_remove_file(struct ksmbd_work *work, char *name);
 int ksmbd_vfs_link(struct ksmbd_work *work,
 		   const char *oldname, const char *newname);
-int ksmbd_vfs_getattr(struct path *path, struct kstat *stat);
+int ksmbd_vfs_getattr(const struct path *path, struct kstat *stat);
 int ksmbd_vfs_fp_rename(struct ksmbd_work *work, struct ksmbd_file *fp,
 			char *newname);
 int ksmbd_vfs_truncate(struct ksmbd_work *work,

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-20  3:47         ` Al Viro
@ 2022-08-20  5:44           ` Namjae Jeon
  2022-08-20 15:33             ` Al Viro
  0 siblings, 1 reply; 15+ messages in thread
From: Namjae Jeon @ 2022-08-20  5:44 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

2022-08-20 12:47 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
> On Fri, Aug 19, 2022 at 08:26:55AM +0900, Namjae Jeon wrote:
>> 2022-08-19 5:35 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
>> > On Thu, Aug 18, 2022 at 03:08:36PM +0900, Namjae Jeon wrote:
>> >> 2022-08-18 11:59 GMT+09:00, Al Viro <viro@zeniv.linux.org.uk>:
>> >> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>> >> > ---
>> >> >  fs/ksmbd/vfs.c | 4 ++--
>> >> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >> >
>> >> > diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
>> >> > index 78d01033604c..a0fafba8b5d0 100644
>> >> > --- a/fs/ksmbd/vfs.c
>> >> > +++ b/fs/ksmbd/vfs.c
>> >> > @@ -1743,11 +1743,11 @@ int ksmbd_vfs_copy_file_ranges(struct
>> >> > ksmbd_work
>> >> > *work,
>> >> >  	*total_size_written = 0;
>> >> >
>> >> >  	if (!(src_fp->daccess & (FILE_READ_DATA_LE | FILE_EXECUTE_LE))) {
>> >> > -		pr_err("no right to read(%pd)\n", src_fp->filp->f_path.dentry);
>> >> > +		pr_err("no right to read(%pf)\n", src_fp->filp);
>> >> Isn't this probably %pD?
>> >
>> > *blink*
>> >
>> > It certainly is; thanks for catching that braino...  While we are at
>> > it,
>> > there's several more places of the same form these days, so fixed and
>> > updated variant follows:
>> Thanks for updating the patch!
>
> OK...  FWIW, I've another ksmbd patch hanging around and it might be
> less PITA if I put it + those two patches into never-rebased branch
> (for-ksmbd) for ksmbd folks to pull from.  Fewer pointless conflicts
> that way...
Okay, Thanks for this. I'm trying to resend "ksmbd: fix racy issue
from using ->d_parent and ->d_name" patch to you, but It conflict with
these patches:)
We will pull them from that branch if you create it.

> The third patch is below:
>
> ksmbd: constify struct path
>
> ... in particular, there should never be a non-const pointers to
> any file->f_path.
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Looks good to me!

Acked-by: Namjae Jeon <linkinjeon@kernel.org>

Thanks!
> ---
>
> diff --git a/fs/ksmbd/misc.c b/fs/ksmbd/misc.c
> index df991107ad2c..364a0a463dfc 100644
> --- a/fs/ksmbd/misc.c
> +++ b/fs/ksmbd/misc.c
> @@ -159,7 +159,7 @@ int parse_stream_name(char *filename, char
> **stream_name, int *s_type)
>   */
>
>  char *convert_to_nt_pathname(struct ksmbd_share_config *share,
> -			     struct path *path)
> +			     const struct path *path)
>  {
>  	char *pathname, *ab_pathname, *nt_pathname;
>  	int share_path_len = share->path_sz;
> diff --git a/fs/ksmbd/misc.h b/fs/ksmbd/misc.h
> index aae2a252945f..5a0ae2f8e5e7 100644
> --- a/fs/ksmbd/misc.h
> +++ b/fs/ksmbd/misc.h
> @@ -15,7 +15,7 @@ int match_pattern(const char *str, size_t len, const char
> *pattern);
>  int ksmbd_validate_filename(char *filename);
>  int parse_stream_name(char *filename, char **stream_name, int *s_type);
>  char *convert_to_nt_pathname(struct ksmbd_share_config *share,
> -			     struct path *path);
> +			     const struct path *path);
>  int get_nlink(struct kstat *st);
>  void ksmbd_conv_path_to_unix(char *path);
>  void ksmbd_strip_last_slash(char *path);
> diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c
> index bed670410c37..2b7b9dad94fc 100644
> --- a/fs/ksmbd/smb2pdu.c
> +++ b/fs/ksmbd/smb2pdu.c
> @@ -2183,7 +2183,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work
> *work)
>   * Return:	0 on success, otherwise error
>   */
>  static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
> -		       struct path *path)
> +		       const struct path *path)
>  {
>  	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
>  	char *attr_name = NULL, *value;
> @@ -2270,7 +2270,7 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf,
> unsigned int buf_len,
>  	return rc;
>  }
>
> -static noinline int smb2_set_stream_name_xattr(struct path *path,
> +static noinline int smb2_set_stream_name_xattr(const struct path *path,
>  					       struct ksmbd_file *fp,
>  					       char *stream_name, int s_type)
>  {
> @@ -2309,7 +2309,7 @@ static noinline int smb2_set_stream_name_xattr(struct
> path *path,
>  	return 0;
>  }
>
> -static int smb2_remove_smb_xattrs(struct path *path)
> +static int smb2_remove_smb_xattrs(const struct path *path)
>  {
>  	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
>  	char *name, *xattr_list = NULL;
> @@ -2343,7 +2343,7 @@ static int smb2_remove_smb_xattrs(struct path *path)
>  	return err;
>  }
>
> -static int smb2_create_truncate(struct path *path)
> +static int smb2_create_truncate(const struct path *path)
>  {
>  	int rc = vfs_truncate(path, 0);
>
> @@ -2362,7 +2362,7 @@ static int smb2_create_truncate(struct path *path)
>  	return rc;
>  }
>
> -static void smb2_new_xattrs(struct ksmbd_tree_connect *tcon, struct path
> *path,
> +static void smb2_new_xattrs(struct ksmbd_tree_connect *tcon, const struct
> path *path,
>  			    struct ksmbd_file *fp)
>  {
>  	struct xattr_dos_attrib da = {0};
> @@ -2385,7 +2385,7 @@ static void smb2_new_xattrs(struct ksmbd_tree_connect
> *tcon, struct path *path,
>  }
>
>  static void smb2_update_xattrs(struct ksmbd_tree_connect *tcon,
> -			       struct path *path, struct ksmbd_file *fp)
> +			       const struct path *path, struct ksmbd_file *fp)
>  {
>  	struct xattr_dos_attrib da;
>  	int rc;
> @@ -2445,7 +2445,7 @@ static int smb2_creat(struct ksmbd_work *work, struct
> path *path, char *name,
>
>  static int smb2_create_sd_buffer(struct ksmbd_work *work,
>  				 struct smb2_create_req *req,
> -				 struct path *path)
> +				 const struct path *path)
>  {
>  	struct create_context *context;
>  	struct create_sd_buf_req *sd_buf;
> @@ -4160,7 +4160,7 @@ static int smb2_get_ea(struct ksmbd_work *work, struct
> ksmbd_file *fp,
>  	int rc, name_len, value_len, xattr_list_len, idx;
>  	ssize_t buf_free_len, alignment_bytes, next_offset, rsp_data_cnt = 0;
>  	struct smb2_ea_info_req *ea_req = NULL;
> -	struct path *path;
> +	const struct path *path;
>  	struct user_namespace *user_ns = file_mnt_user_ns(fp->filp);
>
>  	if (!(fp->daccess & FILE_READ_EA_LE)) {
> @@ -4497,7 +4497,7 @@ static void get_file_stream_info(struct ksmbd_work
> *work,
>  	struct smb2_file_stream_info *file_info;
>  	char *stream_name, *xattr_list = NULL, *stream_buf;
>  	struct kstat stat;
> -	struct path *path = &fp->filp->f_path;
> +	const struct path *path = &fp->filp->f_path;
>  	ssize_t xattr_list_len;
>  	int nbytes = 0, streamlen, stream_name_len, next, idx = 0;
>  	int buf_free_len;
> diff --git a/fs/ksmbd/smbacl.c b/fs/ksmbd/smbacl.c
> index 3781bca2c8fc..85c4de640ed3 100644
> --- a/fs/ksmbd/smbacl.c
> +++ b/fs/ksmbd/smbacl.c
> @@ -991,7 +991,7 @@ static void smb_set_ace(struct smb_ace *ace, const
> struct smb_sid *sid, u8 type,
>  }
>
>  int smb_inherit_dacl(struct ksmbd_conn *conn,
> -		     struct path *path,
> +		     const struct path *path,
>  		     unsigned int uid, unsigned int gid)
>  {
>  	const struct smb_sid *psid, *creator = NULL;
> @@ -1185,7 +1185,7 @@ bool smb_inherit_flags(int flags, bool is_dir)
>  	return false;
>  }
>
> -int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
> +int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
>  			__le32 *pdaccess, int uid)
>  {
>  	struct user_namespace *user_ns = mnt_user_ns(path->mnt);
> @@ -1352,7 +1352,7 @@ int smb_check_perm_dacl(struct ksmbd_conn *conn,
> struct path *path,
>  }
>
>  int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
> -		 struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
> +		 const struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
>  		 bool type_check)
>  {
>  	int rc;
> diff --git a/fs/ksmbd/smbacl.h b/fs/ksmbd/smbacl.h
> index fcb2c83f2992..f06abf247445 100644
> --- a/fs/ksmbd/smbacl.h
> +++ b/fs/ksmbd/smbacl.h
> @@ -201,12 +201,12 @@ void posix_state_to_acl(struct posix_acl_state
> *state,
>  			struct posix_acl_entry *pace);
>  int compare_sids(const struct smb_sid *ctsid, const struct smb_sid
> *cwsid);
>  bool smb_inherit_flags(int flags, bool is_dir);
> -int smb_inherit_dacl(struct ksmbd_conn *conn, struct path *path,
> +int smb_inherit_dacl(struct ksmbd_conn *conn, const struct path *path,
>  		     unsigned int uid, unsigned int gid);
> -int smb_check_perm_dacl(struct ksmbd_conn *conn, struct path *path,
> +int smb_check_perm_dacl(struct ksmbd_conn *conn, const struct path *path,
>  			__le32 *pdaccess, int uid);
>  int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
> -		 struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
> +		 const struct path *path, struct smb_ntsd *pntsd, int ntsd_len,
>  		 bool type_check);
>  void id_to_sid(unsigned int cid, uint sidtype, struct smb_sid *ssid);
>  void ksmbd_init_domain(u32 *sub_auth);
> diff --git a/fs/ksmbd/vfs.c b/fs/ksmbd/vfs.c
> index 0c04a59cbe60..4fcf96a01c16 100644
> --- a/fs/ksmbd/vfs.c
> +++ b/fs/ksmbd/vfs.c
> @@ -541,7 +541,7 @@ int ksmbd_vfs_write(struct ksmbd_work *work, struct
> ksmbd_file *fp,
>   *
>   * Return:	0 on success, otherwise error
>   */
> -int ksmbd_vfs_getattr(struct path *path, struct kstat *stat)
> +int ksmbd_vfs_getattr(const struct path *path, struct kstat *stat)
>  {
>  	int err;
>
> @@ -1166,7 +1166,7 @@ static int __caseless_lookup(struct dir_context *ctx,
> const char *name,
>   *
>   * Return:	0 on success, otherwise error
>   */
> -static int ksmbd_vfs_lookup_in_dir(struct path *dir, char *name, size_t
> namelen)
> +static int ksmbd_vfs_lookup_in_dir(const struct path *dir, char *name,
> size_t namelen)
>  {
>  	int ret;
>  	struct file *dfilp;
> diff --git a/fs/ksmbd/vfs.h b/fs/ksmbd/vfs.h
> index 70da4c0ba7ad..d7542a2dab52 100644
> --- a/fs/ksmbd/vfs.h
> +++ b/fs/ksmbd/vfs.h
> @@ -85,7 +85,7 @@ int ksmbd_vfs_fsync(struct ksmbd_work *work, u64 fid, u64
> p_id);
>  int ksmbd_vfs_remove_file(struct ksmbd_work *work, char *name);
>  int ksmbd_vfs_link(struct ksmbd_work *work,
>  		   const char *oldname, const char *newname);
> -int ksmbd_vfs_getattr(struct path *path, struct kstat *stat);
> +int ksmbd_vfs_getattr(const struct path *path, struct kstat *stat);
>  int ksmbd_vfs_fp_rename(struct ksmbd_work *work, struct ksmbd_file *fp,
>  			char *newname);
>  int ksmbd_vfs_truncate(struct ksmbd_work *work,
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-20  5:44           ` Namjae Jeon
@ 2022-08-20 15:33             ` Al Viro
  2022-08-21  2:06               ` Steve French
  0 siblings, 1 reply; 15+ messages in thread
From: Al Viro @ 2022-08-20 15:33 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: linux-fsdevel, Linux Kernel Mailing List, CIFS

On Sat, Aug 20, 2022 at 02:44:29PM +0900, Namjae Jeon wrote:
> > OK...  FWIW, I've another ksmbd patch hanging around and it might be
> > less PITA if I put it + those two patches into never-rebased branch
> > (for-ksmbd) for ksmbd folks to pull from.  Fewer pointless conflicts
> > that way...
> Okay, Thanks for this. I'm trying to resend "ksmbd: fix racy issue
> from using ->d_parent and ->d_name" patch to you, but It conflict with
> these patches:)
> We will pull them from that branch if you create it.

OK, pull request follows:

The following changes since commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868:

  Linux 6.0-rc1 (2022-08-14 15:50:18 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git tags/pull-ksmbd

for you to fetch changes up to f2ea6d96500dd8947467f774d70700c1ba3ed8ef:

  ksmbd: constify struct path (2022-08-20 10:54:48 -0400)

----------------------------------------------------------------
assorted ksmbd cleanups

Al Viro <viro@zeniv.linux.org.uk>

----------------------------------------------------------------
Al Viro (3):
      ksmbd: don't open-code file_path()
      ksmbd: don't open-code %pD
      ksmbd: constify struct path

 fs/ksmbd/misc.c    |  2 +-
 fs/ksmbd/misc.h    |  2 +-
 fs/ksmbd/smb2pdu.c | 33 ++++++++++++++++-----------------
 fs/ksmbd/smbacl.c  |  6 +++---
 fs/ksmbd/smbacl.h  |  6 +++---
 fs/ksmbd/vfs.c     | 18 ++++++++----------
 fs/ksmbd/vfs.h     |  2 +-
 7 files changed, 33 insertions(+), 36 deletions(-)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] ksmbd: don't open-code %pf
  2022-08-20 15:33             ` Al Viro
@ 2022-08-21  2:06               ` Steve French
  0 siblings, 0 replies; 15+ messages in thread
From: Steve French @ 2022-08-21  2:06 UTC (permalink / raw)
  To: Al Viro; +Cc: Namjae Jeon, linux-fsdevel, Linux Kernel Mailing List, CIFS

merged into ksmbd-for-next

On Sat, Aug 20, 2022 at 10:34 AM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Sat, Aug 20, 2022 at 02:44:29PM +0900, Namjae Jeon wrote:
> > > OK...  FWIW, I've another ksmbd patch hanging around and it might be
> > > less PITA if I put it + those two patches into never-rebased branch
> > > (for-ksmbd) for ksmbd folks to pull from.  Fewer pointless conflicts
> > > that way...
> > Okay, Thanks for this. I'm trying to resend "ksmbd: fix racy issue
> > from using ->d_parent and ->d_name" patch to you, but It conflict with
> > these patches:)
> > We will pull them from that branch if you create it.
>
> OK, pull request follows:
>
> The following changes since commit 568035b01cfb107af8d2e4bd2fb9aea22cf5b868:
>
>   Linux 6.0-rc1 (2022-08-14 15:50:18 -0700)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git tags/pull-ksmbd
>
> for you to fetch changes up to f2ea6d96500dd8947467f774d70700c1ba3ed8ef:
>
>   ksmbd: constify struct path (2022-08-20 10:54:48 -0400)
>
> ----------------------------------------------------------------
> assorted ksmbd cleanups
>
> Al Viro <viro@zeniv.linux.org.uk>
>
> ----------------------------------------------------------------
> Al Viro (3):
>       ksmbd: don't open-code file_path()
>       ksmbd: don't open-code %pD
>       ksmbd: constify struct path
>
>  fs/ksmbd/misc.c    |  2 +-
>  fs/ksmbd/misc.h    |  2 +-
>  fs/ksmbd/smb2pdu.c | 33 ++++++++++++++++-----------------
>  fs/ksmbd/smbacl.c  |  6 +++---
>  fs/ksmbd/smbacl.h  |  6 +++---
>  fs/ksmbd/vfs.c     | 18 ++++++++----------
>  fs/ksmbd/vfs.h     |  2 +-
>  7 files changed, 33 insertions(+), 36 deletions(-)



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM...
  2022-08-18  2:58 ` [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM Al Viro
  2022-08-18 18:34   ` Schaufler, Casey
@ 2022-08-26  7:45   ` Christian Brauner
  1 sibling, 0 replies; 15+ messages in thread
From: Christian Brauner @ 2022-08-26  7:45 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, linux-kernel

On Thu, Aug 18, 2022 at 03:58:51AM +0100, Al Viro wrote:
> cast of ->d_name.name to char * is completely wrong - nothing is
> allowed to modify its contents.
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---

Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-08-26  7:46 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  2:57 [PATCH 1/5] dynamic_dname(): drop unused dentry argument Al Viro
2022-08-18  2:58 ` [PATCH 2/5] ksmbd: don't open-code file_path() Al Viro
2022-08-18  6:19   ` Namjae Jeon
2022-08-18  2:58 ` [PATCH 3/5] ->getprocattr(): attribute name is const char *, TYVM Al Viro
2022-08-18 18:34   ` Schaufler, Casey
2022-08-26  7:45   ` Christian Brauner
2022-08-18  2:59 ` [PATCH 4/5] ksmbd: don't open-code %pf Al Viro
2022-08-18  6:08   ` Namjae Jeon
2022-08-18 20:35     ` Al Viro
2022-08-18 23:26       ` Namjae Jeon
2022-08-20  3:47         ` Al Viro
2022-08-20  5:44           ` Namjae Jeon
2022-08-20 15:33             ` Al Viro
2022-08-21  2:06               ` Steve French
2022-08-18  2:59 ` [PATCH 5/5] d_path.c: typo fix Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).