diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-03-29 17:12:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-12-25 14:23:43 +0100 |
commit | 5460e4672b81980a2f05ab3e9bb64d9303e11215 (patch) | |
tree | e97f2c8bb7fe210a0c3f1f6cebdc3ba761653c1c /tools/laptop | |
parent | 9c1433b5dd2b4f7bef192bc07d976f11616d7a29 (diff) |
ARM: dma-mapping: disallow dma_get_sgtable() for non-kernel managed memory
[ Upstream commit 916a008b4b8ecc02fbd035cfb133773dba1ff3d7 ]
dma_get_sgtable() tries to create a scatterlist table containing valid
struct page pointers for the coherent memory allocation passed in to it.
However, memory can be declared via dma_declare_coherent_memory(), or
via other reservation schemes which means that coherent memory is not
guaranteed to be backed by struct pages. In such cases, the resulting
scatterlist table contains pointers to invalid pages, which causes
kernel oops later.
This patch adds detection of such memory, and refuses to create a
scatterlist table for such memory.
Reported-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/laptop')
0 files changed, 0 insertions, 0 deletions