]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Read the arm64 far early in el0 exceptions
authorAndrew Turner <andrew@FreeBSD.org>
Wed, 25 Jan 2023 17:47:39 +0000 (17:47 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Thu, 2 Feb 2023 16:43:15 +0000 (16:43 +0000)
commitf29942229d24ebb8b98f8c5d02f3c8632648007e
treee0d6f6b5646e068596ee33be6c6a4994e1888d39
parent22e4897422a055b7a15be5984fbc4bb97f432e79
Read the arm64 far early in el0 exceptions

When handling userspace exceptions on arm64 we need to dereference the
current thread pointer. If this is being promoted/demoted there is a
small window where it will cause another exception to be hit. As this
second exception will set the fault address register we will read the
incorrect value in the userspace exception handler.

Fix this be always reading the fault address before dereferencing the
current thread pointer.

Reported by: olivier@
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D38196
sys/arm64/arm64/exception.S
sys/arm64/arm64/trap.c