On 9/9/19 12:29 PM, Matthew Malcomson wrote: > On 09/09/19 11:01, Martin Liška wrote: >> Hi. >> >> On 9/6/19 4:46 PM, Matthew Malcomson wrote: >>> Ensuring that the shadow stack is cleared on normal function exit will >>> be done by adding instrumentation to the function epilogue through the >>> compiler. >>> longjmp and setjmp are some abnormal methods of exiting the function >>> that can't be handled in the compiler since they can be called in >>> uninstrumented code to unwind past instrumented function frames. >> >> I'm curious why you are adding a new code that is not part of libsanitizer >> runtime? >> Does it mean the current LLVM implementation does not properly handle setjmp >> and >> longjmp? > > Honestly -- I'm not sure. > > I did a basic test that seemed to show clang not supporting setjmp & > longjmp and I made a bit of a foray into how one would approach the > problem, but I then left it in a partially done state to focus on other > things.
I see. Then I would probably file an issue and ask the community: https://github.com/google/sanitizers/issues > > It also seems on first blush that C++ exceptions are not handled, but > again I haven't yet gone and asked anyone in the know. Likewise I would ask them for the C++ exceptions. Martin > > (it's on the list of things to do, but not yet at the top). > >> >> Note that rule of thumb is that we need to upstream all libsanitizer >> changes before we merge libsanitizer. We are doing that in order to not >> have a bug difference against upstream libsanitizer. > > That sounds good to me -- I will remember to go upstream when I look > into this. > >> >> Martin >> >