mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types
@ 2015-05-28 15:03 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2015-05-28 15:03 UTC (permalink / raw)
  To: johnny.kim, rachel.kim, dean.lee, chris.park, nicolas.ferre
  Cc: gregkh, devel, linux-kernel, Sasha Levin

NL80211_IFTYPE_MAX represents the largest interface type number defined,
so declaring the array with that size will actually leave out the last
interface.

This causes invalid memory access whenever this array is used, which starts
happening at boot.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 9eb8f37..3a63fbd 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -82,7 +82,7 @@ static const u32 cipher_suites[] = {
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
 static const struct ieee80211_txrx_stypes
-	wilc_wfi_cfg80211_mgmt_types[NL80211_IFTYPE_MAX] = {
+	wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = {
 	[NL80211_IFTYPE_STATION] = {
 		.tx = 0xffff,
 		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
-- 
1.7.10.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-28 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-28 15:03 [PATCH] staging: wilc1000: off by one in wilc_wfi_cfg80211_mgmt_types Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®