summaryrefslogtreecommitdiffstats
path: root/sys/arm
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/arm
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/arm')
-rw-r--r--sys/arm/arm/vm_machdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index 6c0760e..154958d 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -297,7 +297,7 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
tf->tf_spsr = PSR_USR32_MODE;
}
-void
+int
cpu_set_user_tls(struct thread *td, void *tls_base)
{
@@ -308,6 +308,7 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
*(void **)ARM_TP_ADDRESS = tls_base;
critical_exit();
}
+ return (0);
}
void
OpenPOWER on IntegriCloud