[OpenSIPS-Devel] [OpenSIPS/opensips] c29652: Memory allocators: Revert Q_MALLOC to 8-byte align...

Liviu Chircu noreply at github.com
Fri Jul 2 09:27:39 EST 2021


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: c29652fa10dbd34ce499f817891abe25964ee63b
      https://github.com/OpenSIPS/opensips/commit/c29652fa10dbd34ce499f817891abe25964ee63b
  Author: Liviu Chircu <liviu at opensips.org>
  Date:   2021-07-02 (Fri, 02 Jul 2021)

  Changed paths:
    M mem/f_malloc.c
    M mem/hp_malloc.c
    M mem/hp_malloc.h
    M mem/q_malloc.c
    M mem/q_malloc.h

  Log Message:
  -----------
  Memory allocators: Revert Q_MALLOC to 8-byte alignment

Commit 1f55d05c2b actually upped Q_MALLOC's address alignment from
8-bytes to 16-bytes.  While this isn't necessarily a bug (in fact,
it makes OpenSIPS more crash-safe), it enables new scenarios where
buffer overrun crashes would happen with F_MALLOC but not with Q_MALLOC.

And since Q_MALLOC is the intended crash debugger, these scenarios
must not be allowed, so we stick to 8-byte alignment.  If anyone needs
16-byte aligned memory, they can just re-define ROUNDTO and re-compile.





More information about the Devel mailing list