File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -637,7 +637,14 @@ static void gen_prov_start(struct prov_rx *rx, struct net_buf_simple *buf)
637637
638638 link .rx .last_seg = START_LAST_SEG (rx -> gpc );
639639
640+ /* This (BIT(0) is set) can happen if we received a Transaction Continuation PDU, before
641+ * receiving a Transaction Start PDU (see `gen_prov_cont`). Now we received the Transaction
642+ * Start PDU and we can extract the last segment number. Knowing this, we check if
643+ * previously received segment exceeds the last segment number. If so, we reject the
644+ * Transaction Start PDU.
645+ */
640646 if ((link .rx .seg & BIT (0 )) &&
647+ ((link .rx .seg & SEG_NVAL ) != SEG_NVAL ) &&
641648 (find_msb_set ((~link .rx .seg ) & SEG_NVAL ) - 1 > link .rx .last_seg )) {
642649 LOG_ERR ("Invalid segment index %u" , seg );
643650 prov_failed (PROV_ERR_NVAL_FMT );
You can’t perform that action at this time.
0 commit comments