linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fix bug in computing crc over dynamic IEs in beacon
@ 2009-12-04 12:11 Vasanthakumar Thiagarajan
  2009-12-04 12:29 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2009-12-04 12:11 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless, Vasanthakumar Thiagarajan, stable

On a 32-bit machine, BIT() macro does not give the required
bit value if the bit is mroe than 31. In ieee802_11_parse_elems_crc(),
BIT() is suppossed to get the bit value more than 31 (42 (id of ERP_INFO_IE),
37 (CHANNEL_SWITCH_IE), (42), 32 (POWER_CONSTRAINT_IE), 45 (HT_CAP_IE),
61 (HT_INFO_IE)). As we do not get the required bit value for the above
IEs, crc over these IEs are never calculated, so any dynamic change in these
IEs after the association is not really handled on 32-bit platforms.
This patch fixes this issue.

Cc: stable@kernel.org
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 net/mac80211/util.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index d09f78b..78a6e92 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -579,7 +579,7 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len,
 		if (elen > left)
 			break;
 
-		if (calc_crc && id < 64 && (filter & BIT(id)))
+		if (calc_crc && id < 64 && (filter & (1ULL << id)))
 			crc = crc32_be(crc, pos - 2, elen + 2);
 
 		switch (id) {
-- 
1.5.5.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Fix bug in computing crc over dynamic IEs in beacon
  2009-12-04 12:11 [PATCH] mac80211: Fix bug in computing crc over dynamic IEs in beacon Vasanthakumar Thiagarajan
@ 2009-12-04 12:29 ` Johannes Berg
  2009-12-04 12:42   ` Vasanthakumar Thiagarajan
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2009-12-04 12:29 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linville, linux-wireless, stable

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

On Fri, 2009-12-04 at 17:41 +0530, Vasanthakumar Thiagarajan wrote:
> On a 32-bit machine, BIT() macro does not give the required
> bit value if the bit is mroe than 31. 

For some reason I thought it did, thanks.

> In ieee802_11_parse_elems_crc(),
> BIT() is suppossed to get the bit value more than 31 (42 (id of ERP_INFO_IE),
> 37 (CHANNEL_SWITCH_IE), (42), 32 (POWER_CONSTRAINT_IE), 45 (HT_CAP_IE),
> 61 (HT_INFO_IE)). As we do not get the required bit value for the above
> IEs, crc over these IEs are never calculated, so any dynamic change in these
> IEs after the association is not really handled on 32-bit platforms.
> This patch fixes this issue.

Right. Note that this function may need to be changed/extended if we
ever need to watch for changes in even higher IEs, but so far we don't.

johannes


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mac80211: Fix bug in computing crc over dynamic IEs in beacon
  2009-12-04 12:29 ` Johannes Berg
@ 2009-12-04 12:42   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2009-12-04 12:42 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vasanth Thiagarajan, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, stable@kernel.org

On Fri, Dec 04, 2009 at 05:59:58PM +0530, Johannes Berg wrote:
> > In ieee802_11_parse_elems_crc(),
> > BIT() is suppossed to get the bit value more than 31 (42 (id of ERP_INFO_IE),
> > 37 (CHANNEL_SWITCH_IE), (42), 32 (POWER_CONSTRAINT_IE), 45 (HT_CAP_IE),
> > 61 (HT_INFO_IE)). As we do not get the required bit value for the above
> > IEs, crc over these IEs are never calculated, so any dynamic change in these
> > IEs after the association is not really handled on 32-bit platforms.
> > This patch fixes this issue.
> 
> Right. Note that this function may need to be changed/extended if we
> ever need to watch for changes in even higher IEs, but so far we don't.

Yeah, currently we do only for the IEs whose ids are < 64.

Thanks,

Vasanth


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-04 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-04 12:11 [PATCH] mac80211: Fix bug in computing crc over dynamic IEs in beacon Vasanthakumar Thiagarajan
2009-12-04 12:29 ` Johannes Berg
2009-12-04 12:42   ` Vasanthakumar Thiagarajan

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).