Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1591308

[PATCH 07/26] brcmsmac: reduce stack size with KASAN

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH 07/26] brcmsmac: reduce stack size with KASAN
Date 2017-03-02 18:20 +0100
Message-ID <tgCyv-5uu-31@gated-at.bofh.it> (permalink)
References <tgCf7-56J-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@arndb.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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/26] bring back stack frame warning with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
    Re: [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-06 10:50 +0100
      Re: [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-06 12:00 +0100
        Re: [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-06 12:20 +0100
          Re: [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-06 12:20 +0100
            Re: [PATCH 07/26] brcmsmac: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-06 12:40 +0100
  [PATCH 15/26] [media] tuners: i2c: reduce stack usage for tuner_i2c_xfer_* Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 11/26] rtlwifi: reduce stack usage for KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 04/26] tty: kbd: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 12/26] wl3501_cs: reduce stack size for KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 09/26] brcmsmac: split up wlc_phy_workarounds_nphy Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
    Re: [PATCH 09/26] brcmsmac: split up wlc_phy_workarounds_nphy Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-06 10:40 +0100
  [PATCH 01/26] compiler: introduce noinline_for_kasan annotation Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
    Re: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation Alexander Potapenko <glider@google.com> - 2017-03-03 15:00 +0100
      Re: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation Alexander Potapenko <glider@google.com> - 2017-03-03 15:40 +0100
        Re: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation Arnd Bergmann <arnd@arndb.de> - 2017-03-03 16:10 +0100
      Re: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation Arnd Bergmann <arnd@arndb.de> - 2017-03-03 15:40 +0100
    RE: [PATCH 01/26] compiler: introduce noinline_for_kasan annotation David Laight <David.Laight@ACULAB.COM> - 2017-03-03 18:10 +0100
  [PATCH 05/26] netlink: mark nla_put_{u8,u16,u32} noinline_for_kasan Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
  [PATCH 08/26] brcmsmac: make some local variables 'static const' to reduce stack size Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:20 +0100
    Re: [PATCH 08/26] brcmsmac: make some local variables 'static const'  to reduce stack size Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-06 10:40 +0100
      Re: [PATCH 08/26] brcmsmac: make some local variables 'static const' to reduce stack size Kalle Valo <kvalo@codeaurora.org> - 2017-03-06 17:40 +0100
        Re: [PATCH 08/26] brcmsmac: make some local variables 'static const'  to reduce stack size Arnd Bergmann <arnd@arndb.de> - 2017-03-06 22:40 +0100
          Re: [PATCH 08/26] brcmsmac: make some local variables 'static const' to reduce stack size Kalle Valo <kvalo@codeaurora.org> - 2017-03-07 10:50 +0100
            Re: [PATCH 08/26] brcmsmac: make some local variables 'static const'  to reduce stack size Arend Van Spriel <arend.vanspriel@broadcom.com> - 2017-03-07 11:10 +0100
  [PATCH 22/26] drm/i915/gvt: don't overflow the kernel stack with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 18:40 +0100
  Re: [PATCH 24/26] ocfs2: reduce stack size with KASAN Joe Perches <joe@perches.com> - 2017-03-02 19:00 +0100
    Re: [PATCH 24/26] ocfs2: reduce stack size with KASAN Joe Perches <joe@perches.com> - 2017-03-02 23:50 +0100
      Re: [PATCH 24/26] ocfs2: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-03 00:10 +0100
        Re: [PATCH 24/26] ocfs2: reduce stack size with KASAN Joe Perches <joe@perches.com> - 2017-03-03 01:00 +0100
    Re: [PATCH 24/26] ocfs2: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-03 00:00 +0100
  [PATCH 24/26] ocfs2: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 20:10 +0100
  [PATCH 23/26] mtd: cfi: reduce stack size with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 20:20 +0100
  [PATCH 18/26] [media] i2c: cx25840: avoid stack overflow with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-02 23:30 +0100
  Re: [PATCH 00/26] bring back stack frame warning with KASAN Alexander Potapenko <glider@google.com> - 2017-03-03 13:30 +0100
    Re: [PATCH 00/26] bring back stack frame warning with KASAN Arnd Bergmann <arnd@arndb.de> - 2017-03-03 14:00 +0100
  Re: [PATCH 10/26] brcmsmac: reindent split functions Kalle Valo <kvalo@codeaurora.org> - 2017-03-06 17:50 +0100

csiph-web