Commit Graph
17746 Commits
Author SHA1 Message Date
luis_pereira87 f18db2bad8 Update SIB1 with q_RxLevMin to -65 and MCC and MNC to match SIM card values 2021-03-01 10:32:12 +00:00
francescomani 4e6fb20fe9 adding symbol based vrb map for csirs 2021-03-01 09:15:23 +01:00
Guhan 02ae169250 Rebased to latest develop and removed nr_rx_acknack function 2021-03-01 11:43:30 +05:30
Laurent Thomas 9ce7f94518 record/replay for 5G, nrscope bug fix 2021-02-28 21:39:53 +01:00
Michael Cook 034d2cfed6 lte-ue.c: Allocate bigger arrays
This code allocates memory from the heap:

```
static void *UE_phy_stub_standalone_pnf_task(void *arg)
{
...
  UL_INFO->crc_ind.crc_indication_body.crc_pdu_list =
  calloc(NB_UE_INST, sizeof(nfapi_crc_indication_pdu_t));
```

I see NB_UE_INST==1.

Then this code:

```
void fill_crc_indication_UE_MAC(int Mod_id,
                                int frame,
                                int subframe,
                                UL_IND_t *UL_INFO,
                                uint8_t crc_flag,
                                int index,
                                uint16_t rnti,
                                nfapi_ul_config_request_t
                                *ul_config_req) {
...
  nfapi_crc_indication_pdu_t *pdu =
      &UL_INFO->crc_ind.crc_indication_body
           .crc_pdu_list[UL_INFO->crc_ind.crc_indication_body.number_of_crcs];
```

used .number_of_crcs to index into .crc_pdu_list without first
checking if .number_of_crcs is in range.

When run with multiple UEs, sometimes .number_of_crcs==1 and then
-fsanitize=address complains.

Change is to use NUMBER_OF_UE_MAX instead of NB_UE_INST.

With this change, -fsanitize=address stopping complaining.
2021-02-28 09:45:31 -08:00
Michael Cook 11270af81e eNB_scheduler_ulsch.c: Range checking on array access
-fsanitize=address complained about this code.
2021-02-28 09:29:29 -08:00
Michael Cook 706f0e4421 pdcp_fifo_flush_sdus: Fix message size calculation
-fsanitize=address detected that we were trying to access bytes
past the end of a block of malloc'ed memory.

Specifically, in this code:

```
    } else if (ENB_NAS_USE_TUN) {
      if( LOG_DEBUGFLAG(DEBUG_PDCP) )
        log_dump(PDCP, pdcpData, sizeToWrite, LOG_DUMP_CHAR,"PDCP
      output to be sent to TUN interface: \n");
      ret = write(nas_sock_fd[0], pdcpData, sizeToWrite);
```

-fsanitize=address said:

```
==80==ERROR: AddressSanitizer: heap-buffer-overflow on address
0x61100004ffdc at pc 0x7f57c5f576a5 bp 0x7f57bb53c240 sp
0x7f57bb53b9e8
READ of size 108 at 0x61100004ffdc thread T7

0x61100004ffdc is located 0 bytes to the right of 220-byte region
[0x61100004ff00,0x61100004ffdc)
```

So, the code was trying to access the first byte after a block of
heap memory.

sizeToWrite was calculated like this:

```
    int sizeToWrite= sizeof (pdcp_data_ind_header_t) +
      pdcpHead->data_size;
```

There were a few other similar invocations of write() in the same
function used the wrong size.  That sizeToWrite calculation
should be used only when the header is being sent, too, which
happens in only one place in this function.

With this commit, our tests pass and -fsanitize=address is happy.
2021-02-28 07:39:33 -08:00
Laurent Thomas f5a22a7426 Merge branch 'develop-SA-CBRA' of https://gitlab.eurecom.fr/oai/openairinterface5g into develop-SA-CBRA 2021-02-28 11:06:02 +01:00
Michael Cook b6766ee8ae decode_SIB1: Was reading past the end of plmn_data
Found by -fsanitize=address
2021-02-27 09:29:09 -08:00
Michael Cook d8a7414e48 eNB_scheduler_mch.c: Memory corruption
The global mbms_rab_id was defined as `uint16_t` in
eNB_scheduler_mch.c but `int` in other places.  So, code that
wrotes this global would clobber the two bytes that follow the
variable in memory.

Found by `-fsanitize=address`.
2021-02-27 09:16:27 -08:00
Michael Cook 414d3794fd netlink_init.c: Memory leak
Found by `-fsanitize=address`.
2021-02-27 09:15:38 -08:00
Michael Cook 2520d111da Fix shutdown crashes
In phy_free_lte_eNB in lte_init.c, the lte-uesoftmodem would
crash during shutdown because it was dereferencing null pointers.
This commit adds checks to avoid that.
2021-02-27 07:20:43 -08:00
Melissa Elkadi 8b2b78e477 Fixed remote_addr.sin_port
For some reason the htons invocation got deleted which broke
the VNF P7 interface.

