From: Oliver Neukum <oliver@neukum.org>
To: Josh Boyer <jwboyer@redhat.com>
Cc: Oliver Neukum <oliver@neukum.name>,
"Greg Kroah-Hartman" <gregkh@suse.de>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: cdc_ncm uses stack memory for DMA
Date: Mon, 1 Aug 2011 22:26:16 +0200 [thread overview]
Message-ID: <201108012226.16180.oliver@neukum.org> (raw)
In-Reply-To: <20110801195949.GB2096@zod.bos.redhat.com>
Am Montag, 1. August 2011, 21:59:50 schrieb Josh Boyer:
Hi,
> Looking through the code, it seems that cdc_ncm_setup is still passing
> stack variables around lines 270, 276, 375, and 406. Which of those
> exactly is triggering the backtrace, I'm not sure but all of them seem
> incorrect from what I can tell.
They are incorrect.
> Do you have any thoughts on a solution for this? Off the top of my
> head, either the local variables being used could be added to the ctx
Careful. You also need to confirm to the rules about cached coherency
on some architectures. You cannot do DMA into the middle of a structure
unless you are sure it is not touched any other way.
> structure or the variables can be changed to pointers and then be
> allocated via kmalloc and torn down shortly after.
This looks like the easiest way.
Regards
Oliver
next prev parent reply other threads:[~2011-08-01 20:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-01 19:59 Josh Boyer
2011-08-01 20:26 ` Oliver Neukum [this message]
2011-08-02 11:01 ` Josh Boyer
2011-08-02 12:00 ` Alexey ORISHKO
2011-08-02 12:08 ` Josh Boyer
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=201108012226.16180.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=gregkh@suse.de \
--cc=jwboyer@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oliver@neukum.name \
/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
all inboxes | Powered by JetHome®