diff options
| author | Nicolas Saenz Julienne <[email protected]> | 2019-11-07 15:06:44 +0000 |
|---|---|---|
| committer | Christoph Hellwig <[email protected]> | 2019-11-11 09:52:18 +0000 |
| commit | b12d66278dd627cbe1ea7c000aa4715aaf8830c8 (patch) | |
| tree | 6ed0eb01fd50f5035d8808ba9fee7c2e85960506 /drivers/net/xen-netback/interface.c | |
| parent | dma-debug: increase HASH_SIZE (diff) | |
| download | kernel-b12d66278dd627cbe1ea7c000aa4715aaf8830c8.tar.gz kernel-b12d66278dd627cbe1ea7c000aa4715aaf8830c8.zip | |
dma-direct: check for overflows on 32 bit DMA addresses
As seen on the new Raspberry Pi 4 and sta2x11's DMA implementation it is
possible for a device configured with 32 bit DMA addresses and a partial
DMA mapping located at the end of the address space to overflow. It
happens when a higher physical address, not DMAable, is translated to
it's DMA counterpart.
For example the Raspberry Pi 4, configurable up to 4 GB of memory, has
an interconnect capable of addressing the lower 1 GB of physical memory
with a DMA offset of 0xc0000000. It transpires that, any attempt to
translate physical addresses higher than the first GB will result in an
overflow which dma_capable() can't detect as it only checks for
addresses bigger then the maximum allowed DMA address.
Fix this by verifying in dma_capable() if the DMA address range provided
is at any point lower than the minimum possible DMA address on the bus.
Signed-off-by: Nicolas Saenz Julienne <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
0 files changed, 0 insertions, 0 deletions
