diff options
author | Lai Jiangshan <jiangshan.ljs@antfin.com> | 2021-06-22 09:45:32 +0800 |
---|---|---|
committer | Lai Jiangshan <jiangshan.ljs@antfin.com> | 2021-06-22 12:50:52 +0800 |
commit | 49ada65f4c37a4384ce4f9dc0cf98317207d4472 (patch) | |
tree | ad2ae9e8529d0e3147339e374c796201c1810105 /pkg/sentry/vfs/permissions.go | |
parent | 04a81bc33664b7f7b3da0666b9296e5aaf0f63e7 (diff) |
Disconnect call-chain between sighandler() and bluepill().
When sentry is running in guest ring0, the goroutine stack is changing
and it will not be the stack when bluepill() is called.
If PMU interrupt hits when the CPU is in host ring 0, the perf handler
will try to get the stack of the kernel and the userspace(sentry). It
can travel back to sighandler() and try to continue to the stack of
the goroutine with the outdated frame pointer if sentry has been running
in the guest. The perf handler can't record correct addresses
from the outdated and wrong frames. Those addresses are often
irresolvable, and even if it is resolvable accidentally, it would
be misleading names.
To fix the problem, we just set the frame pointer(%RBP) to zero and
disconnect the link when the zeroed frame pointer is saved in the
frame in bluepillHandler().
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antfin.com>
Diffstat (limited to 'pkg/sentry/vfs/permissions.go')
0 files changed, 0 insertions, 0 deletions