]> git.baikalelectronics.ru Git - kernel.git/commit
wl12xx: don't write out of bounds when hlid > WL12XX_MAX_LINKS
authorLuciano Coelho <coelho@ti.com>
Tue, 13 Dec 2011 09:39:02 +0000 (11:39 +0200)
committerLuciano Coelho <coelho@ti.com>
Thu, 15 Dec 2011 07:58:41 +0000 (09:58 +0200)
commit87eeaabd2e8ac85405eb1ab77dd2ab2afbbd22cf
treee2374f0aa4635694bf9d55e00d93e88e4dcb33b8
parent7cb57226f42795476609eda059f36f7f8fe6f49b
wl12xx: don't write out of bounds when hlid > WL12XX_MAX_LINKS

We should not get an hlid value bigger than WL12XX_MAX_LINKS from
wl1271_rx_handle_data().  We have a WARN_ON in case it happens.  But
despite the warning, we would still go ahead and write the hlid bit
into active_hlids (a stack variable).  This would cause us to
overwrite other data in the stack.

To avoid this problem, we now skip the write when issuing the warning,
so at least we don't corrupt data.

Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/rx.c