FPU and signal delivery
[email protected] (Stephen Ma) Fri, 12 Apr 2002 07:58:41 -0700
| Newsgroups | gmane.os.netbsd.ports.mips |
|---|---|
| Message-ID | <[email protected]> |
>>>>> "Emmanuel" == Emmanuel Dreyfus <[email protected]> writes: Emmanuel> Hi! One more question on signal delivery: we use a Emmanuel> sc_fpused field in struct sigcontext to remeber if we must Emmanuel> call savefpregs/loadfpregs. Why is this needed? We also save Emmanuel> these registers in struct sigcontext. As far as I can tell, it's used to avoid saving/loading the FP registers when unnecessary - if that's not a major concern, you should be able to unconditionally copy the fpregs from the process struct to the sigcontext and back again. Emmanuel> In the Linux version of sigreturn, I saved an restored SR, Emmanuel> CAUSE and BADVADDR (because those fields exists in the Emmanuel> sigcontext structure). We do not handle them in NetBSD, Emmanuel> hence I now suspect this introduce security holes: is it Emmanuel> safe to let the process modifying the saved SR? The CAUSE and BADVADDR registers are not restored on return to user-mode, so saving those registers is mostly harmless. SR should not be modifiable from user-mode code, since that's the register that controls whether the system is in user-mode or kernel mode. - S