Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Sep 2024 13:03:53 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 73f2b9f05a6b - stable/14 - sysarch: improve checks for max user address
Message-ID:  <202409231303.48ND3r15007495@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=73f2b9f05a6b613e9aa6829101d63ec4e5a2d200

commit 73f2b9f05a6b613e9aa6829101d63ec4e5a2d200
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-09-16 19:55:06 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-09-23 13:03:07 +0000

    sysarch: improve checks for max user address
    
    (cherry picked from commit 666303f5980896346c455bc949e49952220d02b7)
---
 sys/amd64/amd64/sys_machdep.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c
index aae3743f0e91..39c89e2aad87 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409231303.48ND3r15007495>