ntdll: Program could modify Dr* registers in segv_handler too.

Vitaliy Margolen wine-devel at kievinfo.com
Sun Dec 11 13:10:58 CST 2005

Sunday, December 11, 2005, 11:23:18 AM, Peter Beutner wrote:
> Vitaliy Margolen schrieb:
>> Sunday, December 11, 2005, 10:36:39 AM, Peter Beutner wrote:
>>>Vitaliy Margolen schrieb:
>>>>Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
>>>>>Vitaliy Margolen schrieb:
>>>>>>ntdll: Program could modify Dr* registers in segv_handler too.
>>>>>Doesn't every exception handler could modify these registers?
>>>>>So probably it would be better to put this check into RtlRaiseException?
>>>>Nope can't. __regs_RtlRaiseException is common for all the platforms
>>>>(implemented in dlls/ntdll/exception.c). While Dr* registers are not
>>>>available on all the platforms.
>>>What about putting some
>>>#ifdef __i386__
>>>around it?
>> That's what signal_*.c are for...
> The name suggests it's more about signal handling than a place to throw every arch
> dependent code in it ;)
> But that's not the point.
> I just thought it might not be the best solution to duplicate that check in every signal
> handler.
> Besides what about somebody changes the Dr* registers in an exception handler invoked by
> an exception raised by the application via RaiseException(i.e. not via a signal handler
> called by the kernel)?
> *Every* installed exception handler can change the registers in the CONTEXT structure,
> thats why I think it would be the easiest way to implement it in __regs_RtlRaiseException.

Good point but it needs a test. Besides I'm not sure that we will change
any registers in that case at all. (just checked and no, we won't change
any registers).

More information about the wine-devel mailing list