]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
arm64: Check DMAP address is valid in PHYS_IN_DMAP
authorAndrew Turner <andrew@FreeBSD.org>
Mon, 8 Apr 2024 10:44:33 +0000 (10:44 +0000)
committerAndrew Turner <andrew@FreeBSD.org>
Wed, 24 Apr 2024 18:17:19 +0000 (18:17 +0000)
commit9d40492efa467095340cf3dca5860880aa441472
tree5b58747fdb89b642574f67bc46898136be6dd90f
parentef80df0a71912500ad84060334a24e903869f00b
arm64: Check DMAP address is valid in PHYS_IN_DMAP

When checking if a physical address is in the DMAP region we assume
all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR
are able to be accesses through the DMAP. It may be the case that
there is device memory in this range that shouldn't be accessed through
the DMAP mappings.

Add a check to PHYS_IN_DMAP that the translated virtual address is a
valid kernel address. To support code that already checks the address
is valid add PHYS_IN_DMAP_RANGE.

PR: 278233
Reviewed by: alc, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44677
sys/arm64/arm64/efirt_machdep.c
sys/arm64/arm64/machdep.c
sys/arm64/arm64/minidump_machdep.c
sys/arm64/include/vmparam.h