Skip to content

Commit

Permalink
sysarch: improve checks for max user address
Browse files Browse the repository at this point in the history
making LA48 processes have the same limit as with the pre-LA57 kernels.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
  • Loading branch information
kostikbel committed Sep 16, 2024
1 parent 29a0a72 commit 666303f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sys/amd64/amd64/sys_machdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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>

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 666303f

Please sign in to comment.