Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-01-25 Thread Martin Radev
On Mon, Jan 18, 2021 at 10:14:28AM -0500, Konrad Rzeszutek Wilk wrote: > On Mon, Jan 18, 2021 at 12:44:58PM +0100, Martin Radev wrote: > > On Wed, Jan 13, 2021 at 12:30:17PM +0100, Christoph Hellwig wrote: > > > On Tue, Jan 12, 2021 at 04:07:29PM +0100, Martin Radev wrote

Re: [PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-01-18 Thread Martin Radev
On Wed, Jan 13, 2021 at 12:30:17PM +0100, Christoph Hellwig wrote: > On Tue, Jan 12, 2021 at 04:07:29PM +0100, Martin Radev wrote: > > 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 > &

[PATCH] swiotlb: Validate bounce size in the sync/unmap path

2021-01-12 Thread Martin Radev
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 --- kernel/dma/swiotlb.c | 52