Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 1 Feb 2020 09:56:41 -0800
From: Kees Cook <>
To: Jann Horn <>
Cc: Christian Borntraeger <>,
	Christoph Hellwig <>,
	Christopher Lameter <>, Jiri Slaby <>,
	Julian Wiedmann <>,
	Ursula Braun <>,
	Alexander Viro <>,
	kernel list <>,
	David Windsor <>,
	Pekka Enberg <>,
	David Rientjes <>,
	Joonsoo Kim <>,
	Andrew Morton <>,
	Linux-MM <>,,
	Linus Torvalds <>,
	Andy Lutomirski <>,
	"David S. Miller" <>,
	Laura Abbott <>,
	Mark Rutland <>,
	"Martin K. Petersen" <>,
	Paolo Bonzini <>,
	Christoffer Dall <>,
	Dave Kleikamp <>, Jan Kara <>,
	Luis de Bethencourt <>,
	Marc Zyngier <>, Rik van Riel <>,
	Matthew Garrett <>,
	linux-fsdevel <>,
	linux-arch <>,
	Network Development <>,
	Kernel Hardening <>,
	Vlastimil Babka <>, Michal Kubecek <>
Subject: Re: [PATCH 09/38] usercopy: Mark kmalloc caches
 as usercopy caches

On Fri, Jan 31, 2020 at 01:03:40PM +0100, Jann Horn wrote:
> I think dma-kmalloc slabs should be handled the same way as normal
> kmalloc slabs. When a dma-kmalloc allocation is freshly created, it is
> just normal kernel memory - even if it might later be used for DMA -,
> and it should be perfectly fine to copy_from_user() into such
> allocations at that point, and to copy_to_user() out of them at the
> end. If you look at the places where such allocations are created, you
> can see things like kmemdup(), memcpy() and so on - all normal
> operations that shouldn't conceptually be different from usercopy in
> any relevant way.

I can't find where the address limit for dma-kmalloc is implemented.

As to whitelisting all of dma-kmalloc -- I guess I can be talked into
it. It still seems like the memory used for direct hardware
communication shouldn't be exposed to userspace, but it we're dealing
with packet data, etc, then it makes sense not to have to have bounce
buffers, etc.

Kees Cook

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.