]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:21 +0000 (08:50 +0100)
commit512aa2fd8c9f624af55ee970ca36b15cf9d71855
tree74341ac4e5fcae3b7e6f3f33445dd4bc21a03e40
parentb0bb13612292ca90fa4c2a7e425375649bc50d3e
cifs: improve checking of DFS links over STATUS_OBJECT_NAME_INVALID

[ Upstream commit b9ee2e307c6b06384b6f9e393a9b8e048e8fc277 ]

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: Sasha Levin <sashal@kernel.org>
fs/cifs/cifsproto.h
fs/cifs/misc.c
fs/cifs/smb2inode.c
fs/cifs/smb2ops.c