summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2005-07-10 23:31:11 +0000
committerdavidxu <davidxu@FreeBSD.org>2005-07-10 23:31:11 +0000
commitbc8b519d0f5bbf92cb40d8b35ea92bb2285463c5 (patch)
treee1deb69e9ef98abe6e3de57b17a8192575186ef3 /sys/sparc64
parent6d86e52425b9f58cf008209ca788b1475811f5f3 (diff)
downloadFreeBSD-src-bc8b519d0f5bbf92cb40d8b35ea92bb2285463c5.zip
FreeBSD-src-bc8b519d0f5bbf92cb40d8b35ea92bb2285463c5.tar.gz
Validate if the value written into {FS,GS}.base is a canonical
address, writting non-canonical address can cause kernel a panic, by restricting base values to 0..VM_MAXUSER_ADDRESS, ensuring only canonical values get written to the registers. Reviewed by: peter, Josepha Koshy < joseph.koshy at gmail dot com > Approved by: re (scottl)
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/vm_machdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c
index 20bf46b..9dd80fd 100644
--- a/sys/sparc64/sparc64/vm_machdep.c
+++ b/sys/sparc64/sparc64/vm_machdep.c
@@ -196,13 +196,14 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
td->td_retval[1] = tf->tf_out[1];
}
-void
+int
cpu_set_user_tls(struct thread *td, void *tls_base)
{
if (td == curthread)
flushw();
td->td_frame->tf_global[7] = (uint64_t) tls_base;
+ return (0);
}
/*
OpenPOWER on IntegriCloud