[all-commits] [llvm/llvm-project] 1a3b33: [HWASan] Catch cases where libc populated jmp_buf.

Matt Morehouse via All-commits all-commits at lists.llvm.org
Wed Sep 15 07:55:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a3b3301d7aa9ab25a8bdf045c77298b087e3930
      https://github.com/llvm/llvm-project/commit/1a3b3301d7aa9ab25a8bdf045c77298b087e3930
  Author: Matt Morehouse <mascasa at google.com>
  Date:   2021-09-15 (Wed, 15 Sep 2021)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan.h
    M compiler-rt/lib/hwasan/hwasan_interceptors.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list