linux-stable/arch/arm64
Miles Chen eea1bb2248 arm64: mm: check virtual addr in virt_to_page() if CONFIG_DEBUG_VIRTUAL=y
This change uses the original virt_to_page() (the one with __pa()) to
check the given virtual address if CONFIG_DEBUG_VIRTUAL=y.

Recently, I worked on a bug: a driver passes a symbol address to
dma_map_single() and the virt_to_page() (called by dma_map_single())
does not work for non-linear addresses after commit 9f2875912d
("arm64: mm: restrict virt_to_page() to the linear mapping").

I tried to trap the bug by enabling CONFIG_DEBUG_VIRTUAL but it
did not work - bacause the commit removes the __pa() from
virt_to_page() but CONFIG_DEBUG_VIRTUAL checks the virtual address
in __pa()/__virt_to_phys().

A simple solution is to use the original virt_to_page()
(the one with__pa()) if CONFIG_DEBUG_VIRTUAL=y.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2019-04-16 16:27:59 +01:00
..
boot arm64: tegra: Disable CQE Support for SDMMC4 on Tegra186 2019-03-25 17:12:20 +01:00
configs Allwinner arm64 defconfig changes for 5.1 2019-02-15 16:51:26 +01:00
crypto arm64: HWCAP: add support for AT_HWCAP2 2019-04-16 16:27:12 +01:00
include arm64: mm: check virtual addr in virt_to_page() if CONFIG_DEBUG_VIRTUAL=y 2019-04-16 16:27:59 +01:00
kernel arm64: Advertise ARM64_HAS_DCPODP cpu feature 2019-04-16 16:27:59 +01:00
kvm KVM: arm64: Reset the PMU in preemptible context 2019-03-19 17:56:24 +00:00
lib arm64: Makefile: Replace -pg with CC_FLAGS_FTRACE 2019-04-09 10:34:59 +01:00
mm arm64: Save and restore OSDLR_EL1 across suspend/resume 2019-04-09 12:39:13 +01:00
net arm64: bpf: implement jitting of JMP32 2019-01-26 13:33:02 -08:00
xen
Kconfig arm64: ptrace: Add function argument access API 2019-04-12 17:04:27 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.platforms This pull request brings in a build fix for arm64 with bcm2835 2019-03-18 10:31:24 -07:00
Makefile kasan, arm64: adjust shadow size for tag-based mode 2018-12-28 12:11:43 -08:00