HomePhabricator

[HWASan] Catch cases where libc populated jmp_buf.

Authored by morehouse on Sep 15 2021, 7:53 AM.

Description

[HWASan] Catch cases where libc populated jmp_buf.

Some setjmp calls within libc cannot be intercepted while their matching
longjmp calls can be. This causes problems if our setjmp/longjmp
interceptors don't use the exact same format as libc for populating and
reading the jmp_buf.

We add a magic field to our jmp_buf and populate it in setjmp. This
allows our longjmp interceptor to notice when a libc jmp_buf is passed
to it.

See discussion on https://reviews.llvm.org/D109699 and
https://reviews.llvm.org/D69045.

Fixes https://github.com/google/sanitizers/issues/1244.

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D109787

Details

Committed
morehouseSep 15 2021, 7:53 AM
Reviewer
eugenis
Differential Revision
D109787: [HWASan] Catch cases where libc populated jmp_buf.
Parents
rG1f3925e25ae0: [clang][driver][AIX] Add system libc++ header paths to driver
Branches
Unknown
Tags
Unknown