lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH2r5mtA3cYYDMkqai3Gs7Op44O2e4cZ_V=stS1o9MnDFu4T5A@mail.gmail.com>
Date: Fri, 28 Nov 2025 21:55:23 -0600
From: Steve French <smfrench@...il.com>
To: Aaditya Kansal <aadityakansal390@...il.com>
Cc: sfrench@...ba.org, pc@...guebit.org, ronniesahlberg@...il.com, 
	sprasad@...rosoft.com, tom@...pey.com, linux-cifs@...r.kernel.org, 
	linux-kernel@...r.kernel.org, bharathsm@...rosoft.com, 
	skhan@...uxfoundation.org, david.hunter.linux@...il.com
Subject: Re: [PATCH] ksmbd: Add check in cifs_mkdir() for SMB2/3

Looking at this more carefully it looks like the comment is wrong (it
can't be skipped for SMB2 and later currently, there is code in it
that is non-SMB1 specific).  Looks like this patch is incorrect.
There is a general todo to rewrite cifs_mkdir() more cleanly (and
partition out the smb1 mkdir code and smb1 posix mkdir code more
cleanly via an smb1 specific helper function) but looks like we can't
skip cifs_mkdir_qinfo() as your patch would

On Thu, Nov 27, 2025 at 6:27 AM Aaditya Kansal
<aadityakansal390@...il.com> wrote:
>
> Add a version check in cifs_mkdir(). The check skips a function call to
> cifs_mkdir_qinfo() for SMB 2/3.
>
> Signed-off-by: Aaditya Kansal <aadityakansal390@...il.com>
> ---
>  fs/smb/client/inode.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
> index cac355364e43..f6f223a5a97b 100644
> --- a/fs/smb/client/inode.c
> +++ b/fs/smb/client/inode.c
> @@ -2314,9 +2314,9 @@ struct dentry *cifs_mkdir(struct mnt_idmap *idmap, struct inode *inode,
>                 goto mkdir_out;
>         }
>
> -       /* TODO: skip this for smb2/smb3 */
> -       rc = cifs_mkdir_qinfo(inode, direntry, mode, full_path, cifs_sb, tcon,
> -                             xid);
> +       if (server->vals->protocol_id == SMB10_PROT_ID)
> +               rc = cifs_mkdir_qinfo(inode, direntry, mode, full_path, cifs_sb,
> +                               tcon, xid);
>  mkdir_out:
>         /*
>          * Force revalidate to get parent dir info when needed since cached
> --
> 2.52.0
>
>


-- 
Thanks,

Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