linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <mcgrof@gmail.com>
To: "Björn Smedman" <bjorn.smedman@venatech.se>
Cc: Ben Greear <greearb@candelatech.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: memory clobber in rx path, maybe related to ath9k.
Date: Mon, 18 Oct 2010 15:41:33 -0700	[thread overview]
Message-ID: <AANLkTi=ten5-kbUOGYGbnqNff4RJ=WWEC6_CaH1Psy0V@mail.gmail.com> (raw)
In-Reply-To: <AANLkTim=GkK=e5bj8GXHG7r0BXcitaZ-gvSfZVmpsLzE@mail.gmail.com>

2010/10/18 Björn Smedman <bjorn.smedman@venatech.se>:
> 2010/10/18 Luis R. Rodriguez <mcgrof@gmail.com>:
>> 2010/10/18 Björn Smedman <bjorn.smedman@venatech.se>:
>>> 2010/10/15 Björn Smedman <bjorn.smedman@venatech.se>
>>>>
>>>> 2010/10/15 Ben Greear <greearb@candelatech.com>:
>>>> > I tried the patch below, and it didn't seem to help.  Might even
>>>> > have hurt..as it died on divide-by-zero error:
>>>>
>>>> Hmm, looks like the ani code got a zero listen time from the hw...
>>>> That just might mean that the DMA actually hits one of these
>>>> descriptors. :)
>>>
>>> Am I the only one worried about this? Leaving a DMA descriptor
>>> pointing at memory which has been passed on to somebody else... To me
>>> that's like pointing a loaded gun at someone (and it seems this
>>> particular gun can go off a little haphazardly).
>>>
>>> Luis, given how hard it seems to be to get that locking and skb
>>> shoveling right, are you sure you want to keep pointing that DMA
>>> engine on innocent people's data?
>>
>> This is why this issue is of high priority to me. I no longer get the
>> poison nor does Ben, the RX poison issue is resolved as far as I can
>> tell, I just need to split up the patches into easily reviewable
>> chunks and get them upstream.
>
> The locking issue you found looks like it could cause those
> overwritten poisons (as well as some weird problems I've seen in AP
> mode with lots of monitor interfaces). It's really great to see that
> problem go.

:)

> All I'm saying is that this stuff is difficult and the
> next time we get it wrong we should try to avoid overwriting arbitrary
> kernel memory with our RXed frames (or TXing something sensitive).

Patches welcomed.

> Will the DMA engine stop when it sees a zero ds_data? In that case I
> suggest we never keep an address there that we do not want to RX to or
> TX from.

We will always have an skb available to DMA for RX, its part of the
design on RX on ath9k. We simply do drop the frame we just got DMA'd
if we cannot allocate a new skb from the kernel. So we should always
be able to DMA over and over and over. The issue here was due to a
race on stopping and starting the PCU, it got confused on which buffer
to write to.

> Also, is there some way to verify that we are not corrupting memory
> with the DMA? I mean the poison check is great

I'm only aware of the poison checks.

> but if I understand
> correctly it cannot detect if we overwrite active memory (i.e. before
> it is freed and marked with the poison).

Right, the best you can do is to understand the code. Detecting bogus
writes from hardware to are hard to detect on already used memory
given that you'd need to ensure you understand what a writer to that
area of memory will do.

