The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=666303f5980896346c455bc949e49952220d02b7

commit 666303f5980896346c455bc949e49952220d02b7
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2024-09-16 19:55:06 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2024-09-16 23:02:14 +0000

    sysarch: improve checks for max user address
    
    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
---
 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 887c8f05b00d..c8bddb0acb19 100644
--- a/sys/amd64/amd64/sys_machdep.c
+++ b/sys/amd64/amd64/sys_machdep.c
@@ -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>
 
@@ -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;

Reply via email to