vat: fix vat_suspend crash 04/35604/1
authorDamjan Marion <damarion@cisco.com>
Wed, 9 Mar 2022 13:47:05 +0000 (14:47 +0100)
committerDamjan Marion <damarion@cisco.com>
Wed, 9 Mar 2022 13:47:05 +0000 (14:47 +0100)
commit317cace6185ae134d78a38e1a20249baf751035e
treebc7121e745cbb169a4cd8bfdcbb7e8546982274d
parent7fc0ee7f65fbbced6e987f8bfd927a595b7ff7ee
vat: fix vat_suspend crash

Deadly combination is clib_{set,long}jmp + lazy linking + tail call compiler
optimization. On the first call to clib_setjmp, dynamic linker executes loader
code which then calls clib_setjmp, so stored stack position contains dynamic
loader data. Tail call optimization simply jumps back to the calling
code when clib_longjump is called and that results in wrong return
address used from the stack.

Change-Id: Ia7d8dbd5b2c425cdd0449374aa07ab6b684a330e
Type: fix
Signed-off-by: Damjan Marion <damarion@cisco.com>
src/vpp/api/api_main.c
src/vppinfra/clib.h