vppinfra: asan: fix overflow support 64/32764/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 9 Jun 2021 15:20:16 +0000 (17:20 +0200)
committerFlorin Coras <florin.coras@gmail.com>
Mon, 21 Jun 2021 17:13:05 +0000 (17:13 +0000)
commitd4721b2152b245558f5753a60d909b5b233af493
tree231d65b1d95b5975bdd1723d6150079e41e77cff
parent3006289a07429730ff69c2585eed6d6075be3565
vppinfra: asan: fix overflow support

In some part of VPP we are accessing memory past what was allocated for
efficiency when we know it is safe to do so. We need to tell ASan about
it so it does not complain.
The initial attempt was too simple and could not manage cases where the
poisoned memory was scattered. This new attempt is more robust as we
save and restore the full shadow state.
Note it will still not work properly if we poison/unpoison memory while
in an overflow context, but this should not be a big issue as overflow
should only be temporary.

Type: fix

Change-Id: I636f44eb59aa8455a4d13929a3791b56619af7b4
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vppinfra/CMakeLists.txt
src/vppinfra/sanitizer.c [new file with mode: 0644]
src/vppinfra/sanitizer.h