]> git.baikalelectronics.ru Git - kernel.git/commit
libertas: Read buffer overflow
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 28 Jul 2009 10:05:00 +0000 (12:05 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 29 Jul 2009 18:52:01 +0000 (14:52 -0400)
commit74a6e8eaac0a44b0cb950486898042d2c1742286
treea8de0efe7d381f6990b73f338090574f5584f981
parentcb9c3d304a872fcdb44991da91e89d1b6e74911d
libertas: Read buffer overflow

Several arrays were read before checking whether the index was within
bounds. ARRAY_SIZE() should be used to determine the size of arrays.

rates->rates has an arraysize of 1, so calling get_common_rates()
with a rates_size of MAX_RATES (14) was causing reads out of bounds.

tmp_size can increment at most to (ARRAY_SIZE(lbs_bg_rates) - 1) *
(*rates_size - 1), so that should be the number of elements of tmp[].

A goto can be eliminated: ret was already set upon its declaration.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/assoc.c