From nobody Wed Feb 01 23:41:35 2023 X-Original-To: dev-commits-src-main@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 4P6djX0dVfz3cMZR; Wed, 1 Feb 2023 23:41:36 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P6djW6dlrz3NWC; Wed, 1 Feb 2023 23:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294896; 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=BwZa9GFq2tV3/edstqMXXMCS/mWQp2E5s8g8+82U6Pc=; b=SvU0zvLq4JVoff9uvnRxlGhQn6FyDjxi9HvHfRRXTwwHD6rvNYwDbuHxoNojllwQxjKXNl lr3KmLlt3XML5C5qo+CZC7FJbiDI6O/ZXxLblFaClT0kwLLrEYgh6Z269X6hFlki2o63vi Xc28j8oeDnjs5oTc9/kjUC9MQoXh0lA/nvbAuAbOFd1n8jKsVJKHEBSVkFqJ6JbuC2k2z3 ijbOr6x/lkevXJbugjd6BH5D4+JeiSISbht2juN8eM9EwyGoWW7jNCN+M6Cm85MftmujP2 bt9WgjPbTFX5xkAOkCinf8l0KhwC7RM0VRkGFjB25vI0IKIouGANBZ4+Us6ZUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294896; 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=BwZa9GFq2tV3/edstqMXXMCS/mWQp2E5s8g8+82U6Pc=; b=eoiJ3lsbR/MpGXPuA7aW7vLwFOf8Nhrfxg7A45Jzm97s0KYqE+QPdqqp6rKA2ViZ2ZbZ1e D2wAxlT+iIB0lQXxPOWf2BeznaezKAZeWsBx83VKXddEJO+iYCobj6NWlIYC5kYm2Jvpuu PV84lwFM+p7OJAUOT/VGDSYggO7oVFfkUSSwJE58MfftXySDfTG/IuU5nrkWbSxewylR/T qTM9WyjkyOq2+FUGeyEhxAFIaMcRq+ileMDO+VAIa24XooIMZzBnJyPVKOK5iqGGX44QOm FREW7pDIyM9cSmN2W7O7IdVVaaQ48/ayxCVZnD2mh8AtKU62GOn/YYQQIYVXuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675294896; a=rsa-sha256; cv=none; b=HWre2h3ORt0m6SYMfi50uZcBUO2QJI26LYoNAzeN3IaWGE3Ql+VOWhd7iqeeAZUspzNR1T jYRvL84fc889hFZ3gy0vokKW+MjYAMO4K7VST949tzlYDJIX1uu7/iHqmitZxdoVbx0bkS OHP9p5E6PIm3NXAyfvixFD+yXzpJEPD5KUflbI+0/AT2ohNBAbGCD+TtADu2djJnCqZSlX Vmi4Wt1QWTapmy0TXJjBt/+KlAs0BDhUJ6L0vhTSXB+iKugbRMd2FpDFH55fehpd47qeb7 na9jzCSKpKYOX5zj2oZmjbpCGW3Cjxcmk4HcyASEkavwkqu3qv0t7btRd0DWtg== 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 4P6djW56jczYSc; Wed, 1 Feb 2023 23:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 311NfZDX088921; Wed, 1 Feb 2023 23:41:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311NfZck088920; Wed, 1 Feb 2023 23:41:35 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:41:35 GMT Message-Id: <202302012341.311NfZck088920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 3f08bd565341 - main - i386 trap_check_kstack(): use kstack_contains() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 3f08bd565341dabe22884051014d1e981b433768 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3f08bd565341dabe22884051014d1e981b433768 commit 3f08bd565341dabe22884051014d1e981b433768 Author: Konstantin Belousov AuthorDate: 2023-02-01 00:30:20 +0000 Commit: Konstantin Belousov 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); }