]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
cifs: improve checking of DFS links over STATUS_OBJECT_NAME_INVALID
authorPaulo Alcantara <pc@manguebit.com>
Tue, 28 Feb 2023 22:01:54 +0000 (19:01 -0300)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:47:19 +0000 (16:47 +0100)
commit55fdcb63136c1441a5ee3c52978b87d8faf52910
tree5cb62dea8c4c260bb19bd1a5e0529dd9f862e0c6
parentb83de1156def9189325fcb658b73ca972f48cb14
cifs: improve checking of DFS links over STATUS_OBJECT_NAME_INVALID

BugLink: https://bugs.launchpad.net/bugs/2011425
commit b9ee2e307c6b06384b6f9e393a9b8e048e8fc277 upstream.

Do not map STATUS_OBJECT_NAME_INVALID to -EREMOTE under non-DFS
shares, or 'nodfs' mounts or CONFIG_CIFS_DFS_UPCALL=n builds.
Otherwise, in the slow path, get a referral to figure out whether it
is an actual DFS link.

This could be simply reproduced under a non-DFS share by running the
following

  $ mount.cifs //srv/share /mnt -o ...
  $ cat /mnt/$(printf '\U110000')
  cat: '/mnt/'$'\364\220\200\200': Object is remote

Fixes: c877ce47e137 ("cifs: reduce roundtrips on create/qinfo requests")
CC: stable@vger.kernel.org # 6.2
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/cifs/cifsproto.h
fs/cifs/misc.c
fs/cifs/smb2inode.c
fs/cifs/smb2ops.c