From df070afd9b8c952eacf49db54cae7138eb9deaeb Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 9 Jul 2019 18:41:11 +1000 Subject: cifs: fix parsing of symbolic link error response RHBZ: 1672539 In smb2_query_symlink(), if we are parsing the error buffer but it is not something we recognize as a symlink we should return -EINVAL and not -ENOENT. I.e. the entry does exist, it is just not something we recognize. Additionally, add check to verify that that the errortag and the reparsetag all make sense. Signed-off-by: Ronnie Sahlberg Acked-by: Paulo Alcantara Signed-off-by: Steve French --- fs/cifs/smb2pdu.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/cifs/smb2pdu.h') diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 458bad01ca74..7e2e782f8edd 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -166,6 +166,8 @@ struct smb2_err_rsp { __u8 ErrorData[1]; /* variable length */ } __packed; +#define SYMLINK_ERROR_TAG 0x4c4d5953 + struct smb2_symlink_err_rsp { __le32 SymLinkLength; __le32 SymLinkErrorTag; -- cgit v1.2.3-58-ga151