Commit 8623bc66 authored by Laurent Thomas's avatar Laurent Thomas Committed by Robert Schmidt

a small out of buffer access, likely only santize addr detection

parent 1a2be8fc
......@@ -98,7 +98,6 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
uint8_t Qm = rel15->qamModOrder[0];
uint32_t encoded_length = nb_re*Qm;
uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1];
int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
/* PTRS */
......@@ -147,33 +146,30 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("\n");
#endif
for (int q=0; q<rel15->NrOfCodewords; q++) {
/// scrambling
start_meas(dlsch_scrambling_stats);
for (int q=0; q<rel15->NrOfCodewords; q++) {
memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t));
uint32_t scrambled_output[(encoded_length>>5)+4]; // modulator acces by 4 bytes in some cases
memset(scrambled_output, 0, sizeof(scrambled_output));
if ( encoded_length > rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers) abort();
nr_pdsch_codeword_scrambling(output,
encoded_length,
q,
rel15->dataScramblingId,
rel15->rnti,
scrambled_output[q]);
}
stop_meas(dlsch_scrambling_stats);
scrambled_output);
#ifdef DEBUG_DLSCH
printf("PDSCH scrambling:\n");
for (int i=0; i<encoded_length>>8; i++) {
for (int j=0; j<8; j++)
printf("0x%08x\t", scrambled_output[0][(i<<3)+j]);
printf("0x%08x\t", scrambled_output[(i<<3)+j]);
printf("\n");
}
#endif
stop_meas(dlsch_scrambling_stats);
/// Modulation
start_meas(dlsch_modulation_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 1);
for (int q=0; q<rel15->NrOfCodewords; q++)
nr_modulation(scrambled_output[q],
nr_modulation(scrambled_output,
encoded_length,
Qm,
mod_symbs[q]);
......@@ -188,6 +184,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
printf("\n");
}
#endif
}
start_meas(&gNB->dlsch_layer_mapping_stats);
/// Layer mapping
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment