Mail Archives: djgpp/2001/06/29/02:15:08.1
> The DJGPP code that sets some of this stuff up wounld, of course, need
> to detect DPMI 1.0 feature availability and act accordingly.
It's the exact same call the crt0.s makes to set the null page. Actually
it just does it and ignores the return code. You would just make the same
call to set some memory read-only.
> What about stack overruns?
Just like the null page, set 64K (or some amount) of memory at the bottom
of the stack to be not-mapped (invalid) just like the null page. On the
basis of ESP/EBP pointing anywhere near this section you could state this
is the error in the DJGPP traceback.
This won't catch huge overruns, but if you write-protect the entire text
section you will at least prevent overwrite of executable code and catch
errors sooner with correct error messages.
Critical writeable data could be even toggled to be read-only, read-write,
read-only for the really paranoid.
- Raw text -