diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index 887c8f05b00d80..c8bddb0acb195d 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -46,6 +46,7 @@ #include #include #include +#include #include #include @@ -314,7 +315,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; @@ -332,7 +333,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;