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/alpha | |
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/alpha')
-rw-r--r-- | sys/alpha/alpha/vm_machdep.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c index f8e9028..cfbdf2c 100644 --- a/sys/alpha/alpha/vm_machdep.c +++ b/sys/alpha/alpha/vm_machdep.c @@ -360,7 +360,7 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg, tf->tf_regs[FRAME_FLAGS] = 0; /* full restore */ } -void +int cpu_set_user_tls(struct thread *td, void *tls_base) { @@ -368,6 +368,7 @@ cpu_set_user_tls(struct thread *td, void *tls_base) td->td_pcb->pcb_hw.apcb_unique = (unsigned long)tls_base; else alpha_pal_wrunique((uintptr_t)tls_base); + return (0); } /* |