File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -2708,6 +2708,13 @@ static int parse_durable_handle_context(struct ksmbd_work *work,
27082708 goto out ;
27092709 }
27102710
2711+ if (le16_to_cpu (context -> DataOffset ) +
2712+ le32_to_cpu (context -> DataLength ) <
2713+ sizeof (struct create_durable_reconn_v2_req )) {
2714+ err = - EINVAL ;
2715+ goto out ;
2716+ }
2717+
27112718 recon_v2 = (struct create_durable_reconn_v2_req * )context ;
27122719 persistent_id = recon_v2 -> Fid .PersistentFileId ;
27132720 dh_info -> fp = ksmbd_lookup_durable_fd (persistent_id );
@@ -2741,6 +2748,13 @@ static int parse_durable_handle_context(struct ksmbd_work *work,
27412748 goto out ;
27422749 }
27432750
2751+ if (le16_to_cpu (context -> DataOffset ) +
2752+ le32_to_cpu (context -> DataLength ) <
2753+ sizeof (struct create_durable_reconn_req )) {
2754+ err = - EINVAL ;
2755+ goto out ;
2756+ }
2757+
27442758 recon = (struct create_durable_reconn_req * )context ;
27452759 persistent_id = recon -> Data .Fid .PersistentFileId ;
27462760 dh_info -> fp = ksmbd_lookup_durable_fd (persistent_id );
@@ -2766,6 +2780,13 @@ static int parse_durable_handle_context(struct ksmbd_work *work,
27662780 goto out ;
27672781 }
27682782
2783+ if (le16_to_cpu (context -> DataOffset ) +
2784+ le32_to_cpu (context -> DataLength ) <
2785+ sizeof (struct create_durable_req_v2 )) {
2786+ err = - EINVAL ;
2787+ goto out ;
2788+ }
2789+
27692790 durable_v2_blob =
27702791 (struct create_durable_req_v2 * )context ;
27712792 ksmbd_debug (SMB , "Request for durable v2 open\n" );
You can’t perform that action at this time.
0 commit comments