smb3: fix access denied on change notify request to some servers
authorSteve French <stfrench@microsoft.com>
Tue, 7 Jul 2020 23:08:46 +0000 (18:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:13:32 +0000 (08:13 +0200)
commit 4ef9b4f1a76ea2370fbfe20e80fef141ab92b65e upstream.

read permission, not just read attributes permission, is required
on the directory.

See MS-SMB2 (protocol specification) section 3.3.5.19.

Signed-off-by: Steve French <stfrench@microsoft.com>
CC: Stable <stable@vger.kernel.org> # v5.6+
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c

index 6fc69c3b2749d954cb607c358b36a904046064b7..bf13917ec1a4af5815467e739f1a5e023d7597d6 100644 (file)
@@ -2119,7 +2119,7 @@ smb3_notify(const unsigned int xid, struct file *pfile,
 
        tcon = cifs_sb_master_tcon(cifs_sb);
        oparms.tcon = tcon;
-       oparms.desired_access = FILE_READ_ATTRIBUTES;
+       oparms.desired_access = FILE_READ_ATTRIBUTES | FILE_READ_DATA;
        oparms.disposition = FILE_OPEN;
        oparms.create_options = cifs_create_options(cifs_sb, 0);
        oparms.fid = &fid;