From nobody Wed Feb 01 23:41:36 2023 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 4P6djY1K3fz3cMSM; Wed, 1 Feb 2023 23:41:37 +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 4P6djY04kQz3NfG; Wed, 1 Feb 2023 23:41:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294897; 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=SO53E5dSnM5P/Rt+Y92eGQawH1ZxBJSBiya2gRBcFJ0=; b=SGD92aUWuxYG1OdQTQrzIpXRRKMauzBuRhmtC4O8vvYmWpqAd898N2z1aQ70/X+pAp+DSm vmH9xt2wQGFyKhp4vV51QlW8qEb0wydf/6NhU8OdRSDpys+GycMVBDhvPhzUbwjLOE7eBh ZJn/GX8lcVzFC33yaPwL/H5IghVpJoXv5/McEYarii9X2tDAKKBcz6vlmulDPakCwQAC+z ZYQ334wgZaurF3c/lvFVNbhpRzlu1rHev387ZTZ0LJ5MiFb7g1UzW4a9BdmhiR4cIGr/Ux U/t82FSCt/1+UQfeYLOqwQFVRGROydlXn+RYBwlD4nw9vxsHmMqrn1Mx/vyW6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675294897; 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=SO53E5dSnM5P/Rt+Y92eGQawH1ZxBJSBiya2gRBcFJ0=; b=yNLbt6jKveATxGHfW+x2JB+rxSvzcGEP21cJ7wkDdCXezGLwVeqjOor8W77bPqHAkrxAyE xH+hQgFUHfqkieAE87LYmyki5zaunjFWMzKIR2ZSDojZUGB6f9ey9P6Z5YEx307yj0VNEu +Uz0fIkm1xsYe2IY6bwPeD9S9GAD8ZXpRTl6ypgtwv6eo8CJ72ed6M5scWFQCU4aa9YEJa sTuS9YUJbWSRTlZ50YinBPvoB2xaf8L7ngAMfNViRR2yUoprNYWak07183FVr6J1/FwmK8 K3qgXdZ1Ni+4ez1+fsmOy4ojKiw6T8ZxwFdH0Nw7CNcS4V50j/hJAShhRWXz+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675294897; a=rsa-sha256; cv=none; b=d16xmS+FaP6Hg7QslUUCqmB6+hXuVsetVx4JnBoYdffCrgYx4d4ll42lVD0ruVY5JUnkf0 pkkhWt+nCuxk9htdWMYoqTzWxGbFFYcw5o28ZFZRPl0vYiTziSjbTkYoP8FUTqDTgvFNWq vjJsAtBnytXZJs7joahcvqouFoO4Q8x9GYYK9+EC1HYDrelT/fFPoIeD3kDoYhUzeKgTU1 H90olHBuMiJyngHIu5YGII/WVEbzYDzgFE0CSfqQINfV8yHQtL2fTzbnpLIVQw9bGmHg9k lVApMoKYtdEHGsZLhLQKgbjd6nfYPVK/u8BZ0YUXC3hQ20I9A0MUefFYLtdNpA== 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 4P6djX63b0zYDf; Wed, 1 Feb 2023 23:41:36 +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 311NfaWC088948; Wed, 1 Feb 2023 23:41:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 311NfaHR088947; Wed, 1 Feb 2023 23:41:36 GMT (envelope-from git) Date: Wed, 1 Feb 2023 23:41:36 GMT Message-Id: <202302012341.311NfaHR088947@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: 83a49712afa2 - main - kstack_contains(): account for struct pcb on stack 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 83a49712afa276b7f320e0dd669c8dfd33f9a5ac Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=83a49712afa276b7f320e0dd669c8dfd33f9a5ac commit 83a49712afa276b7f320e0dd669c8dfd33f9a5ac Author: Konstantin Belousov AuthorDate: 2023-01-31 23:49:54 +0000 Commit: Konstantin Belousov CommitDate: 2023-02-01 22:59:27 +0000 kstack_contains(): account for struct pcb on stack for arm64, arm, powerpc, and riscv Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320 --- sys/arm/include/stack.h | 3 ++- sys/arm64/include/stack.h | 3 ++- sys/powerpc/include/stack.h | 3 ++- sys/riscv/include/stack.h | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arm/include/stack.h b/sys/arm/include/stack.h index e8d130517be5..748ef35a444e 100644 --- a/sys/arm/include/stack.h +++ b/sys/arm/include/stack.h @@ -78,7 +78,8 @@ static __inline bool kstack_contains(struct thread *td, vm_offset_t va, size_t len) { return (va >= td->td_kstack && va + len >= va && - va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); + va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + sizeof(struct pcb)); } #endif /* _SYS_PROC_H_ */ diff --git a/sys/arm64/include/stack.h b/sys/arm64/include/stack.h index 4c4c41bf9516..58fb2cf0e8a5 100644 --- a/sys/arm64/include/stack.h +++ b/sys/arm64/include/stack.h @@ -53,7 +53,8 @@ static __inline bool kstack_contains(struct thread *td, vm_offset_t va, size_t len) { return (va >= td->td_kstack && va + len >= va && - va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); + va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + sizeof(struct pcb)); } #endif /* _SYS_PROC_H_ */ diff --git a/sys/powerpc/include/stack.h b/sys/powerpc/include/stack.h index 953afd6f0aa4..53ea0fc3bc54 100644 --- a/sys/powerpc/include/stack.h +++ b/sys/powerpc/include/stack.h @@ -48,7 +48,8 @@ static __inline bool kstack_contains(struct thread *td, vm_offset_t va, size_t len) { return (va >= td->td_kstack && va + len >= va && - va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); + va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + sizeof(struct pcb)); } #endif /* _SYS_PROC_H_ */ diff --git a/sys/riscv/include/stack.h b/sys/riscv/include/stack.h index 566081c3ebd0..1f6907742b6a 100644 --- a/sys/riscv/include/stack.h +++ b/sys/riscv/include/stack.h @@ -63,7 +63,8 @@ static __inline bool kstack_contains(struct thread *td, vm_offset_t va, size_t len) { return (va >= td->td_kstack && va + len >= va && - va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE); + va + len <= td->td_kstack + td->td_kstack_pages * PAGE_SIZE - + sizeof(struct pcb)); } #endif /* _SYS_PROC_H_ */