File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -402,9 +402,17 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
402
402
(struct smb_com_transaction_change_notify_rsp * )buf ;
403
403
struct file_notify_information * pnotify ;
404
404
__u32 data_offset = 0 ;
405
+ size_t len = srv -> total_read - sizeof (pSMBr -> hdr .smb_buf_length );
406
+
405
407
if (get_bcc (buf ) > sizeof (struct file_notify_information )) {
406
408
data_offset = le32_to_cpu (pSMBr -> DataOffset );
407
409
410
+ if (data_offset >
411
+ len - sizeof (struct file_notify_information )) {
412
+ cifs_dbg (FYI , "invalid data_offset %u\n" ,
413
+ data_offset );
414
+ return true;
415
+ }
408
416
pnotify = (struct file_notify_information * )
409
417
((char * )& pSMBr -> hdr .Protocol + data_offset );
410
418
cifs_dbg (FYI , "dnotify on %s Action: 0x%x\n" ,
You can’t perform that action at this time.
0 commit comments