cifs: Do not attempt to call CIFSGetSrvInodeNumber() without CAP_INFOLEVEL_PASSTHRU
authorPali Rohár <pali@kernel.org>
Sat, 28 Dec 2024 20:21:56 +0000 (21:21 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 20 Jan 2025 01:58:11 +0000 (19:58 -0600)
commit10e6fe53d90b550876bffc5847107c5372c01084
tree1c41ae64d46bcb577ebd8d8422e198db72b7bcc9
parente20a405fe4f240d94f1baaa0eaf816cbf16ffb60
cifs: Do not attempt to call CIFSGetSrvInodeNumber() without CAP_INFOLEVEL_PASSTHRU

CIFSGetSrvInodeNumber() uses SMB_QUERY_FILE_INTERNAL_INFO (0x3ee) level
which is SMB PASSTHROUGH level (>= 0x03e8). SMB PASSTHROUGH levels are
supported only when server announce CAP_INFOLEVEL_PASSTHRU.

So add guard in cifs_query_file_info() function which is the only user of
CIFSGetSrvInodeNumber() function and returns -EOPNOTSUPP when server does
not announce CAP_INFOLEVEL_PASSTHRU.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb1ops.c