All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: linux-wireless@vger.kernel.org
Cc: ath5k-devel@lists.ath5k.org
Subject: Re: [PATCH] ath5k: Fix loop variable initializations
Date: Mon, 12 May 2008 22:27:47 +0200	[thread overview]
Message-ID: <g0a983$ltb$1@ger.gmane.org> (raw)
In-Reply-To: E1JvZ2x-0005kb-TH@hash.localnet

Thanks Bob!

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=10605

Helge


Bob Copeland wrote:

> From: Bob Copeland <me@bobcopeland.com>
> Date: Mon, 12 May 2008 09:25:33 -0400
> Subject: [PATCH] ath5k: Fix loop variable initializations
> 
> In ath5k_tasklet_rx, both status structures 'rxs' and 'rs' are
> initialized at the top of the tasklet, but not within the loop.
> If the loop is executed multiple times in the tasklet, then the
> variables may see changes from previous packets.
> 
> For TKIP, this results in 'Invalid Michael MIC' errors if two packets
> are processed in the tasklet: rxs.flag gets set to RX_DECRYPTED by
> mac80211 when it decrypts the first encrypted packet.  The subsequent
> packet will have RX_DECRYPTED set upon entry to mac80211, so mac80211
> will not try to decrypt it.
> 
> We currently initialize all but two fields in the structures, so fix
> the other two.
> 
> Signed-off-by: Bob Copeland <me@bobcopeland.com>
> ---
>  drivers/net/wireless/ath5k/base.c |    2 +-
>  drivers/net/wireless/ath5k/hw.c   |    2 ++
>  2 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath5k/base.c
> b/drivers/net/wireless/ath5k/base.c index 4e5c8fc..fd8537e 100644
> --- a/drivers/net/wireless/ath5k/base.c
> +++ b/drivers/net/wireless/ath5k/base.c
> @@ -1888,7 +1888,7 @@ accept:
>  * right now, so it's not too bad...
>  */
>  rxs.mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp);
> -             rxs.flag |= RX_FLAG_TSFT;
> +             rxs.flag = RX_FLAG_TSFT;
>  
>  rxs.freq = sc->curchan->center_freq;
>  rxs.band = sc->curband->band;
> diff --git a/drivers/net/wireless/ath5k/hw.c
> b/drivers/net/wireless/ath5k/hw.c index 5fb1ae6..8137d82 100644
> --- a/drivers/net/wireless/ath5k/hw.c
> +++ b/drivers/net/wireless/ath5k/hw.c
> @@ -4119,6 +4119,7 @@ static int ath5k_hw_proc_5210_rx_status(struct
> ath5k_hw *ah,
>  rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1,
>  AR5K_5210_RX_DESC_STATUS1_RECEIVE_TIMESTAMP);
>  rs->rs_status = 0;
> +     rs->rs_phyerr = 0;
>  
>  /*
>  * Key table status
> @@ -4193,6 +4194,7 @@ static int ath5k_hw_proc_5212_rx_status(struct
> ath5k_hw *ah,
>  rs->rs_tstamp = AR5K_REG_MS(rx_status->rx_status_1,
>  AR5K_5212_RX_DESC_STATUS1_RECEIVE_TIMESTAMP);
>  rs->rs_status = 0;
> +     rs->rs_phyerr = 0;
>  
>  /*
>  * Key table status



  reply	other threads:[~2008-05-12 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 14:30 [PATCH] ath5k: Fix loop variable initializations Bob Copeland
2008-05-12 20:27 ` Helge Deller [this message]
2008-05-12 23:18 ` Nick Kossifidis
2008-05-13  0:17   ` Bob Copeland
2008-05-13  1:16     ` Bob Copeland
2008-05-12 23:25 ` Nick Kossifidis

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='g0a983$ltb$1@ger.gmane.org' \
    --to=deller@gmx.de \
    --cc=ath5k-devel@lists.ath5k.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.