[riot-commits] [RIOT-OS/RIOT] eefed0: sys/malloc_thread_safety: fix overflow in calloc

Marian Buschsieweke noreply at github.com
Thu May 13 14:39:23 CEST 2021


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: eefed0e0cd590c268bab3501cee2ec1f84e20a59
      https://github.com/RIOT-OS/RIOT/commit/eefed0e0cd590c268bab3501cee2ec1f84e20a59
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-05-06 (Thu, 06 May 2021)

  Changed paths:
    M sys/malloc_thread_safe/malloc_wrappers.c

  Log Message:
  -----------
  sys/malloc_thread_safety: fix overflow in calloc

some standard c libraries (e.g. newlib before 4.0.0) don't perform
proper overflow check in the multiplication. We just implement calloc
here ourselves on top of malloc with proper overflow check in place.
This might even safe a handful of ROM bytes.


  Commit: a9dea12eb8d60bc531c69887edaef535635b920d
      https://github.com/RIOT-OS/RIOT/commit/a9dea12eb8d60bc531c69887edaef535635b920d
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-05-10 (Mon, 10 May 2021)

  Changed paths:
    M cpu/esp32/vendor/esp-idf/heap/heap_trace.c
    M cpu/esp_common/Makefile.include
    M cpu/esp_common/syscalls.c

  Log Message:
  -----------
  cpu/esp_common: add overflow detection to calloc

If esp_idf_heap is not used, implement calloc through a custom wrapper
function on top of malloc to add overflow detection, which is not
present in the newlib forks with xtensa support yet.


  Commit: 8c312270604ed4e2ec49ee7057690f6a2bb12e35
      https://github.com/RIOT-OS/RIOT/commit/8c312270604ed4e2ec49ee7057690f6a2bb12e35
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-05-10 (Mon, 10 May 2021)

  Changed paths:
    M tests/malloc/main.c

  Log Message:
  -----------
  tests/malloc: test for correct calloc() behavior


  Commit: c210975108869242b85ad8a5123ee87e31925376
      https://github.com/RIOT-OS/RIOT/commit/c210975108869242b85ad8a5123ee87e31925376
  Author: Marian Buschsieweke <maribu at users.noreply.github.com>
  Date:   2021-05-13 (Thu, 13 May 2021)

  Changed paths:
    M cpu/esp32/vendor/esp-idf/heap/heap_trace.c
    M cpu/esp_common/Makefile.include
    M cpu/esp_common/syscalls.c
    M sys/malloc_thread_safe/malloc_wrappers.c
    M tests/malloc/main.c

  Log Message:
  -----------
  Merge pull request #16443 from maribu/tests/malloc

sys/malloc_thread_safety: fix potential overflow in multiplication


Compare: https://github.com/RIOT-OS/RIOT/compare/b5953d0f8538...c21097510886


More information about the commits mailing list