1. 08 Aug, 2024 2 commits
    • Guido Casati's avatar
      fb554dc6
    • Guido Casati's avatar
      Fix memory leak in RCconfig_nr_parallel · 6e7ea5ce
      Guido Casati authored
      * strdup() function is returning a malloced string
        which must be freed after use
      * replace the strdup with direct use of strings to avoid heap allocation
      
      > Direct leak of 23 byte(s) in 1 object(s) allocated from:
          > 0 0x7ffff745b9a7 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:454
          > 1 0x555559e36f87 in RCconfig_nr_parallel /openair2/GNB_APP/gnb_config.c:2054
          > 2 0x555559e38ea3 in NRRCConfig /openair2/GNB_APP/gnb_config.c:2097
          > 3 0x555559155542 in get_options /executables/nr-softmodem.c:423
          > 4 0x555559155542 in main /executables/nr-softmodem.c:623
          > 5 0x7ffff5e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
      
      > Direct leak of 14 byte(s) in 1 object(s) allocated from:
          > 0 0x7ffff745b9a7 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:454
          > 1 0x555559e370c5 in RCconfig_nr_parallel /openair2/GNB_APP/gnb_config.c:2063
          > 2 0x555559e38ea3 in NRRCConfig /openair2/GNB_APP/gnb_config.c:2097
          > 3 0x555559155542 in get_options /executables/nr-softmodem.c:423
          > 4 0x555559155542 in main /executables/nr-softmodem.c:623
          > 5 0x7ffff5e29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
      6e7ea5ce
  2. 30 Jul, 2024 15 commits
  3. 29 Jul, 2024 4 commits
  4. 26 Jul, 2024 18 commits
  5. 25 Jul, 2024 1 commit
    • Guido Casati's avatar
      Fix memory leak in PDU Session Setup Request decoding · 2d6aef51
      Guido Casati authored
      * aper_decode allocates memory for for local pointer `pdusessionTransfer`, in `decodePDUSessionResourceSetup`
      * this memory seems not to be freed but its members are by:
        `ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,pdusessionTransfer);`
        which btw in its header says: "AVOID using it in the application code; Use a safer ASN_STRUCT_RESET() instead"
      * the following mem leak was detected by ASAN:
      
      ```
      Direct leak of 72 byte(s) in 1 object(s) allocated from:
         *0 0x7ffff74b4a57 in __interceptor_calloc /src/libsanitizer/asan/asan_malloc_linux.cpp:154
         *1 0x55555cb306df in SEQUENCE_decode_aper /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/constr_SEQUENCE_aper.c:36
         *2 0x55555ca9fa28 in aper_decode /cmake_targets/ran_build/build/openair2/RRC/LTE/MESSAGES/aper_decoder.c:78
         *3 0x55555b99bae6 in decodePDUSessionResourceSetup /openair2/RRC/NR/rrc_gNB_NGAP.c:273
         *4 0x55555b99fec2 in trigger_bearer_setup /openair2/RRC/NR/rrc_gNB_NGAP.c:357
         *5 0x55555b9b54bf in rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ /openair2/RRC/NR/rrc_gNB_NGAP.c:830
         *6 0x55555b936871 in rrc_gnb_task /openair2/RRC/NR/rrc_gNB.c:2428
         *7 0x7ffff5e94ac2 in start_thread nptl/pthread_create.c:442
      ```
      
      * This commit replaces ASN_STRUCT_FREE_CONTENTS_ONLY with ASN_STRUCT_FREE, which will free the memory allocated for the entire struct and its members
      2d6aef51