public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: Josh Boyer <jwboyer@redhat.com>
Cc: edwin_rong <edwin_rong@realsil.com.cn>,
	wwang <wei_wang@realsil.com.cn>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: ums-realtek driver uses stack memory for DMA
Date: Mon, 1 Aug 2011 14:16:59 -0700	[thread overview]
Message-ID: <20110801211659.GA13252@suse.de> (raw)
In-Reply-To: <20110801210905.GC2096@zod.bos.redhat.com>

On Mon, Aug 01, 2011 at 05:09:06PM -0400, Josh Boyer wrote:
> Hello,
> 
> We have a report that the ums-realtek driver is generating a backtrace
> due to using stack variables for DMA buffers.  The backtrace is below
> and you can view the bug report here:
> https://bugzilla.redhat.com/show_bug.cgi?id=720054
> 
> Looking through the code, it seems that every call to rts51x_read_mem,
> rts51x_write_mem, and rts51x_read_status passes a stack variable to
> rts51x_bulk_transport, which then calls usb_stor_bulk_transfer_buf with
> this and generates the backtrace.  It is my understanding that the
> driver should be passing variables that are not on the stack and have
> been allocated with memory that will be suitable for the DMA api (e.g.
> kmalloc).

That is correct.

> Was this missed during the initial review and is anyone working on
> adapting the driver to be compliant?

Odds are it was missed.  Patches gladly accepted.

thanks,

greg k-h

  reply	other threads:[~2011-08-01 21:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-01 21:09 ums-realtek driver uses stack memory for DMA Josh Boyer
2011-08-01 21:16 ` Greg KH [this message]
2011-08-02  5:04 ` Adam Cozzette
2011-08-02 12:41   ` Josh Boyer
2011-08-12 15:05     ` Josh Boyer
2011-08-23 16:50       ` Josh Boyer
     [not found] ` <20110802050411.GC3857@192.168.0.12>
2011-08-12 15:56   ` Daniel Mack

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=20110801211659.GA13252@suse.de \
    --to=gregkh@suse.de \
    --cc=edwin_rong@realsil.com.cn \
    --cc=jwboyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=wei_wang@realsil.com.cn \
    /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