diff options
author | Paulo Alcantara <pc@manguebit.com> | 2024-01-07 00:05:18 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-01-08 04:18:00 +0100 |
commit | 8a3c4e44c243308c2364a00f9944c3d6fbdeb125 (patch) | |
tree | 049277c1f23d0e0e070eb5e06fd7a60745e27219 /fs/smb/client/smb2ops.c | |
parent | smb: client: stop revalidating reparse points unnecessarily (diff) | |
download | linux-8a3c4e44c243308c2364a00f9944c3d6fbdeb125.tar.xz linux-8a3c4e44c243308c2364a00f9944c3d6fbdeb125.zip |
cifs: get rid of dup length check in parse_reparse_point()
smb2_compound_op(SMB2_OP_GET_REPARSE) already checks if ioctl response
has a valid reparse data buffer's length, so there's no need to check
it again in parse_reparse_point().
In order to get rid of duplicate check, validate reparse data buffer's
length also in cifs_query_reparse_point().
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r-- | fs/smb/client/smb2ops.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 938d51a88dd6..01a5bd7e6a30 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -2947,18 +2947,6 @@ int parse_reparse_point(struct reparse_data_buffer *buf, u32 plen, struct cifs_sb_info *cifs_sb, bool unicode, struct cifs_open_info_data *data) { - if (plen < sizeof(*buf)) { - cifs_dbg(VFS, "%s: reparse buffer is too small. Must be at least 8 bytes but was %d\n", - __func__, plen); - return -EIO; - } - - if (plen < le16_to_cpu(buf->ReparseDataLength) + sizeof(*buf)) { - cifs_dbg(VFS, "%s: invalid reparse buf length: %d\n", - __func__, plen); - return -EIO; - } - data->reparse.buf = buf; /* See MS-FSCC 2.1.2 */ |