linux/drivers/net/wireless
Daniel C Halperin 396887a2b2 iwlwifi: fix erroneous use of iwl_rx_packet.len as a length
The field called 'len' in struct iwl_rx_packet is in fact not just a length
field but also includes some flags from the flow handler.  In several places
throughout the driver, this causes incorrect values to be interpreted as
lengths when the field is improperly masked.

In most situations the improper use is for debugging output, and simply results
in an erroneous message, such as:

[551933.070224] ieee80211 phy0: I iwl_rx_statistics Statistics notification received (480 vs -1367342620).

which should read '(480 vs 484)'.

In at least one case this could case bad things to happen:

void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
                                      struct iwl_rx_mem_buffer *rxb)
{
        struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
        IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
                        "notification for %s:\n",
                        le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
        iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)
);
}
EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif);

Given the rampant misuse of this field without proper masking throughout the
driver (every use but one), this patch renames the field from 'len' to
'len_n_flags' to reduce confusion.  It also adds the proper masking when
this field is used as a length value.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-08-20 11:33:13 -04:00
..
ath ath9k: Set HW state properly 2009-08-14 09:14:09 -04:00
b43 b43: LP-PHY: Initialize TX power control 2009-08-20 11:33:08 -04:00
b43legacy b43legacy: Work around mac80211 race condition 2009-08-04 16:44:24 -04:00
hostap
ipw2x00 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
iwlwifi iwlwifi: fix erroneous use of iwl_rx_packet.len as a length 2009-08-20 11:33:13 -04:00
iwmc3200wifi Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
libertas libertas: name the network device wlan%d 2009-08-14 09:14:03 -04:00
libertas_tf
orinoco orinoco: consolidate storage of WEP and TKIP keys 2009-08-14 09:12:45 -04:00
p54 p54: implement rfkill 2009-08-14 09:13:45 -04:00
prism54
rt2x00 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-14 16:07:21 -07:00
rtl818x rtl818x: Add some documentation to the TX desc flags 2009-08-14 09:13:55 -04:00
wl12xx wl1251: remove unused definitions from wl1251_reg.h 2009-08-14 09:14:05 -04:00
zd1211rw zd1211rw: make it clear we don't use leds.h LED stuff 2009-08-14 09:12:39 -04:00
adm8211.c
adm8211.h
airo.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-07-30 19:22:43 -07:00
airo.h
airo_cs.c
arlan-main.c
arlan-proc.c
arlan.h
at76c50x-usb.c mac80211: redefine usage of the mac80211 workqueue 2009-08-04 16:44:14 -04:00
at76c50x-usb.h
atmel.c
atmel.h
atmel_cs.c
atmel_pci.c
i82586.h
i82593.h
Kconfig wireless: use menuconfig for WLAN_PRE80211 and WLAN_80211 2009-08-04 16:43:21 -04:00
mac80211_hwsim.c
Makefile
mwl8k.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
netwave_cs.c
ray_cs.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
ray_cs.h
rayctl.h
rndis_wlan.c usbnet: add rx queue pausing 2009-08-14 09:14:04 -04:00
strip.c drivers/net/wireless: Use DIV_ROUND_CLOSEST 2009-08-04 16:44:23 -04:00
wavelan.c
wavelan.h
wavelan.p.h
wavelan_cs.c Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-08-12 17:44:53 -07:00
wavelan_cs.h
wavelan_cs.p.h
wl3501.h
wl3501_cs.c
zd1201.c
zd1201.h