lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Jan 2009 10:20:56 -0700
From:	"Dan Williams" <dan.j.williams@...el.com>
To:	"Haavard Skinnemoen" <haavard.skinnemoen@...el.com>
Cc:	"Atsushi Nemoto" <anemo@....ocn.ne.jp>,
	linux-kernel@...r.kernel.org, maciej.sosnowski@...el.com,
	ralf@...ux-mips.org
Subject: Re: [PATCH] dmatest: flush and invalidate destination buffer before DMA

On Thu, Jan 8, 2009 at 1:36 AM, Haavard Skinnemoen
<haavard.skinnemoen@...el.com> wrote:
> I think it does. The dmatest driver should definitely use
> DMA_BIDIRECTIONAL on the destination buffer to ensure that the poison
> values are written to RAM and not just written to cache and discarded.
>

True.

> Now, this probably means that the destination buffer must be _unmapped_
> with DMA_BIDIRECTIONAL too, which is difficult to do with the current
> asymmetrical API...
>

A map and unmap should work for the current platforms with dma
drivers, but you are right I think this is a violation of the api.
For correctness we would need the entire operation covered by
DMA_BIDIRECTIONAL to support platforms that may implement a dma bounce
buffer.  Or, we could change dmatest to not go through the dma-memcpy
api, allowing dma_alloc to be used for the destination.

> In the general case, however, I think MIPS has a bug: I've seen drivers
> DMA to/from tiny buffers stored inside another struct. This is legal
> because the driver can guarantee that the other fields in the struct
> aren't accessed in the mean time, but any fields sharing a cacheline
> with the buffer must be written back before the lines are invalidated.
>

*nod*

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