Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108586132
D23219.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D23219.diff
View Options
Index: head/sys/riscv/riscv/machdep.c
===================================================================
--- head/sys/riscv/riscv/machdep.c
+++ head/sys/riscv/riscv/machdep.c
@@ -367,6 +367,14 @@
tf = td->td_frame;
+ /*
+ * Make sure the processor mode has not been tampered with and
+ * interrupts have not been disabled.
+ * Supervisor interrupts in user mode are always enabled.
+ */
+ if ((mcp->mc_gpregs.gp_sstatus & SSTATUS_SPP) != 0)
+ return (EINVAL);
+
memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t));
memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s));
memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a));
@@ -523,21 +531,11 @@
int
sys_sigreturn(struct thread *td, struct sigreturn_args *uap)
{
- uint64_t sstatus;
ucontext_t uc;
int error;
if (copyin(uap->sigcntxp, &uc, sizeof(uc)))
return (EFAULT);
-
- /*
- * Make sure the processor mode has not been tampered with and
- * interrupts have not been disabled.
- * Supervisor interrupts in user mode are always enabled.
- */
- sstatus = uc.uc_mcontext.mc_gpregs.gp_sstatus;
- if ((sstatus & SSTATUS_SPP) != 0)
- return (EINVAL);
error = set_mcontext(td, &uc.uc_mcontext);
if (error != 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 4:07 PM (6 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16200588
Default Alt Text
D23219.diff (1 KB)
Attached To
Mode
D23219: Check for invalid sstatus values in set_mcontext().
Attached
Detach File
Event Timeline
Log In to Comment