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: <4940658B.9020405@shaw.ca>
Date:	Wed, 10 Dec 2008 18:57:47 -0600
From:	Robert Hancock <hancockr@...w.ca>
To:	Pete Zaitcev 
	<public-zaitcev-H+wXaHxf7aLQT0dZR+AlfA@...h.gmane.org>
CC:	Wu Fengguang 
	<public-fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@...h.gmane.org>,
	Gilad Ben-Yossef 
	<public-gilad-f4XOiQkOAtcdH0auuBZGHA@...h.gmane.org>,
	Laurent Pinchart 
	<public-laurent.pinchart-AgBVmzD5pcezQB+pC5nmwQ@...h.gmane.org>,
	LKML <public-linux-kernel-u79uwXL29TY76Z2rM5mHXA@...h.gmane.org>,
	Greg Kroah-Hartman <public-gregkh-l3A5Bk7waGM@...h.gmane.org>,
	"linux-usb-u79uwXL29TY76Z2rM5mHXA@...lic.gmane.org" 
	<public-linux-usb-u79uwXL29TY76Z2rM5mHXA@...h.gmane.org>
Subject: Re: [PATCH] USB: use stack allocation for struct usb_ctrlrequest




Pete Zaitcev wrote:
> On Wed, 10 Dec 2008 22:23:01 +0800, Wu Fengguang <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@...lic.gmane.org> wrote:
> 
>> For 64bit systems, we can easily go beyond 4GB physical memory.
>> So at least we should add GFP_DMA32 in addition to GFP_NOIO?
> 
> I am afraid the situation is that we really screwed the pooch while
> creating the USB API. I may be wrong about this, but my understanding
> is that if we get an address above 4GB from kmalloc and then send
> it down to usb_submit_urb(), a random memory corruption is likely
> (this is because we forget to check the result of dma_map_single()).
> 
> The code worked until now because most systems out in the field
> either a) had IOMMU, or b) had 4GB or RAM or less, but not both.
> The case (a) includes all AMD CPUs, all Itanium CPUs, and the
> Intel-based enterprise systems from big vendors, e.g. IBM Calgary,
> HP ZX-1, etc. Also, (a) covers Intel P4 class systems with swiotlb.
> So, we only blow up if a kernel with swiotlb disabled boots on an
> Intel box with more than 4GB of RAM. This is still far from ideal,
> but we kinda pretend not to notice. I heard that Intel has seen
> the error in their ways and is going to come out with IOMMU for
> all their chipsets, so in a few years this is going to be moot.

If you have memory located above 4GB you essentially need either swiotlb 
or one of the other IOMMUs enabled or the system won't work if any of 
your devices have DMA limits. There is no other way that DMA could occur 
to memory above 4GB for those devices.

DMA mapping could still fail if the IOMMU space overflowed, though.


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