mirror of
https://github.com/opnsense/src.git
synced 2026-04-23 07:07:24 -04:00
sysarch: improve checks for max user address
(cherry picked from commit 666303f5980896346c455bc949e49952220d02b7)
This commit is contained in:
parent
1ed40b4506
commit
73f2b9f05a
1 changed files with 3 additions and 2 deletions
|
|
@ -48,6 +48,7 @@
|
|||
#include <sys/priv.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/smp.h>
|
||||
#include <sys/sysent.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
|
|
@ -316,7 +317,7 @@ sysarch(struct thread *td, struct sysarch_args *uap)
|
|||
case AMD64_SET_FSBASE:
|
||||
error = copyin(uap->parms, &a64base, sizeof(a64base));
|
||||
if (error == 0) {
|
||||
if (a64base < VM_MAXUSER_ADDRESS) {
|
||||
if (a64base < curproc->p_sysent->sv_maxuser) {
|
||||
set_pcb_flags(pcb, PCB_FULL_IRET);
|
||||
pcb->pcb_fsbase = a64base;
|
||||
td->td_frame->tf_fs = _ufssel;
|
||||
|
|
@ -334,7 +335,7 @@ sysarch(struct thread *td, struct sysarch_args *uap)
|
|||
case AMD64_SET_GSBASE:
|
||||
error = copyin(uap->parms, &a64base, sizeof(a64base));
|
||||
if (error == 0) {
|
||||
if (a64base < VM_MAXUSER_ADDRESS) {
|
||||
if (a64base < curproc->p_sysent->sv_maxuser) {
|
||||
set_pcb_flags(pcb, PCB_FULL_IRET);
|
||||
pcb->pcb_gsbase = a64base;
|
||||
td->td_frame->tf_gs = _ugssel;
|
||||
|
|
|
|||
Loading…
Reference in a new issue