From nobody Mon Sep 23 13:03:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XC38p0HVQz52Fcs; Mon, 23 Sep 2024 13:03:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XC38n4Txsz40jk; Mon, 23 Sep 2024 13:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727096633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fnhcO8zvkxwDUQewWIycChQqfgeCHl4E9DeW+XiyEqU=; b=hHb4LHpVouYdS0wbLuv10l0cE1oRmmAGBBgF6Axdfh7smzB2sBBR5X5hirvaw7MuSjwTV1 8EBtQlqp3wPkIT13znOiSAoUFuq+ZJ0xH7dQ2PKNjou9+IV+Ld+fAYL81AYA1280JZ71k2 ag0mMpSsWxV9Pqfs8iP4JgVrTlxwWj4jOAW7/TkTBZjqozyEKGnYDhemje0qGhdQ6odY3q FVhkDK9LEmV8DslGWtR1oJb1AJHtQ85L4fHbhC8WJO543N9/PfWK0r37b4cRmrdnWYuhFN ss5WHn+JgPSUCLVImEWD9kEQkIWbQA6n3C0+kT+ucmBj4zJqWEzfr1IaF6IAuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727096633; a=rsa-sha256; cv=none; b=NVD18RBSAypxs/csr2hEvbnhoqJ6VTvehJVV/4XxsJZ4U5g+cmKkLo/fopsvI4G0G/USB4 1U20vazgMlwBK4OYBRH8ds2veRDYMc4fcAiYbAbRu9e7VrkPGyux/C/Ts2GeE5OuHoT5i2 PtK3x/GIulSKSk7/tsMxhKeal1zwDMnocMMlYwteVwnUEAmkvpNyAb1qwgvu9jFh1IrJcc y4krQDUmfJUs3X2ZPMM8qz+xAkK7LVW3wpHL0nCTW5/1Fg3izeQLogWvJ7mr9TZKMna05E 03Qmh0/7tgbZAVrOQBLl68cp88V5uSWfleYatB19yD47NCg5XjxxY7cOSb2Dmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727096633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fnhcO8zvkxwDUQewWIycChQqfgeCHl4E9DeW+XiyEqU=; b=N7ZmBXM31v7BuMsENgMAf/qbPvFZ3sNPfXZWrIB18gjrDxrBW74hA/d+ATh/isPwEmcCzM i1hKa+AxTt7ILNomkrfif6KvAMp6W+Yo1vTTsEgkiHEFDHLR4WnLIkVU4vgWiMFyd64sCe zJYiWekBfipOAh3wJVcEP76tCybj+ysojORL32wfWM3+RPAUcb07ZsvMgqbnbWDbasFTXc ldrNAK4JRSxDeUqfh0+28Zp19ZJiEqyzzETqCiSZVIfWKNcEwNz3TJmRmTGFFGiHO/gOhE zcw3KuRppRcKtmn6tvv2SajQNxmLQm8UZq+cZsLhj9M1pyPg9KUpQgAFC0uoNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XC38n40NVzmf3; Mon, 23 Sep 2024 13:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48ND3rlf007498; Mon, 23 Sep 2024 13:03:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48ND3r15007495; Mon, 23 Sep 2024 13:03:53 GMT (envelope-from git) Date: Mon, 23 Sep 2024 13:03:53 GMT Message-Id: <202409231303.48ND3r15007495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 73f2b9f05a6b - stable/14 - sysarch: improve checks for max user address List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 73f2b9f05a6b613e9aa6829101d63ec4e5a2d200 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=73f2b9f05a6b613e9aa6829101d63ec4e5a2d200 commit 73f2b9f05a6b613e9aa6829101d63ec4e5a2d200 Author: Konstantin Belousov AuthorDate: 2024-09-16 19:55:06 +0000 Commit: Konstantin Belousov 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 #include #include +#include #include #include @@ -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;