linux/kernel/dma
Kishon Vijay Abraham I 1edfff795d dma-direct: fix data truncation in dma_direct_get_required_mask()
[ Upstream commit cdcda0d1f8 ]

The upper 32-bit physical address gets truncated inadvertently
when dma_direct_get_required_mask() invokes phys_to_dma_direct().
This results in dma_addressing_limited() return incorrect value
when used in platforms with LPAE enabled.
Fix it here by explicitly type casting 'max_pfn' to phys_addr_t
in order to prevent overflow of intermediate value while evaluating
'(max_pfn - 1) << PAGE_SHIFT'.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-29 16:33:00 +02:00
..
Kconfig dma-mapping: remove arch_dma_mmap_pgprot 2019-08-29 16:43:22 +02:00
Makefile dma-mapping: improve selection of dma_declare_coherent availability 2019-02-20 07:26:35 -07:00
coherent.c dma-coherent: fix integer overflow in the reserved-memory dma allocation 2020-04-23 10:36:30 +02:00
contiguous.c dma-direct: fix zone selection after an unaddressable CMA allocation 2019-08-21 07:14:10 +09:00
debug.c dma-debug: fix displaying of dma allocation type 2020-04-23 10:36:43 +02:00
direct.c dma-direct: fix data truncation in dma_direct_get_required_mask() 2020-04-29 16:33:00 +02:00
dummy.c dma-mapping: factor out dummy DMA ops 2018-12-13 21:06:12 +01:00
mapping.c dma-mapping: Fix dma_pgprot() for unencrypted coherent pages 2020-04-17 10:50:01 +02:00
remap.c dma-mapping: fix false positivse warnings in dma_common_free_remap() 2019-10-05 10:24:17 +02:00
swiotlb.c powerpc updates for 5.4 2019-09-20 11:48:06 -07:00
virt.c dma-mapping: zero memory returned from dma_alloc_* 2018-12-20 08:13:52 +01:00