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:	Mon, 1 Dec 2008 23:10:33 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	joro@...tes.org
Cc:	fujita.tomonori@....ntt.co.jp, tsbogend@...ha.franken.de,
	linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: Re: [PATCH v3] Fix dma_mapping_error for 32bit x86

On Mon, 1 Dec 2008 13:58:52 +0100
Joerg Roedel <joro@...tes.org> wrote:

> On Mon, Dec 01, 2008 at 09:01:06PM +0900, FUJITA Tomonori wrote:
> > On Mon, 1 Dec 2008 12:34:51 +0100
> > Joerg Roedel <joro@...tes.org> wrote:
> > 
> > > On Sat, Nov 29, 2008 at 01:46:27PM +0100, Thomas Bogendoerfer wrote:
> > > > Devices like b44 ethernet can't dma from addresses above 1GB. The driver
> > > > handles this cases by falling back to GFP_DMA allocation. But for detecting
> > > > the problem it needs to get an indication from dma_mapping_error.
> > > > The bug is triggered by using a VMSPLIT option of 2G/2G.
> > > 
> > > Looks like your system uses swiotlb as the dma_ops backend. Its the only
> > > implementation providing the ops->mapping_error callback and does not
> > > use bad_dma_address as the error value.
> > 
> > I think that you misunderstand the problem.
> > 
> > He uses X86_32 so swiotlb should not be used (which is available on only
> > X86_64 and IA64 for now).
> > 
> > b44 needs an address under 1GB so it sets device->dma_mask to
> > DMA_30BIT_MASK. With VMSPLIT option of 2G/2G, I guess that b44 could
> > get addresses above 1GB from the networking subsystem. In such case,
> > nommu_map_single returns bad_dma_address properly, but on X86_32,
> > dma_mapping_error always returns 0 (success). So b44 wrongly thinks
> > that the address is under 1GB.
> > 
> > This patch fixes dma_mapping_error() to check a passed address
> > properly (compares it with bad_dma_address).
> 
> Ah true, thanks. Anyway, the patch also solved the problem with swiotlb
> on 64bit.

Can you be specific?

swiotlb's dma_mapping_error on X86_64 doesn't have any problem as far
as I know.
--
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