[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170302163834.2273519-8-arnd@arndb.de>
Date: Thu, 2 Mar 2017 17:38:15 +0100
From: Arnd Bergmann <arnd@...db.de>
To: kasan-dev@...glegroups.com
Cc: Andrey Ryabinin <aryabinin@...tuozzo.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-wireless@...r.kernel.org,
kernel-build-reports@...ts.linaro.org,
"David S . Miller" <davem@...emloft.net>,
Arnd Bergmann <arnd@...db.de>
Subject: [PATCH 07/26] brcmsmac: reduce stack size with KASAN
The wlc_phy_table_write_nphy/wlc_phy_table_read_nphy functions always put an object
on the stack, which will each require a redzone with KASAN and lead to possible
stack overflow:
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c: In function 'wlc_phy_workarounds_nphy':
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c:17135:1: warning: the frame size of 6312 bytes is larger than 1000 bytes [-Wframe-larger-than=]
This marks the two functions as noinline_for_kasan, avoiding the problem entirely.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
index b3aab2fe96eb..42dc8e1f483d 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c
@@ -14157,7 +14157,7 @@ static void wlc_phy_bphy_init_nphy(struct brcms_phy *pi)
write_phy_reg(pi, NPHY_TO_BPHY_OFF + BPHY_STEP, 0x668);
}
-void
+noinline_for_kasan void
wlc_phy_table_write_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
u32 width, const void *data)
{
@@ -14171,7 +14171,7 @@ wlc_phy_table_write_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
wlc_phy_write_table_nphy(pi, &tbl);
}
-void
+noinline_for_kasan void
wlc_phy_table_read_nphy(struct brcms_phy *pi, u32 id, u32 len, u32 offset,
u32 width, void *data)
{
--
2.9.0
Powered by blists - more mailing lists