[PATCH] relay: Avoid reading stack memory on unprotected side of stack pointer

Alexandre Julliard julliard at winehq.org
Wed Jul 30 03:46:34 CDT 2008

John Reiser <jreiser at BitWagon.com> writes:

> Thus it seems to me that both the offset and the segment are OK
> in the patched code, including when the stack is in a 16-bit segment.
> If this analysis has errors, then I wish to learn.

You cannot assume that the context you have to restore is identical to
what call_from_32_regs has saved. So yes, call_from_32_regs will always
be running in 32-bit mode and will save a 32-bit context; but the
restore part needs to be able to restore any arbitrary context,
including one with a 16-bit stack and separate %ds,%es,%ss selectors.

Alexandre Julliard
julliard at winehq.org

More information about the wine-devel mailing list