The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andy Walls <awalls@md.metrocast.net>
To: Florian Mickler <florian@mickler.org>, mchehab@infradead.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	js@linuxtv.org, tskd2@yahoo.co.jp, liplianin@me.by,
	g.marco@freenet.de, aet@rasterburn.org, pb@linuxtv.org,
	mkrufky@linuxtv.org, nick@nick-andrew.net, max@veneto.com,
	janne-dvb@grunau.be
Subject: Re: [PATCH 0/6] get rid of on-stack dma buffers
Date: Mon, 21 Mar 2011 15:26:43 -0400	[thread overview]
Message-ID: <a08d026a-d4c3-4ee5-b01a-d561f755b1ec@email.android.com> (raw)
In-Reply-To: <1300732426-18958-1-git-send-email-florian@mickler.org>

Florian Mickler <florian@mickler.org> wrote:

>Hi all!
>
>These patches get rid of on-stack dma buffers for some of the dvb-usb
>drivers. 
>I do not own the hardware, so these are only compile tested. I would 
>appreciate testing and review.
>They were previously sent to the list, but some error on my side
>prevented (some of?) them from beeing delivered to all parties (the
>lists).
>
>These changes are motivated by 
>https://bugzilla.kernel.org/show_bug.cgi?id=15977 .
>
>The patches which got tested already were submitted to Mauro (and
>lkml/linux-media) yesterday seperately. Those fix this same issue for
>ec168,
>ce6230, au6610 and lmedm04. 
>
>A fix for vp702x has been submitted seperately for review on the list.
>I have
>similiar fixes like the vp702x-fix for dib0700 (overlooked some
>on-stack
>buffers in there in my original submission as well) and gp8psk, but I
>am
>holding them back 'till I got time to recheck those and getting some
>feedback
>on vp702x.
>
>Please review and test.
>
>Regards,
>Flo
>
>Florian Mickler (6):
>  [media] a800: get rid of on-stack dma buffers
>  [media v2] vp7045: get rid of on-stack dma buffers
>  [media] friio: get rid of on-stack dma buffers
>  [media] dw2102: get rid of on-stack dma buffer
>  [media] m920x: get rid of on-stack dma buffers
>  [media] opera1: get rid of on-stack dma buffer
>
> drivers/media/dvb/dvb-usb/a800.c   |   17 ++++++++++---
> drivers/media/dvb/dvb-usb/dw2102.c |   10 ++++++-
> drivers/media/dvb/dvb-usb/friio.c  |   23 ++++++++++++++---
> drivers/media/dvb/dvb-usb/m920x.c  |   33 ++++++++++++++++--------
> drivers/media/dvb/dvb-usb/opera1.c |   31 +++++++++++++++--------
>drivers/media/dvb/dvb-usb/vp7045.c |   47
>++++++++++++++++++++++++++----------
> 6 files changed, 116 insertions(+), 45 deletions(-)
>
>-- 
>1.7.4.1
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-media"
>in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

Florian,

For all of these, what happens when the USB call times out and you kfree() the buffer?  Can the USB DMA actually complete after this kfree(), possibly corrupting space that has been reallocated off the heap, since the kfree()?

This is the scenario for which I assume allocating off the stack is bad.  

Do these changes simply make corruption less noticable since heap gets corrupted vs stack?

Regards,
Andy

  parent reply	other threads:[~2011-03-21 19:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 18:33 [PATCH 0/6] get rid of on-stack dma buffers Florian Mickler
2011-03-21 18:33 ` [PATCH 1/6] [media] a800: " Florian Mickler
2011-03-21 18:33 ` [PATCH 2/6 v2] [media] vp7045: " Florian Mickler
2011-03-21 18:33 ` [PATCH 3/6] [media] friio: " Florian Mickler
2011-03-21 18:33 ` [PATCH 4/6] [media] dw2102: get rid of on-stack dma buffer Florian Mickler
2011-03-21 18:33 ` [PATCH 5/6] [media] m920x: get rid of on-stack dma buffers Florian Mickler
2011-03-21 18:33 ` [PATCH 6/6] [media] opera1: get rid of on-stack dma buffer Florian Mickler
2011-03-21 19:26 ` Andy Walls [this message]
2011-03-21 21:03   ` [PATCH 0/6] get rid of on-stack dma buffers Florian Mickler
2011-03-22 10:44     ` Roedel, Joerg
     [not found]       ` <AANLkTimXobrwc-XHgoVN1dD5NCTde64dykbyvtJMo229@mail.gmail.com>
2011-03-22 13:12         ` Oliver Neukum
2011-03-22 14:27       ` Florian Mickler
2011-03-22 10:59     ` Jiri Kosina
2011-03-22 12:33       ` Johannes Stezenbach
2011-03-22 13:35     ` James Bottomley
2011-03-22 14:02       ` Florian Mickler
2011-03-22 20:15       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a08d026a-d4c3-4ee5-b01a-d561f755b1ec@email.android.com \
    --to=awalls@md.metrocast.net \
    --cc=aet@rasterburn.org \
    --cc=florian@mickler.org \
    --cc=g.marco@freenet.de \
    --cc=janne-dvb@grunau.be \
    --cc=js@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=liplianin@me.by \
    --cc=max@veneto.com \
    --cc=mchehab@infradead.org \
    --cc=mkrufky@linuxtv.org \
    --cc=nick@nick-andrew.net \
    --cc=pb@linuxtv.org \
    --cc=tskd2@yahoo.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox