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:	Sun, 6 Mar 2011 16:06:38 +0100
From:	Oliver Neukum <oliver@...kum.org>
To:	Florian Mickler <florian@...kler.org>
Cc:	mchehab@...radead.org, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Greg Kroah-Hartman" <greg@...ah.com>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	Maciej Rutecki <maciej.rutecki@...il.com>
Subject: Re: [PATCH] [media] dib0700: get rid of on-stack dma buffers

Am Sonntag, 6. März 2011, 15:38:05 schrieb Florian Mickler:
> On Sun, 6 Mar 2011 13:06:09 +0100
> Oliver Neukum <oliver@...kum.org> wrote:
> 
> > Am Sonntag, 6. März 2011, 12:16:52 schrieb Florian Mickler:

> > > Please take a look at it, as I do not do that much kernel hacking
> > > and don't wanna brake anybodys computer... :)
> > > 
> > > From my point of view this should _not_ go to stable even though it would
> > > be applicable. But if someone feels strongly about that and can
> > > take responsibility for that change...
> > 
> > The patch looks good and is needed in stable.
> > It could be improved by using a buffer allocated once in the places
> > you hold a mutex anyway.
> > 
> > 	Regards
> > 		Oliver
> 
> Ok, I now put a buffer member in the priv dib0700_state which gets
> allocated on the heap. 

This however is wrong. Just like DMA on the stack this breaks
coherency rules. You may do DMA to the heap in the sense that
you can do DMA to buffers allocated on the heap, but you cannot
do DMA to a part of another structure allocated on the heap.
You need a separate kmalloc for each buffer.
You can reuse the buffer with proper locking, but you must allocate
it seperately once.

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