summaryrefslogtreecommitdiff
path: root/drivers/remoteproc/mtk_scp.c
diff options
context:
space:
mode:
authorMartin Radev <martin.b.radev@gmail.com>2021-01-12 16:07:29 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2021-02-26 10:52:51 -0500
commitdaf9514fd5eb098d7d6f3a1247cb8cc48fc94155 (patch)
tree72852211acfff1c57280b9865afdd0a625f7381c /drivers/remoteproc/mtk_scp.c
parent3d2d861eb03e8ee96dc430a54361c900cbe28afd (diff)
swiotlb: Validate bounce size in the sync/unmap path
The size of the buffer being bounced is not checked if it happens to be larger than the size of the mapped buffer. Because the size can be controlled by a device, as it's the case with virtio devices, this can lead to memory corruption. This patch saves the remaining buffer memory for each slab and uses that information for validation in the sync/unmap paths before swiotlb_bounce is called. Validating this argument is important under the threat models of AMD SEV-SNP and Intel TDX, where the HV is considered untrusted. Signed-off-by: Martin Radev <martin.b.radev@gmail.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/remoteproc/mtk_scp.c')
0 files changed, 0 insertions, 0 deletions