[PATCH 55/73] asan: Fix volk_malloc alignment bug
authorAlexandreRouma <alexandre.rouma@gmail.com>
Thu, 30 Sep 2021 11:52:32 +0000 (13:52 +0200)
committerA. Maitland Bottoms <bottoms@debian.org>
Fri, 22 Oct 2021 03:30:05 +0000 (04:30 +0100)
commit216a76f063590169f0c770d297e6a4fa1de0a739
treea08fc54cf398e86f0e452efc1a4124ec8806306c
parent1a47948e802cb1c9e0455a0af19652ba1cdaf3be
[PATCH 55/73] asan: Fix volk_malloc alignment bug

ASAN (the Address Sanitizer used by GCC) requires memory allocations to
be a multiple of the alignment. To replicate the bug, use a version of
libvolk without this fix, call volk_malloc() with a number of byte
that's not a multiple of the alignment and compile it with the Address
sanitizer enable (-fsanitize=address). The software will error out
and complain about the alignement. This patch fixes it by adding the
missing number of bytes to the size variable so that it becomes a
multiple of the alignment.

Signed-off-by: AlexandreRouma <alexandre.rouma@gmail.com>
Gbp-Pq: Name 0055-asan-Fix-volk_malloc-alignment-bug.patch
lib/volk_malloc.c