diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-07-10 23:31:11 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-07-10 23:31:11 +0000 |
commit | bc8b519d0f5bbf92cb40d8b35ea92bb2285463c5 (patch) | |
tree | e1deb69e9ef98abe6e3de57b17a8192575186ef3 /sys/powerpc/aim/vm_machdep.c | |
parent | 6d86e52425b9f58cf008209ca788b1475811f5f3 (diff) | |
download | FreeBSD-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/powerpc/aim/vm_machdep.c')
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 60274f3..4b896ea 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -355,9 +355,10 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, td->td_retval[1] = 0; } -void +int cpu_set_user_tls(struct thread *td, void *tls_base) { td->td_frame->fixreg[2] = (register_t)tls_base; + return (0); } |