]> git.karo-electronics.de Git - karo-tx-linux.git/commit
nl80211: fix overflow in ssid_len
authorLuciano Coelho <coelho@ti.com>
Tue, 7 Jun 2011 17:42:26 +0000 (20:42 +0300)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:34:57 +0000 (15:34 -0400)
commit075c4ced91c551cdc2e9bb99b1697c3d54be106e
treea1e925490e6626fa77447d96786b05caf3dd9cdd
parentc88f1d0ac1138655c607b21d4eb7f2d45013ffc8
nl80211: fix overflow in ssid_len

commit 57a27e1d6a3bb9ad4efeebd3a8c71156d6207536 upstream.

When one of the SSID's length passed in a scan or sched_scan request
is larger than 255, there will be an overflow in the u8 that is used
to store the length before checking.  This causes the check to fail
and we overrun the buffer when copying the SSID.

Fix this by checking the nl80211 attribute length before copying it to
the struct.

This is a follow up for the previous commit
208c72f4fe44fe09577e7975ba0e7fa0278f3d03, which didn't fix the problem
entirely.

Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
[PG: 34 codebase does not have nl80211_start_sched_scan part]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/wireless/nl80211.c