linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: Ivo van Doorn <IvDoorn@gmail.com>,
	<linux-wireless@vger.kernel.org>, <users@rt2x00.serialmonkey.com>,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci.
Date: Tue, 11 May 2010 23:51:38 +0200	[thread overview]
Message-ID: <1273614705-25118-3-git-send-email-gwingerde@gmail.com> (raw)
In-Reply-To: <1273614705-25118-1-git-send-email-gwingerde@gmail.com>

The buffer address descriptor word is not part of the TXINFO structure
needed for beacons. The current writing of that word for beacons is
therefore an out-of-bounds write.
Fix this by only writing the buffer address descriptor word for TX
queues.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
---
 drivers/net/wireless/rt2x00/rt61pci.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 2436363..99c2981 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1801,12 +1801,12 @@ static void rt61pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
 	rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1);
 	rt2x00_desc_write(txd, 5, word);
 
-	rt2x00_desc_read(txd, 6, &word);
-	rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
-			   skbdesc->skb_dma);
-	rt2x00_desc_write(txd, 6, word);
+	if (txdesc->queue != QID_BEACON) {
+		rt2x00_desc_read(txd, 6, &word);
+		rt2x00_set_field32(&word, TXD_W6_BUFFER_PHYSICAL_ADDRESS,
+				   skbdesc->skb_dma);
+		rt2x00_desc_write(txd, 6, word);
 
-	if (skbdesc->desc_len > TXINFO_SIZE) {
 		rt2x00_desc_read(txd, 11, &word);
 		rt2x00_set_field32(&word, TXD_W11_BUFFER_LENGTH0,
 				   txdesc->length);
-- 
1.7.1


  parent reply	other threads:[~2010-05-11 21:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 21:51 [PATCH 0/9] rt2x00: Further fixes and cleanups Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 1/9] rt2x00: Consistently name skb frame descriptor skbdesc Gertjan van Wingerde
2010-05-12  6:59   ` Ivo Van Doorn
2010-05-11 21:51 ` Gertjan van Wingerde [this message]
2010-05-12  6:59   ` [PATCH 2/9] rt2x00: Fix beacon descriptor writing for rt61pci Ivo Van Doorn
2010-05-12  9:46     ` Gertjan van Wingerde
2010-05-12 17:43       ` Ivo Van Doorn
2010-05-12 18:42         ` Gertjan van Wingerde
2010-05-12 18:46           ` Ivo Van Doorn
2010-05-12 18:47   ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 3/9] rt2x00: Re-order tx descriptor writing code in drivers Gertjan van Wingerde
2010-05-12  7:00   ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 4/9] rt2x00: Simplify TXD handling of beacons Gertjan van Wingerde
2010-05-12  7:11   ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 5/9] rt2x00: Dump beacons under a different identifier than TX frames Gertjan van Wingerde
2010-05-12  7:00   ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 6/9] rt2x00: Push beacon TX descriptor writing to drivers Gertjan van Wingerde
2010-05-12  7:06   ` Ivo Van Doorn
2010-05-12  9:53     ` Gertjan van Wingerde
2010-05-12 17:45       ` Ivo Van Doorn
2010-05-12 19:03         ` Gertjan van Wingerde
2010-05-12 19:10           ` Ivo Van Doorn
2010-05-12 19:22             ` Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 7/9] rt2x00: In debugfs frame dumping allow the TX descriptor to be part of the skb Gertjan van Wingerde
2010-05-12  7:12   ` Ivo Van Doorn
2010-05-11 21:51 ` [PATCH 8/9] rt2x00: Reverse calling order of bus write_tx_desc and driver write_tx_desc Gertjan van Wingerde
2010-05-12  7:02   ` Ivo Van Doorn
2010-05-12  9:55     ` Gertjan van Wingerde
2010-05-12 17:47       ` Ivo Van Doorn
2010-05-12 19:02         ` Gertjan van Wingerde
2010-05-11 21:51 ` [PATCH 9/9] rt2x00: Properly reserve room for descriptors in skbs Gertjan van Wingerde
2010-05-12  7:08   ` Ivo Van Doorn

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=1273614705-25118-3-git-send-email-gwingerde@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=IvDoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.com \
    /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).