Also fixed some build issues, not sure how these got onto the
develop branch to begin with.
2021-02-26 15:57:35 -08:00
rmagueta fc9b781c2a Avoid multiple transmissions in the RA-Msg4 slot 2021-02-26 20:15:06 +00:00
matzakos 1e8a23f519 Resolve remaining conflict from merge in CMakelists 2021-02-26 20:31:19 +01:00
hardy d143cec5ba Merge remote-tracking branch 'origin/sarma_pvnp_oai' into integration_2021_wk09_b 2021-02-26 16:09:17 +01:00
hardy 8d05695722 Merge remote-tracking branch 'origin/benetel_driver_update' into integration_2021_wk09_b 2021-02-26 16:09:05 +01:00
matzakos 09652d2910 Add sample configuration files for preliminary NR SA monolithic and CU/DU split deployment options 2021-02-26 13:06:26 +01:00
matzakos 20805c1314 Remove confusing mixed SRB/DRB functions for SRB addition in RLC
- SRB addition is now done through add_srb, add_srb_am functions
2021-02-26 13:01:17 +01:00
matzakos e186134061 Preliminary work for separation of SRB from DRB handling in RLC
-For the moment SRBs are preconfigured (as was done for DRBs in noS1 mode)
but this should be removed
2021-02-26 12:11:01 +01:00
guhan 89c1a9c284 Removed SR 2021-02-26 14:16:35 +05:30
guhan 6505729aad some modifications in gNB_scheduler_uci.c 2021-02-26 14:16:01 +05:30
guhan f338d6d65d Removed rrc dependency, code rearrangement 2021-02-26 14:16:01 +05:30
guhan 5d4f815181 Removed dead code 2021-02-26 11:50:13 +05:30
guhan e914cb28a6 Fixed some warnings 2021-02-26 11:47:33 +05:30
rangaswamy 0e61b612ba fixed warnings 2021-02-26 11:47:33 +05:30
k.ramya 0a0a5e48c3 code rearrangement 2021-02-26 11:37:58 +05:30
r.karey e703638522 fixed memory leaks 2021-02-26 11:31:06 +05:30
Francesco Mani 27cfdd4974 some cleanup 2021-02-26 11:29:28 +05:30
Francesco Mani 2e17bd241f bugfix in pucch_rx 2021-02-26 11:29:28 +05:30
Francesco Mani cfdfd789b0 some code cleanup in csi_bitlen 2021-02-26 11:29:28 +05:30
Francesco Mani 17f830e587 revert to old rrc csi confriguration 2021-02-26 11:29:28 +05:30
Francesco Mani 898f752059 uci mac functions in a new file 2021-02-26 11:29:28 +05:30
Rangaswami dfa39d5441 fixed CSI payload issue with multiple SSBs 2021-02-26 11:08:32 +05:30
Francesco Mani 5c35c9fba2 bugix for cri-rsrp in bitlen computation 2021-02-26 11:08:32 +05:30
p.shashikala ee7b48ee01 CSI payload bits inversion issue 2021-02-26 11:08:32 +05:30
Rangaswami 8c923c9796 Fixed the segemntation fault and added CSI bitlength in uci_pdu 2021-02-26 11:08:32 +05:30
r.karey c779ca120f Fixed the calculation of received csi payload size at MAC 2021-02-26 11:08:32 +05:30
Francesco Mani 827fcb2d30 remove log 2021-02-26 11:04:20 +05:30
Francesco Mani e746ee5e96 make ue and physim compile again 2021-02-26 11:04:20 +05:30
r.karey dbe30e81f6 CSI-RS reporting bitlength calculation for type1 single panel two CSI-RS ports 2021-02-26 11:04:20 +05:30
r.karey c15855b9ab Bit length calculation for CRI-RSRP 2021-02-26 11:04:20 +05:30
r.karey 778dec6634 Changed periodicity calculation according to CSI_Reporting branch 2021-02-26 11:04:20 +05:30
r.karey befcb33d1b Modified bitlen calculation for ssbri 2021-02-26 11:04:20 +05:30
r.karey 3fa6b36ac3 UCI bitlength calculation 2021-02-26 11:04:20 +05:30
r.karey 802f69a574 Added more logs and fixed assertion 2021-02-26 11:04:20 +05:30
vr.devendra 6a1a0e8257 updated TCI handling apis 2021-02-26 11:00:37 +05:30
Rangaswami 1dfec690f5 Initial commits for TCI and CSI reporting changes 2021-02-26 11:00:37 +05:30
Rangaswami f344f69d1c Initial commits for TCI and CSI reporting changes 2021-02-26 10:54:40 +05:30
Francesco Mani 656d2abc7c Remove PRACH logging nr_mac_common.c 2021-02-26 10:53:54 +05:30