nl80211: fix check for valid SSID size in scan operations
commit0fc485b9d3424421d751d9631ea850a8a6c4cae0
authorLuciano Coelho <coelho@ti.com>
Wed, 18 May 2011 21:43:38 +0000 (19 00:43 +0300)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:55 +0000 (1 13:54 -0700)
treeed99608e5189674e985663aaeffcbc1a378ea9a5
parente9ca82ad156fc553d935d3e11b63b377c87f92e7
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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/wireless/nl80211.c