Anyway if you find actual issues instead of pure speculation please let us know.

  Luis

  reply	other threads:[~2010-10-18 22:41 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 17:00 memory clobber in rx path, maybe related to ath9k Ben Greear
2010-10-05 17:16 ` Luis R. Rodriguez
2010-10-05 17:24   ` Ben Greear
2010-10-05 17:36     ` Luis R. Rodriguez
2010-10-05 17:38       ` Ben Greear
2010-10-05 17:43         ` Luis R. Rodriguez
2010-10-05 17:47           ` Ben Greear
2010-10-05 17:55             ` Luis R. Rodriguez
2010-10-05 18:14               ` Ben Greear
2010-10-05 21:12                 ` Ben Greear
2010-10-07 17:33                 ` Ben Greear
2010-10-07 18:14                   ` Johannes Berg
2010-10-07 18:29                     ` Luis R. Rodriguez
2010-10-07 18:39                       ` Ben Greear
2010-10-07 18:42                         ` Luis R. Rodriguez
2010-10-07 18:45                           ` Ben Greear
2010-10-07 19:14                             ` Ben Greear
2010-10-07 19:17                               ` Johannes Berg
2010-10-07 19:22                           ` Ben Greear
2010-10-07 19:27                             ` Johannes Berg
2010-10-07 21:31                               ` Luis R. Rodriguez
2010-10-07 21:36                                 ` Luis R. Rodriguez
2010-10-07 21:59                                   ` Luis R. Rodriguez
2010-10-11 20:51                                     ` Ben Greear
2010-10-12  1:03                                       ` Luis R. Rodriguez
2010-10-12  3:27                                         ` Ben Greear
2010-10-12  6:10                                           ` Luis R. Rodriguez
2010-10-12 18:35                                             ` Ben Greear
2010-10-12 18:40                                               ` Luis R. Rodriguez
2010-10-12 18:43                                                 ` Ben Greear
2010-10-12 19:51                                                   ` Ben Greear
2010-10-13 17:12                                                 ` Ben Greear
2010-10-13 17:29                                                   ` Luis R. Rodriguez
2010-10-13 17:48                                                     ` Ben Greear
2010-10-14 21:25                                                       ` Luis R. Rodriguez
2010-10-14 21:31                                                         ` Ben Greear
2010-10-14 21:32                                                           ` Luis R. Rodriguez
2010-10-14 21:39                                                             ` Ben Greear
2010-10-14 21:45                                                       ` Johannes Berg
2010-10-14 21:47                                                         ` Ben Greear
2010-10-13  5:31                                               ` Vasanthakumar Thiagarajan
2010-10-13 16:39                                                 ` Ben Greear
2010-10-13 19:56                                                   ` Björn Smedman
2010-10-13 20:03                                                     ` Luis R. Rodriguez
2010-10-14 19:15                                                       ` Ben Greear
2010-10-14 19:17                                                         ` Luis R. Rodriguez
2010-10-14 21:52                                                     ` Björn Smedman
2010-10-14 22:05                                                       ` Ben Greear
2010-10-14 22:16                                                         ` Luis R. Rodriguez
2010-10-14 22:29                                                           ` Luis R. Rodriguez
2010-10-14 22:35                                                             ` Luis R. Rodriguez
2010-10-14 22:44                                                               ` Ben Greear
2010-10-14 22:54                                                                 ` Luis R. Rodriguez
2010-10-14 22:51                                                               ` Luis R. Rodriguez
2010-10-14 23:19                                                                 ` Luis R. Rodriguez
2010-10-14 23:30                                                                   ` Ben Greear
2010-10-14 23:39                                                                     ` Luis R. Rodriguez
2010-10-14 23:48                                                                       ` Luis R. Rodriguez
2010-10-15 16:51                                                                         ` Ben Greear
2010-10-15 18:47                                                                           ` Luis R. Rodriguez
2010-10-15 19:36                                                                             ` Ben Greear
2010-10-15 21:07                                                                               ` Luis R. Rodriguez
2010-10-15 23:21                                                                                 ` Luis R. Rodriguez
2010-10-15 23:33                                                                                   ` Ben Greear
2010-10-15 23:38                                                                                     ` Luis R. Rodriguez
2010-10-15 23:41                                                                                       ` Luis R. Rodriguez
2010-10-16  0:07                                                                                         ` Ben Greear
2010-10-15 23:42                                                                                       ` Ben Greear
2010-10-15 23:57                                                                                         ` Luis R. Rodriguez
2010-10-17 19:44                                                                                           ` Ben Greear
2010-10-18 22:46                                                                                             ` Luis R. Rodriguez
2010-10-15 23:39                                                                                     ` Ben Greear
2010-10-14 23:51                                                                       ` Ben Greear
2010-10-14 22:47                                                       ` Ben Greear
2010-10-14 23:46                                                         ` Björn Smedman
2010-10-18 13:48                                                           ` Björn Smedman
2010-10-18 17:24                                                             ` Luis R. Rodriguez
2010-10-18 22:34                                                               ` Björn Smedman
2010-10-18 22:41                                                                 ` Luis R. Rodriguez [this message]
2010-10-14  5:37                                                   ` Vasanthakumar Thiagarajan
2010-10-07 21:52                                 ` Ben Greear
2010-10-08  0:42                               ` Bruno Randolf
2010-10-08  2:30                                 ` Ben Greear
2010-10-05 17:22 ` Johannes Berg

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='AANLkTi=ten5-kbUOGYGbnqNff4RJ=WWEC6_CaH1Psy0V@mail.gmail.com' \
    --to=mcgrof@gmail.com \
    --cc=bjorn.smedman@venatech.se \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).