linux-stable/net/wireless
Johannes Berg 42da2f948d wireless extensions: fix kernel heap content leak
Wireless extensions have an unfortunate, undocumented
requirement which requires drivers to always fill
iwp->length when returning a successful status. When
a driver doesn't do this, it leads to a kernel heap
content leak when userspace offers a larger buffer
than would have been necessary.

Arguably, this is a driver bug, as it should, if it
returns 0, fill iwp->length, even if it separately
indicated that the buffer contents was not valid.

However, we can also at least avoid the memory content
leak if the driver doesn't do this by setting the iwp
length to max_tokens, which then reflects how big the
buffer is that the driver may fill, regardless of how
big the userspace buffer is.

To illustrate the point, this patch also fixes a
corresponding cfg80211 bug (since this requirement
isn't documented nor was ever pointed out by anyone
during code review, I don't trust all drivers nor
all cfg80211 handlers to implement it correctly).

Cc: stable@kernel.org [all the way back]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-08-30 16:35:17 -04:00
..
.gitignore wireless: support internal statically compiled regulatory database 2009-12-21 18:56:10 -05:00
chan.c cfg80211: don't refuse HT20 channels on devices that don't support HT40 2010-06-02 16:13:17 -04:00
core.c wireless: Convert wiphy_debug macro to function 2010-07-27 15:14:13 -04:00
core.h cfg80211: make action channel type optional 2010-06-02 16:13:27 -04:00
db.txt wireless: support internal statically compiled regulatory database 2009-12-21 18:56:10 -05:00
debugfs.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
debugfs.h cfg80211/mac80211: use debugfs_remove_recursive 2009-10-30 16:49:18 -04:00
ethtool.c cfg80211: add firmware and hardware version to wiphy 2009-10-07 16:39:46 -04:00
ethtool.h net/wireless/ethtool.h: drop unnecessary include of linux/ethtool.h 2009-10-07 16:39:49 -04:00
genregdb.awk wireless: correct sparse warning in generated regdb.c 2010-07-20 16:49:37 -04:00
ibss.c cfg80211: fix IBSS default management key 2010-07-26 15:32:41 -04:00
Kconfig wireless: remove CONFIG_WIRELESS_OLD_REGULATORY 2009-12-28 16:31:37 -05:00
lib80211.c lib80211: consolidate crypt init routines 2008-11-21 11:08:17 -05:00
lib80211_crypt_ccmp.c lib80211: remove unused host_build_iv option 2010-07-26 15:09:04 -04:00
lib80211_crypt_tkip.c lib80211: remove unused host_build_iv option 2010-07-26 15:09:04 -04:00
lib80211_crypt_wep.c lib80211: remove unused host_build_iv option 2010-07-26 15:09:04 -04:00
Makefile wireless: support internal statically compiled regulatory database 2009-12-21 18:56:10 -05:00
mlme.c cfg80211: fix locking in action frame TX 2010-08-09 15:18:57 -04:00
nl80211.c nl80211: Fix memory leaks 2010-07-28 16:24:01 -04:00
nl80211.h cfg80211: Add connection quality monitoring support to nl80211 2010-03-24 16:02:37 -04:00
radiotap.c wireless: update radiotap parser 2010-02-08 16:50:53 -05:00
reg.c cfg80211: Update of regulatory request initiator handling 2010-07-28 16:24:01 -04:00
reg.h wireless: move regulatory_init to .init.text 2010-06-18 15:11:13 -04:00
regdb.h wireless: support internal statically compiled regulatory database 2009-12-21 18:56:10 -05:00
scan.c cfg80211: don't get expired BSSes 2010-07-14 13:52:45 -04:00
sme.c wireless: mark cfg80211_is_all_idle as static 2010-07-20 16:49:38 -04:00
sysfs.c cfg80211: export multiple MAC addresses in sysfs 2010-01-22 16:11:16 -05:00
sysfs.h
util.c bridge: use rx_handler_data pointer to store net_bridge_port pointer 2010-06-15 11:48:58 -07:00
wext-compat.c wireless extensions: fix kernel heap content leak 2010-08-30 16:35:17 -04:00
wext-compat.h cfg80211: validate channel settings across interfaces 2009-08-14 09:13:42 -04:00
wext-core.c wireless extensions: fix kernel heap content leak 2010-08-30 16:35:17 -04:00
wext-priv.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
wext-proc.c net: spread __net_init, __net_exit 2010-01-17 19:16:02 -08:00
wext-sme.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2010-05-11 14:24:55 -04:00
wext-spy.c wext: refactor 2009-10-07 16:39:43 -04:00