@@ -1451,6 +1451,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
14511451 __u8 oplock = SMB2_OPLOCK_LEVEL_NONE ;
14521452 struct cifs_open_parms oparms ;
14531453 struct cifs_fid fid ;
1454+ struct kvec err_iov = {NULL , 0 };
14541455 struct smb2_err_rsp * err_buf = NULL ;
14551456 struct smb2_symlink_err_rsp * symlink ;
14561457 unsigned int sub_len ;
@@ -1473,15 +1474,16 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
14731474 oparms .fid = & fid ;
14741475 oparms .reconnect = false;
14751476
1476- rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_buf );
1477+ rc = SMB2_open (xid , & oparms , utf16_path , & oplock , NULL , & err_iov );
14771478
14781479 if (!rc || !err_buf ) {
14791480 kfree (utf16_path );
14801481 return - ENOENT ;
14811482 }
14821483
1484+ err_buf = err_iov .iov_base ;
14831485 if (le32_to_cpu (err_buf -> ByteCount ) < sizeof (struct smb2_symlink_err_rsp ) ||
1484- get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size < SMB2_SYMLINK_STRUCT_SIZE ) {
1486+ err_iov . iov_len + server -> vals -> header_preamble_size < SMB2_SYMLINK_STRUCT_SIZE ) {
14851487 kfree (utf16_path );
14861488 return - ENOENT ;
14871489 }
@@ -1494,13 +1496,13 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon,
14941496 print_len = le16_to_cpu (symlink -> PrintNameLength );
14951497 print_offset = le16_to_cpu (symlink -> PrintNameOffset );
14961498
1497- if (get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size <
1499+ if (err_iov . iov_len + server -> vals -> header_preamble_size <
14981500 SMB2_SYMLINK_STRUCT_SIZE + sub_offset + sub_len ) {
14991501 kfree (utf16_path );
15001502 return - ENOENT ;
15011503 }
15021504
1503- if (get_rfc1002_length ( err_buf ) + server -> vals -> header_preamble_size <
1505+ if (err_iov . iov_len + server -> vals -> header_preamble_size <
15041506 SMB2_SYMLINK_STRUCT_SIZE + print_offset + print_len ) {
15051507 kfree (utf16_path );
15061508 return - ENOENT ;
0 commit comments