nl80211: fix check for valid SSID size in scan operations
commit8220b32e2fd53d8b6afb103237a99634139769eb
authorLuciano Coelho <coelho@ti.com>
Wed, 18 May 2011 21:43:38 +0000 (19 00:43 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:05:34 +0000 (23 15:05 -0700)
tree9dce668a8aa1db98cb81b142528ba9492c1c334a
parent1605e36ae2144c97685dcfa251e4de789c2a5c76
nl80211: fix check for valid SSID size in scan operations

commit 208c72f4fe44fe09577e7975ba0e7fa0278f3d03 upstream.

In both trigger_scan and sched_scan operations, we were checking for
the SSID length before assigning the value correctly.  Since the
memory was just kzalloc'ed, the check was always failing and SSID with
over 32 characters were allowed to go through.

This was causing a buffer overflow when copying the actual SSID to the
proper place.

This bug has been there since 2.6.29-rc4.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/wireless/nl80211.c