File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -8414,28 +8414,28 @@ int smb3_decrypt_req(struct ksmbd_work *work)
8414
8414
unsigned int buf_data_size = pdu_length + 4 -
8415
8415
sizeof (struct smb2_transform_hdr );
8416
8416
struct smb2_transform_hdr * tr_hdr = (struct smb2_transform_hdr * )buf ;
8417
- unsigned int orig_len = le32_to_cpu (tr_hdr -> OriginalMessageSize );
8418
8417
int rc = 0 ;
8419
8418
8420
- sess = ksmbd_session_lookup_all (conn , le64_to_cpu (tr_hdr -> SessionId ));
8421
- if (!sess ) {
8422
- pr_err ("invalid session id(%llx) in transform header\n" ,
8423
- le64_to_cpu (tr_hdr -> SessionId ));
8424
- return - ECONNABORTED ;
8425
- }
8426
-
8427
8419
if (pdu_length + 4 <
8428
8420
sizeof (struct smb2_transform_hdr ) + sizeof (struct smb2_hdr )) {
8429
8421
pr_err ("Transform message is too small (%u)\n" ,
8430
8422
pdu_length );
8431
8423
return - ECONNABORTED ;
8432
8424
}
8433
8425
8434
- if (pdu_length + 4 < orig_len + sizeof (struct smb2_transform_hdr )) {
8426
+ if (pdu_length + 4 <
8427
+ le32_to_cpu (tr_hdr -> OriginalMessageSize ) + sizeof (struct smb2_transform_hdr )) {
8435
8428
pr_err ("Transform message is broken\n" );
8436
8429
return - ECONNABORTED ;
8437
8430
}
8438
8431
8432
+ sess = ksmbd_session_lookup_all (conn , le64_to_cpu (tr_hdr -> SessionId ));
8433
+ if (!sess ) {
8434
+ pr_err ("invalid session id(%llx) in transform header\n" ,
8435
+ le64_to_cpu (tr_hdr -> SessionId ));
8436
+ return - ECONNABORTED ;
8437
+ }
8438
+
8439
8439
iov [0 ].iov_base = buf ;
8440
8440
iov [0 ].iov_len = sizeof (struct smb2_transform_hdr );
8441
8441
iov [1 ].iov_base = buf + sizeof (struct smb2_transform_hdr );
You can’t perform that action at this time.
0 commit comments