Revert "[libasan] Remove 4Mb stack limit for swapcontext unpoisoning"
authorVitaly Buka <vitalybuka@google.com>
Wed, 20 Jul 2022 04:17:06 +0000 (21:17 -0700)
committerVitaly Buka <vitalybuka@google.com>
Wed, 20 Jul 2022 04:40:19 +0000 (21:40 -0700)
commit868e1ee1d02c153d867a9f4e2b7e35df7d0701df
tree29b3a9d099a7769f724cfe4f77e7ad915f8d5598
parentad94b5c54f82e7bddc4253ccbf0bdaa9442411cf
Revert "[libasan] Remove 4Mb stack limit for swapcontext unpoisoning"

This patches exposed existing incorectness of swapcontext imlementation.
swapcontext does not set oucp->uc_stack. Unpoisoning works if ucp is
from makecontext, but may try to use garbage pointers if it's from
previos swapcontext or from getcontext. Existing limit reduces
probability of garbage pointers are used.

I restore behavour which we had for years, and will look to improve
swapcontext support.

This reverts commit d0751c9725aab1dad3d86481e13a4628356e7422.
compiler-rt/lib/asan/asan_interceptors.cpp
compiler-rt/test/asan/TestCases/Linux/swapcontext_annotation.cpp