diff options
author | Miles Chen <miles.chen@mediatek.com> | 2019-04-16 01:36:36 +0800 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2019-04-16 16:27:59 +0100 |
commit | eea1bb2248691ed65c33daff94a253af44feb103 (patch) | |
tree | 831f3d94456888c721b5b08ff5d1527fe9d3a846 /crypto | |
parent | b9585f53bcf1ada1fbac22c15fd723c65ef67ff1 (diff) | |
download | linux-stable-eea1bb2248691ed65c33daff94a253af44feb103.tar.gz linux-stable-eea1bb2248691ed65c33daff94a253af44feb103.tar.bz2 linux-stable-eea1bb2248691ed65c33daff94a253af44feb103.zip |
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 9f2875912dac
("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>
Diffstat (limited to 'crypto')
0 files changed, 0 insertions, 0 deletions