Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2023 23:41:35 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 3f08bd565341 - main - i386 trap_check_kstack(): use kstack_contains()
Message-ID:  <202302012341.311NfZck088920@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=3f08bd565341dabe22884051014d1e981b433768

commit 3f08bd565341dabe22884051014d1e981b433768
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-02-01 00:30:20 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-02-01 22:59:27 +0000

    i386 trap_check_kstack(): use kstack_contains()
    
    Reviewed by:    jhb
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D38320
---
 sys/i386/i386/trap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index a4decc4976dc..f4f6e7109a16 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -205,8 +205,7 @@ trap_check_kstack(void)
 	stk = read_esp();
 	if (stk >= PMAP_TRM_MIN_ADDRESS)
 		panic("td %p stack %#x in trampoline", td, stk);
-	if (stk < td->td_kstack || stk >= td->td_kstack +
-	    ptoa(td->td_kstack_pages))
+	if (!kstack_contains(td, stk, 0))
 		panic("td %p stack %#x not in kstack VA %#x %d",
 		    td, stk, td->td_kstack, td->td_kstack_pages);
 }



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