mirror of https://github.com/FDOS/kernel.git
avoid race condition that could corrupt user stack if DOS re-entered too soon
apply suggested fix from SF bug 215 (https://sourceforge.net/p/freedos/bugs/215/), InDOS cleared but small chance DOS re-entered before user stack restored thus corrupting user stack
This commit is contained in:
parent
dabfaf7d54
commit
1cc00e194d
|
@ -406,7 +406,7 @@ int21_normalentry:
|
||||||
push bp
|
push bp
|
||||||
call _int21_service
|
call _int21_service
|
||||||
|
|
||||||
int21_exit: dec byte [_InDOS]
|
int21_exit:
|
||||||
%IFDEF WIN31SUPPORT
|
%IFDEF WIN31SUPPORT
|
||||||
call end_dos_crit_sect ; release all critical sections
|
call end_dos_crit_sect ; release all critical sections
|
||||||
%if 0
|
%if 0
|
||||||
|
@ -417,6 +417,10 @@ int21_exit: dec byte [_InDOS]
|
||||||
%endif
|
%endif
|
||||||
%ENDIF ; WIN31SUPPORT
|
%ENDIF ; WIN31SUPPORT
|
||||||
|
|
||||||
|
; tiny chance DOS re-entered between clearing InDOS and restoring user stack,
|
||||||
|
; so we disable interrupts until user stack restored; see SF bug# 215
|
||||||
|
cli
|
||||||
|
dec byte [_InDOS]
|
||||||
;
|
;
|
||||||
; Recover registers from system call. Registers and flags
|
; Recover registers from system call. Registers and flags
|
||||||
; were modified by the system call.
|
; were modified by the system call.
|
||||||
|
|
Loading…
Reference in New Issue