On Thu, Mar 29, 2018 at 1:20 PM, Florian Weimer wrote: > * H. J. Lu: > >> On Thu, Mar 29, 2018 at 1:15 PM, Florian Weimer wrote: >>> * H. J. Lu: >>> >>>> You need to make a choice. You either don't introduce a new symbol >>>> version or don't save shadow stack for thread cancellation. You >>>> can't have both. >>> >>> I don't understand. We have room to save the shadow stack pointer in >>> the existing struct. >> >> No, we don't have room in struct pthread_unwind_buf: >> >> Note: There is an unused pointer space in pthread_unwind_buf_data. But >> it isn't suitable for saving and restoring shadow stack register since >> x32 is a 64-bit process with 32-bit software pointer and kernel may >> place x32 shadow stack above 4GB. We need to save and restore 64-bit >> shadow stack register for x32. > > We have for void * fields. They are subsequently overwritten by > __pthread_register_cancel. But __sigsetjmp can write to them first > without causing any harm. We just need a private __longjmp_cancel > that doesn't restore the shadow stack pointer. Here is the patch which does that. Any comments? Thanks. -- H.J.