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]
Message-ID: <20081227111037.3bd13adc@hskinnemoen-d830>
Date:	Sat, 27 Dec 2008 11:10:37 +0100
From:	Haavard Skinnemoen <haavard.skinnemoen@...el.com>
To:	Atsushi Nemoto <anemo@....ocn.ne.jp>
Cc:	linux-kernel@...r.kernel.org, hskinnemoen@...el.com,
	maciej.sosnowski@...el.com, dan.j.williams@...el.com,
	ralf@...ux-mips.org
Subject: Re: [PATCH] dmatest: flush and invalidate destination buffer before
 DMA

Atsushi Nemoto wrote:
> @@ -226,6 +227,12 @@ static int dmatest_func(void *data)
>  
>  		dmatest_init_srcbuf(thread->srcbuf, src_off, len);
>  		dmatest_init_dstbuf(thread->dstbuf, dst_off, len);
> +		/* flush and invalidate caches for whole dstbuf */
> +		dma_dest = dma_map_single(chan->device->dev,
> +				thread->dstbuf,
> +				test_buf_size, DMA_BIDIRECTIONAL);
> +		dma_unmap_single(chan->device->dev, dma_dest,
> +				test_buf_size, DMA_BIDIRECTIONAL);

You're supposed to unmap after the DMA operation is done, not before
it's submitted.

In this case, the DMA engine framework will do the unmapping for you
(probably using the wrong primitive, but they're really all the same in
practice, right?) so you can just drop the unmap call.

Now, I suspect the dw_dmac driver maps the buffer when it's not
supposed to, masking this kind of error...should probably get that
fixed too.

Haavard
--
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