mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-25 04:01:10 +00:00
hurd: Fix longjmp early in initialization
When e.g. an LD_PRELOAD fails, _dl_signal_exception/error longjmps, but TLS is not initialized yet, let along signal state. We thus mustn't look at them within __longjmp. * sysdeps/mach/hurd/i386/____longjmp_chk.S,__longjmp.S: Check for initialized value of %gs, and that sigstate is non-NULL.
This commit is contained in:
parent
e9422236a2
commit
115bcf921a
@ -60,7 +60,14 @@ ENTRY (____longjmp_chk)
|
|||||||
PTR_DEMANGLE (%ecx)
|
PTR_DEMANGLE (%ecx)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
movw %ds, %si
|
||||||
|
movw %gs, %di
|
||||||
|
cmpw %si, %di
|
||||||
|
jz .Lok /* TLS not initialized yet */
|
||||||
|
|
||||||
movl %gs:SIGSTATE_OFFSET, %edi
|
movl %gs:SIGSTATE_OFFSET, %edi
|
||||||
|
testl %edi, %edi
|
||||||
|
jnz .Lok /* sigstate not initialized yet */
|
||||||
|
|
||||||
testl $SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%edi)
|
testl $SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%edi)
|
||||||
jnz .Lonstack
|
jnz .Lonstack
|
||||||
|
@ -38,7 +38,14 @@ ENTRY (__longjmp)
|
|||||||
PTR_DEMANGLE (%ecx)
|
PTR_DEMANGLE (%ecx)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
movw %ds, %si
|
||||||
|
movw %gs, %di
|
||||||
|
cmpw %si, %di
|
||||||
|
jz .Lok /* TLS not initialized yet */
|
||||||
|
|
||||||
movl %gs:SIGSTATE_OFFSET, %edi
|
movl %gs:SIGSTATE_OFFSET, %edi
|
||||||
|
testl %edi, %edi
|
||||||
|
jnz .Lok /* sigstate not initialized yet */
|
||||||
|
|
||||||
testl $SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%edi)
|
testl $SS_ONSTACK, (HURD_SIGSTATE__SIGALTSTACK__OFFSET + SIGALTSTACK__SS_FLAGS__OFFSET)(%edi)
|
||||||
jz .Lok
|
jz .Lok
|
||||||
|
Loading…
Reference in New Issue
Block a user