* [PATCH 21/26] drm/bridge: ps8622: reduce stack size for KASAN
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
When CONFIG_KASAN is set, each call to ps8622_set() adds an object to the
stack frame, leading to a warning about possible stack overflow:
drivers/gpu/drm/bridge/parade-ps8622.c: In function 'ps8622_send_config':
drivers/gpu/drm/bridge/parade-ps8622.c:338:1: error: the frame size of 5872 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
Marking this as noinline_for_kasan completely avoids the problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpu/drm/bridge/parade-ps8622.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/parade-ps8622.c b/drivers/gpu/drm/bridge/parade-ps8622.c
index ac8cc5b50d9f..6b995edd2a46 100644
--- a/drivers/gpu/drm/bridge/parade-ps8622.c
+++ b/drivers/gpu/drm/bridge/parade-ps8622.c
@@ -79,7 +79,7 @@ static inline struct ps8622_bridge *
return container_of(connector, struct ps8622_bridge, connector);
}
-static int ps8622_set(struct i2c_client *client, u8 page, u8 reg, u8 val)
+static noinline_for_kasan int ps8622_set(struct i2c_client *client, u8 page, u8 reg, u8 val)
{
int ret;
struct i2c_adapter *adap = client->adapter;
--
2.9.0
^ permalink raw reply related
* [PATCH 13/26] rtl8180: reduce stack size for KASAN
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
When CONFIG_KASAN is set, we see overly large stack frames from inlining
functions with local variables:
drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c: In function 'rtl8225se_rf_init':
drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c:431:1: warning: the frame size of 4384 bytes is larger than 3072 bytes [-Wframe-larger-than=]
This marks them noinline_for_kasan.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c
index fde89866fa8d..1efa098a2e32 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/rtl8225se.c
@@ -174,14 +174,14 @@ static void rtl8187se_three_wire_io(struct ieee80211_hw *dev, u8 *data,
} while (0);
}
-static u32 rtl8187se_rf_readreg(struct ieee80211_hw *dev, u8 addr)
+static noinline_for_kasan u32 rtl8187se_rf_readreg(struct ieee80211_hw *dev, u8 addr)
{
u32 dataread = addr & 0x0F;
rtl8187se_three_wire_io(dev, (u8 *)&dataread, 16, 0);
return dataread;
}
-static void rtl8187se_rf_writereg(struct ieee80211_hw *dev, u8 addr, u32 data)
+static noinline_for_kasan void rtl8187se_rf_writereg(struct ieee80211_hw *dev, u8 addr, u32 data)
{
u32 outdata = (data << 4) | (u32)(addr & 0x0F);
rtl8187se_three_wire_io(dev, (u8 *)&outdata, 16, 1);
--
2.9.0
^ permalink raw reply related
* [PATCH 14/26] [media] dvb-frontends: reduce stack size in i2c access
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
A typical code fragment was copied across many dvb-frontend
drivers and causes large stack frames when built with
-fsanitize-address-use-after-scope, e.g.
drivers/media/dvb-frontends/cxd2841er.c:3225:1: error: the frame size of 3992 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/cxd2841er.c:3404:1: error: the frame size of 3136 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv0367.c:3143:1: error: the frame size of 4016 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv090x.c:3430:1: error: the frame size of 5312 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
drivers/media/dvb-frontends/stv090x.c:4248:1: error: the frame size of 4872 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
By marking the register access functions as noinline_for_kasan,
we can completely avoid this problem.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/dvb-frontends/ascot2e.c | 3 ++-
drivers/media/dvb-frontends/cxd2841er.c | 4 ++--
drivers/media/dvb-frontends/drx39xyj/drxj.c | 14 +++++++-------
drivers/media/dvb-frontends/helene.c | 4 ++--
drivers/media/dvb-frontends/horus3a.c | 2 +-
drivers/media/dvb-frontends/itd1000.c | 2 +-
drivers/media/dvb-frontends/mt312.c | 2 +-
drivers/media/dvb-frontends/si2165.c | 14 +++++++-------
drivers/media/dvb-frontends/stb0899_drv.c | 2 +-
drivers/media/dvb-frontends/stb6100.c | 2 +-
drivers/media/dvb-frontends/stv0367.c | 2 +-
drivers/media/dvb-frontends/stv090x.c | 2 +-
drivers/media/dvb-frontends/stv6110.c | 2 +-
drivers/media/dvb-frontends/stv6110x.c | 2 +-
drivers/media/dvb-frontends/tda8083.c | 2 +-
drivers/media/dvb-frontends/zl10039.c | 2 +-
16 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/drivers/media/dvb-frontends/ascot2e.c b/drivers/media/dvb-frontends/ascot2e.c
index 0ee0df53b91b..435eb4d3f3ef 100644
--- a/drivers/media/dvb-frontends/ascot2e.c
+++ b/drivers/media/dvb-frontends/ascot2e.c
@@ -153,7 +153,8 @@ static int ascot2e_write_regs(struct ascot2e_priv *priv,
return 0;
}
-static int ascot2e_write_reg(struct ascot2e_priv *priv, u8 reg, u8 val)
+static noinline_for_kasan int ascot2e_write_reg(struct ascot2e_priv *priv,
+ u8 reg, u8 val)
{
return ascot2e_write_regs(priv, reg, &val, 1);
}
diff --git a/drivers/media/dvb-frontends/cxd2841er.c b/drivers/media/dvb-frontends/cxd2841er.c
index 614bfb3740f1..01f7ec4d42c1 100644
--- a/drivers/media/dvb-frontends/cxd2841er.c
+++ b/drivers/media/dvb-frontends/cxd2841er.c
@@ -258,7 +258,7 @@ static int cxd2841er_write_regs(struct cxd2841er_priv *priv,
return 0;
}
-static int cxd2841er_write_reg(struct cxd2841er_priv *priv,
+static noinline_for_kasan int cxd2841er_write_reg(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 val)
{
return cxd2841er_write_regs(priv, addr, reg, &val, 1);
@@ -306,7 +306,7 @@ static int cxd2841er_read_regs(struct cxd2841er_priv *priv,
return 0;
}
-static int cxd2841er_read_reg(struct cxd2841er_priv *priv,
+static noinline_for_kasan int cxd2841er_read_reg(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 *val)
{
return cxd2841er_read_regs(priv, addr, reg, val, 1);
diff --git a/drivers/media/dvb-frontends/drx39xyj/drxj.c b/drivers/media/dvb-frontends/drx39xyj/drxj.c
index daeaf965dd56..0e6540709e09 100644
--- a/drivers/media/dvb-frontends/drx39xyj/drxj.c
+++ b/drivers/media/dvb-frontends/drx39xyj/drxj.c
@@ -1516,7 +1516,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
*
******************************/
-static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
+static noinline_for_kasan int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
u32 addr,
u16 *data, u32 flags)
{
@@ -1549,7 +1549,7 @@ static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
*
******************************/
-static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
+static noinline_for_kasan int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
u32 addr,
u32 *data, u32 flags)
{
@@ -1722,7 +1722,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
*
******************************/
-static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
+static noinline_for_kasan int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
u32 addr,
u16 data, u32 flags)
{
@@ -1795,7 +1795,7 @@ static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
*
******************************/
-static int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,
+static noinline_for_kasan int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,
u32 addr,
u32 data, u32 flags)
{
@@ -2172,7 +2172,7 @@ int drxj_dap_atomic_read_write_block(struct i2c_device_addr *dev_addr,
* \fn int drxj_dap_atomic_read_reg32()
* \brief Atomic read of 32 bits words
*/
-static
+static noinline_for_kasan
int drxj_dap_atomic_read_reg32(struct i2c_device_addr *dev_addr,
u32 addr,
u32 *data, u32 flags)
@@ -4191,7 +4191,7 @@ int drxj_dap_scu_atomic_read_write_block(struct i2c_device_addr *dev_addr, u32 a
* \fn int DRXJ_DAP_AtomicReadReg16()
* \brief Atomic read of 16 bits words
*/
-static
+static noinline_for_kasan
int drxj_dap_scu_atomic_read_reg16(struct i2c_device_addr *dev_addr,
u32 addr,
u16 *data, u32 flags)
@@ -4219,7 +4219,7 @@ int drxj_dap_scu_atomic_read_reg16(struct i2c_device_addr *dev_addr,
* \fn int drxj_dap_scu_atomic_write_reg16()
* \brief Atomic read of 16 bits words
*/
-static
+static noinline_for_kasan
int drxj_dap_scu_atomic_write_reg16(struct i2c_device_addr *dev_addr,
u32 addr,
u16 data, u32 flags)
diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c
index 4bf5a551ba40..d984dfc392f0 100644
--- a/drivers/media/dvb-frontends/helene.c
+++ b/drivers/media/dvb-frontends/helene.c
@@ -329,7 +329,7 @@ static int helene_write_regs(struct helene_priv *priv,
return 0;
}
-static int helene_write_reg(struct helene_priv *priv, u8 reg, u8 val)
+static noinline_for_kasan int helene_write_reg(struct helene_priv *priv, u8 reg, u8 val)
{
return helene_write_regs(priv, reg, &val, 1);
}
@@ -374,7 +374,7 @@ static int helene_read_regs(struct helene_priv *priv,
return 0;
}
-static int helene_read_reg(struct helene_priv *priv, u8 reg, u8 *val)
+static noinline_for_kasan int helene_read_reg(struct helene_priv *priv, u8 reg, u8 *val)
{
return helene_read_regs(priv, reg, val, 1);
}
diff --git a/drivers/media/dvb-frontends/horus3a.c b/drivers/media/dvb-frontends/horus3a.c
index 94bb4f7a2298..9dc6662073a7 100644
--- a/drivers/media/dvb-frontends/horus3a.c
+++ b/drivers/media/dvb-frontends/horus3a.c
@@ -87,7 +87,7 @@ static int horus3a_write_regs(struct horus3a_priv *priv,
return 0;
}
-static int horus3a_write_reg(struct horus3a_priv *priv, u8 reg, u8 val)
+static noinline_for_kasan int horus3a_write_reg(struct horus3a_priv *priv, u8 reg, u8 val)
{
return horus3a_write_regs(priv, reg, &val, 1);
}
diff --git a/drivers/media/dvb-frontends/itd1000.c b/drivers/media/dvb-frontends/itd1000.c
index 5bb1e73a10b4..ae0b19c65b9f 100644
--- a/drivers/media/dvb-frontends/itd1000.c
+++ b/drivers/media/dvb-frontends/itd1000.c
@@ -93,7 +93,7 @@ static int itd1000_read_reg(struct itd1000_state *state, u8 reg)
return val;
}
-static inline int itd1000_write_reg(struct itd1000_state *state, u8 r, u8 v)
+static noinline_for_kasan int itd1000_write_reg(struct itd1000_state *state, u8 r, u8 v)
{
int ret = itd1000_write_regs(state, r, &v, 1);
state->shadow[r] = v;
diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c
index 961b9a2508e0..a41d2c719aac 100644
--- a/drivers/media/dvb-frontends/mt312.c
+++ b/drivers/media/dvb-frontends/mt312.c
@@ -139,7 +139,7 @@ static inline int mt312_readreg(struct mt312_state *state,
return mt312_read(state, reg, val, 1);
}
-static inline int mt312_writereg(struct mt312_state *state,
+static noinline_for_kasan int mt312_writereg(struct mt312_state *state,
const enum mt312_reg_addr reg, const u8 val)
{
return mt312_write(state, reg, &val, 1);
diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c
index 528b82a5dd46..1a0997e1db4a 100644
--- a/drivers/media/dvb-frontends/si2165.c
+++ b/drivers/media/dvb-frontends/si2165.c
@@ -140,7 +140,7 @@ static int si2165_read(struct si2165_state *state,
return 0;
}
-static int si2165_readreg8(struct si2165_state *state,
+static noinline_for_kasan int si2165_readreg8(struct si2165_state *state,
const u16 reg, u8 *val)
{
unsigned int val_tmp;
@@ -150,7 +150,7 @@ static int si2165_readreg8(struct si2165_state *state,
return ret;
}
-static int si2165_readreg16(struct si2165_state *state,
+static noinline_for_kasan int si2165_readreg16(struct si2165_state *state,
const u16 reg, u16 *val)
{
u8 buf[2];
@@ -161,26 +161,26 @@ static int si2165_readreg16(struct si2165_state *state,
return ret;
}
-static int si2165_writereg8(struct si2165_state *state, const u16 reg, u8 val)
+static noinline_for_kasan int si2165_writereg8(struct si2165_state *state, const u16 reg, u8 val)
{
return regmap_write(state->regmap, reg, val);
}
-static int si2165_writereg16(struct si2165_state *state, const u16 reg, u16 val)
+static noinline_for_kasan int si2165_writereg16(struct si2165_state *state, const u16 reg, u16 val)
{
u8 buf[2] = { val & 0xff, (val >> 8) & 0xff };
return si2165_write(state, reg, buf, 2);
}
-static int si2165_writereg24(struct si2165_state *state, const u16 reg, u32 val)
+static noinline_for_kasan int si2165_writereg24(struct si2165_state *state, const u16 reg, u32 val)
{
u8 buf[3] = { val & 0xff, (val >> 8) & 0xff, (val >> 16) & 0xff };
return si2165_write(state, reg, buf, 3);
}
-static int si2165_writereg32(struct si2165_state *state, const u16 reg, u32 val)
+static noinline_for_kasan int si2165_writereg32(struct si2165_state *state, const u16 reg, u32 val)
{
u8 buf[4] = {
val & 0xff,
@@ -191,7 +191,7 @@ static int si2165_writereg32(struct si2165_state *state, const u16 reg, u32 val)
return si2165_write(state, reg, buf, 4);
}
-static int si2165_writereg_mask8(struct si2165_state *state, const u16 reg,
+static noinline_for_kasan int si2165_writereg_mask8(struct si2165_state *state, const u16 reg,
u8 val, u8 mask)
{
if (mask != 0xff) {
diff --git a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c
index 02347598277a..f638950f1478 100644
--- a/drivers/media/dvb-frontends/stb0899_drv.c
+++ b/drivers/media/dvb-frontends/stb0899_drv.c
@@ -537,7 +537,7 @@ int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data,
return 0;
}
-int stb0899_write_reg(struct stb0899_state *state, unsigned int reg, u8 data)
+noinline_for_kasan int stb0899_write_reg(struct stb0899_state *state, unsigned int reg, u8 data)
{
return stb0899_write_regs(state, reg, &data, 1);
}
diff --git a/drivers/media/dvb-frontends/stb6100.c b/drivers/media/dvb-frontends/stb6100.c
index 17a955d0031b..2fd6378ebd9a 100644
--- a/drivers/media/dvb-frontends/stb6100.c
+++ b/drivers/media/dvb-frontends/stb6100.c
@@ -224,7 +224,7 @@ static int stb6100_write_reg_range(struct stb6100_state *state, u8 buf[], int st
return 0;
}
-static int stb6100_write_reg(struct stb6100_state *state, u8 reg, u8 data)
+static noinline_for_kasan int stb6100_write_reg(struct stb6100_state *state, u8 reg, u8 data)
{
if (unlikely(reg >= STB6100_NUMREGS)) {
dprintk(verbose, FE_ERROR, 1, "Invalid register offset 0x%x", reg);
diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c
index fd49c436a36d..dc7c1e596d29 100644
--- a/drivers/media/dvb-frontends/stv0367.c
+++ b/drivers/media/dvb-frontends/stv0367.c
@@ -798,7 +798,7 @@ int stv0367_writeregs(struct stv0367_state *state, u16 reg, u8 *data, int len)
return (ret != 1) ? -EREMOTEIO : 0;
}
-static int stv0367_writereg(struct stv0367_state *state, u16 reg, u8 data)
+static noinline_for_kasan int stv0367_writereg(struct stv0367_state *state, u16 reg, u8 data)
{
return stv0367_writeregs(state, reg, &data, 1);
}
diff --git a/drivers/media/dvb-frontends/stv090x.c b/drivers/media/dvb-frontends/stv090x.c
index 7ef469c0c866..236325ae2580 100644
--- a/drivers/media/dvb-frontends/stv090x.c
+++ b/drivers/media/dvb-frontends/stv090x.c
@@ -753,7 +753,7 @@ static int stv090x_write_regs(struct stv090x_state *state, unsigned int reg, u8
return 0;
}
-static int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8 data)
+static noinline_for_kasan int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8 data)
{
return stv090x_write_regs(state, reg, &data, 1);
}
diff --git a/drivers/media/dvb-frontends/stv6110.c b/drivers/media/dvb-frontends/stv6110.c
index e4fd9c1b0560..34677f7327d5 100644
--- a/drivers/media/dvb-frontends/stv6110.c
+++ b/drivers/media/dvb-frontends/stv6110.c
@@ -137,7 +137,7 @@ static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[],
return 0;
}
-static int stv6110_read_reg(struct dvb_frontend *fe, int start)
+static noinline_for_kasan int stv6110_read_reg(struct dvb_frontend *fe, int start)
{
u8 buf[] = { 0 };
stv6110_read_regs(fe, buf, start, 1);
diff --git a/drivers/media/dvb-frontends/stv6110x.c b/drivers/media/dvb-frontends/stv6110x.c
index 66eba38f1014..b8e3c5ac06e2 100644
--- a/drivers/media/dvb-frontends/stv6110x.c
+++ b/drivers/media/dvb-frontends/stv6110x.c
@@ -95,7 +95,7 @@ static int stv6110x_write_regs(struct stv6110x_state *stv6110x, int start, u8 da
return 0;
}
-static int stv6110x_write_reg(struct stv6110x_state *stv6110x, u8 reg, u8 data)
+static noinline_for_kasan int stv6110x_write_reg(struct stv6110x_state *stv6110x, u8 reg, u8 data)
{
return stv6110x_write_regs(stv6110x, reg, &data, 1);
}
diff --git a/drivers/media/dvb-frontends/tda8083.c b/drivers/media/dvb-frontends/tda8083.c
index aa3200d3c352..26732db739a5 100644
--- a/drivers/media/dvb-frontends/tda8083.c
+++ b/drivers/media/dvb-frontends/tda8083.c
@@ -88,7 +88,7 @@ static int tda8083_readregs (struct tda8083_state* state, u8 reg1, u8 *b, u8 len
return ret == 2 ? 0 : -1;
}
-static inline u8 tda8083_readreg (struct tda8083_state* state, u8 reg)
+static noinline_for_kasan u8 tda8083_readreg (struct tda8083_state* state, u8 reg)
{
u8 val;
diff --git a/drivers/media/dvb-frontends/zl10039.c b/drivers/media/dvb-frontends/zl10039.c
index 623355fc2666..713da9e02700 100644
--- a/drivers/media/dvb-frontends/zl10039.c
+++ b/drivers/media/dvb-frontends/zl10039.c
@@ -130,7 +130,7 @@ static inline int zl10039_readreg(struct zl10039_state *state,
return zl10039_read(state, reg, val, 1);
}
-static inline int zl10039_writereg(struct zl10039_state *state,
+static noinline_for_kasan int zl10039_writereg(struct zl10039_state *state,
const enum zl10039_reg_addr reg,
const u8 val)
{
--
2.9.0
^ permalink raw reply related
* [PATCH 02/26] rewrite READ_ONCE/WRITE_ONCE
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann, Christian Borntraeger,
Paul McKenney
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
When CONFIG_KASAN is enabled, the READ_ONCE/WRITE_ONCE macros cause
rather large kernel stacks, e.g.:
mm/vmscan.c: In function 'shrink_page_list':
mm/vmscan.c:1333:1: error: the frame size of 3456 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
block/cfq-iosched.c: In function 'cfqg_stats_add_aux':
block/cfq-iosched.c:750:1: error: the frame size of 4048 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
fs/btrfs/disk-io.c: In function 'open_ctree':
fs/btrfs/disk-io.c:3314:1: error: the frame size of 3136 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
fs/btrfs/relocation.c: In function 'build_backref_tree':
fs/btrfs/relocation.c:1193:1: error: the frame size of 4336 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
fs/fscache/stats.c: In function 'fscache_stats_show':
fs/fscache/stats.c:287:1: error: the frame size of 6512 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
fs/jbd2/commit.c: In function 'jbd2_journal_commit_transaction':
fs/jbd2/commit.c:1139:1: error: the frame size of 3760 bytes is larger than 3072 bytes [-Werror=frame-larger-than=]
This attempts a rewrite of the two macros, using a simpler implementation
for the most common case of having a naturally aligned 1, 2, 4, or (on
64-bit architectures) 8 byte object that can be accessed with a single
instruction. For these, we go back to a volatile pointer dereference
that we had with the ACCESS_ONCE macro.
READ_ONCE/WRITE_ONCE also try to handle unaligned objects and objects
of other sizes by forcing either a word-size access (which may trap
on some architectures) or doing a non-atomic memcpy. I could not figure
out what these are actually used for, but they appear to be done
intentionally, so I'm leaving that code untouched.
I had to fix up a couple of files that either use WRITE_ONCE() as an
implicit typecast, or ignore the result of READ_ONCE(). In all cases,
the modified code seems no worse to me than the original.
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/x86/include/asm/switch_to.h | 2 +-
fs/overlayfs/util.c | 6 ++---
include/linux/compiler.h | 47 ++++++++++++++++++++++++++++++++--------
3 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
index fcc5cd387fd1..0c243dd569fe 100644
--- a/arch/x86/include/asm/switch_to.h
+++ b/arch/x86/include/asm/switch_to.h
@@ -30,7 +30,7 @@ static inline void prepare_switch_to(struct task_struct *prev,
*
* To minimize cache pollution, just follow the stack pointer.
*/
- READ_ONCE(*(unsigned char *)next->thread.sp);
+ (void)READ_ONCE(*(unsigned char *)next->thread.sp);
#endif
}
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c
index 952286f4826c..1c10632a48bb 100644
--- a/fs/overlayfs/util.c
+++ b/fs/overlayfs/util.c
@@ -222,8 +222,8 @@ void ovl_dentry_update(struct dentry *dentry, struct dentry *upperdentry)
void ovl_inode_init(struct inode *inode, struct inode *realinode, bool is_upper)
{
- WRITE_ONCE(inode->i_private, (unsigned long) realinode |
- (is_upper ? OVL_ISUPPER_MASK : 0));
+ WRITE_ONCE(inode->i_private, (void *)((unsigned long) realinode |
+ (is_upper ? OVL_ISUPPER_MASK : 0)));
}
void ovl_inode_update(struct inode *inode, struct inode *upperinode)
@@ -231,7 +231,7 @@ void ovl_inode_update(struct inode *inode, struct inode *upperinode)
WARN_ON(!upperinode);
WARN_ON(!inode_unhashed(inode));
WRITE_ONCE(inode->i_private,
- (unsigned long) upperinode | OVL_ISUPPER_MASK);
+ (void *)((unsigned long) upperinode | OVL_ISUPPER_MASK));
if (!S_ISDIR(upperinode->i_mode))
__insert_inode_hash(inode, (unsigned long) upperinode);
}
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 56b90897a459..b619f5853af8 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -288,6 +288,10 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
}
}
+#define __ALIGNED_WORD(x) \
+ ((sizeof(x) == 1 || sizeof(x) == 2 || sizeof(x) == 4 || \
+ sizeof(x) == sizeof(long)) && (sizeof(x) == __alignof__(x))) \
+
/*
* Prevent the compiler from merging or refetching reads or writes. The
* compiler is also forbidden from reordering successive instances of
@@ -309,8 +313,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
* mutilate accesses that either do not require ordering or that interact
* with an explicit memory barrier or atomic instruction that provides the
* required ordering.
+ *
+ * Unaligned data is particularly tricky here: if the type that gets
+ * passed in is not naturally aligned, we cast to a type of higher
+ * alignment, which is not well-defined in C. This is fine as long
+ * as the actual data is aligned, but otherwise might require a trap
+ * to satisfy the load.
*/
-
#define __READ_ONCE(x, check) \
({ \
union { typeof(x) __val; char __c[1]; } __u; \
@@ -320,7 +329,32 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
__read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
__u.__val; \
})
-#define READ_ONCE(x) __READ_ONCE(x, 1)
+
+#define __WRITE_ONCE(x, val) \
+({ \
+ union { typeof(x) __val; char __c[1]; } __u = \
+ { .__val = (__force typeof(x)) (val) }; \
+ __write_once_size(&(x), __u.__c, sizeof(x)); \
+ __u.__val; \
+})
+
+
+/*
+ * the common case is simple: x is naturally aligned, not an array,
+ * and accessible with a single load, avoiding the need for local
+ * variables. With KASAN, this is important as any call to
+ *__write_once_size(),__read_once_size_nocheck() or __read_once_size()
+ * uses significant amounts of stack space for checking that we don't
+ * overflow the union.
+ */
+#define __READ_ONCE_SIMPLE(x) \
+ (typeof(x))(*(volatile typeof(&(x)))&(x))
+
+#define __WRITE_ONCE_SIMPLE(x, val) \
+ ({*(volatile typeof(&(x)))&(x) = (val); })
+
+#define READ_ONCE(x) __builtin_choose_expr(__ALIGNED_WORD(x), \
+ __READ_ONCE_SIMPLE(x), __READ_ONCE(x, 1))
/*
* Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need
@@ -328,13 +362,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
*/
#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0)
-#define WRITE_ONCE(x, val) \
-({ \
- union { typeof(x) __val; char __c[1]; } __u = \
- { .__val = (__force typeof(x)) (val) }; \
- __write_once_size(&(x), __u.__c, sizeof(x)); \
- __u.__val; \
-})
+#define WRITE_ONCE(x, val) do { __builtin_choose_expr(__ALIGNED_WORD(x), \
+ __WRITE_ONCE_SIMPLE(x, val), __WRITE_ONCE(x, val)); } while (0)
#endif /* __KERNEL__ */
--
2.9.0
^ permalink raw reply related
* [PATCH 19/26] [media] r820t: mark register functions as noinline_for_kasan
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
With KASAN, we get an overly long stack frame due to inlining
the register access function:
drivers/media/tuners/r820t.c: In function 'generic_set_freq.isra.7':
drivers/media/tuners/r820t.c:1334:1: error: the frame size of 2880 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
An earlier patch I tried used an open-coded r820t_write_reg()
implementation that may have been more efficent, while this
version simply adds the annotation, which has a lower risk for
regressions.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/tuners/r820t.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
index ba80376a3b86..0fbfa6416e38 100644
--- a/drivers/media/tuners/r820t.c
+++ b/drivers/media/tuners/r820t.c
@@ -396,7 +396,7 @@ static int r820t_write(struct r820t_priv *priv, u8 reg, const u8 *val,
return 0;
}
-static int r820t_write_reg(struct r820t_priv *priv, u8 reg, u8 val)
+static noinline_for_kasan int r820t_write_reg(struct r820t_priv *priv, u8 reg, u8 val)
{
return r820t_write(priv, reg, &val, 1);
}
@@ -411,7 +411,7 @@ static int r820t_read_cache_reg(struct r820t_priv *priv, int reg)
return -EINVAL;
}
-static int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val,
+static noinline_for_kasan int r820t_write_reg_mask(struct r820t_priv *priv, u8 reg, u8 val,
u8 bit_mask)
{
int rc = r820t_read_cache_reg(priv, reg);
--
2.9.0
^ permalink raw reply related
* [PATCH 25/26] isdn: eicon: mark divascapi incompatible with kasan
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
When CONFIG_KASAN is enabled, we have several functions that use rather
large kernel stacks, e.g.
drivers/isdn/hardware/eicon/message.c: In function 'group_optimization':
drivers/isdn/hardware/eicon/message.c:14841:1: warning: the frame size of 864 bytes is larger than 500 bytes [-Wframe-larger-than=]
drivers/isdn/hardware/eicon/message.c: In function 'add_b1':
drivers/isdn/hardware/eicon/message.c:7925:1: warning: the frame size of 1008 bytes is larger than 500 bytes [-Wframe-larger-than=]
drivers/isdn/hardware/eicon/message.c: In function 'add_b23':
drivers/isdn/hardware/eicon/message.c:8551:1: warning: the frame size of 928 bytes is larger than 500 bytes [-Wframe-larger-than=]
drivers/isdn/hardware/eicon/message.c: In function 'sig_ind':
drivers/isdn/hardware/eicon/message.c:6113:1: warning: the frame size of 2112 bytes is larger than 500 bytes [-Wframe-larger-than=]
To be on the safe side, and to enable a lower frame size warning limit, let's
just mark this driver as broken when KASAN is in use. I have tried to reduce
the stack size as I did with dozens of other drivers, but failed to come up
with a good solution for this one.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/isdn/hardware/eicon/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/isdn/hardware/eicon/Kconfig b/drivers/isdn/hardware/eicon/Kconfig
index 6082b6a5ced3..b64496062421 100644
--- a/drivers/isdn/hardware/eicon/Kconfig
+++ b/drivers/isdn/hardware/eicon/Kconfig
@@ -31,6 +31,7 @@ config ISDN_DIVAS_PRIPCI
config ISDN_DIVAS_DIVACAPI
tristate "DIVA CAPI2.0 interface support"
+ depends on !KASAN || BROKEN
help
You need this to provide the CAPI interface
for DIVA Server cards.
--
2.9.0
^ permalink raw reply related
* [PATCH 3/3] Staging:wilc1000:host_interface: Integrated two 'if' statements to a single 'if' statement
From: Georgios Emmanouil @ 2017-03-02 15:38 UTC (permalink / raw)
To: aditya.shankar, ganesh.krishna, gregkh
Cc: linux-wireless, devel, linux-kernel
In-Reply-To: <1488469029-8918-1-git-send-email-geo.emmnl@gmail.com>
Removed unnecessary 'if' statement and integrated the condition to the
previous 'if' statement.
Signed-off-by: Georgios Emmanouil <geo.emmnl@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index bbe1a09..4936e80 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1355,13 +1355,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
} else {
strConnectInfo.status = pstrConnectRespInfo->status;
- if (strConnectInfo.status == SUCCESSFUL_STATUSCODE) {
- if (pstrConnectRespInfo->ies) {
- strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;
- strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
- pstrConnectRespInfo->ies_len);
- }
+ if (strConnectInfo.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
+ strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;
+ strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
+ memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
+ pstrConnectRespInfo->ies_len);
}
if (pstrConnectRespInfo) {
--
2.1.4
^ permalink raw reply related
* [PATCH 17/26] [media] i2c: ks0127: reduce stack frame size for KASAN
From: Arnd Bergmann @ 2017-03-02 16:38 UTC (permalink / raw)
To: kasan-dev
Cc: Andrey Ryabinin, Alexander Potapenko, Dmitry Vyukov, netdev,
linux-kernel, linux-media, linux-wireless, kernel-build-reports,
David S . Miller, Arnd Bergmann
In-Reply-To: <20170302163834.2273519-1-arnd@arndb.de>
When CONFIG_KASAN is set, inlining of functions with local variables
causes excessive stack usage:
drivers/media/i2c/ks0127.c: In function 'ks0127_s_routing':
drivers/media/i2c/ks0127.c:541:1: error: the frame size of 3136 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
Marking one functions as noinline_for_kasan solves the problem in this
driver.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/media/i2c/ks0127.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ks0127.c b/drivers/media/i2c/ks0127.c
index ab536c4a7115..eb2fccdc0602 100644
--- a/drivers/media/i2c/ks0127.c
+++ b/drivers/media/i2c/ks0127.c
@@ -349,7 +349,7 @@ static void ks0127_write(struct v4l2_subdev *sd, u8 reg, u8 val)
/* generic bit-twiddling */
-static void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v)
+static noinline_for_kasan void ks0127_and_or(struct v4l2_subdev *sd, u8 reg, u8 and_v, u8 or_v)
{
struct ks0127 *ks = to_ks0127(sd);
--
2.9.0
^ permalink raw reply related
* ANNOUNCE: Netdev 2.1 New Gold Sponsor
From: Jamal Hadi Salim @ 2017-03-02 16:36 UTC (permalink / raw)
Cc: netfilter-devel, netfilter, linux-wireless, tech-committee,
David Miller, Stephen Jaworski, people, Brenda Butler
We'd like to announce Mojatatu Networks as our second Gold Sponsor.
Thank you for the continued support!
cheers,
jamal
^ permalink raw reply
* [PATCH] Staging:wilc1000:linux_wlan: Modified the 'if-else' statement
From: Georgios Emmanouil @ 2017-03-02 16:14 UTC (permalink / raw)
To: aditya.shankar, ganesh.krishna, gregkh
Cc: linux-wireless, devel, linux-kernel
Modified the 'if-else' statement to make it more readable.
Signed-off-by: Georgios Emmanouil <geo.emmnl@gmail.com>
---
drivers/staging/wilc1000/linux_wlan.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 2eebc62..d82f0ff 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -867,15 +867,10 @@ static int wilc_mac_open(struct net_device *ndev)
wilc_get_vif_idx(vif),
wl->open_ifcs);
} else {
- if (memcmp(wl->vif[i ^ 1]->bssid,
- wl->vif[i ^ 1]->src_addr, 6))
- wilc_set_wfi_drv_handler(vif,
- wilc_get_vif_idx(vif),
- 0);
+ if (memcmp(wl->vif[i ^ 1]->bssid, wl->vif[i ^ 1]->src_addr, 6))
+ wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), 0);
else
- wilc_set_wfi_drv_handler(vif,
- wilc_get_vif_idx(vif),
- 1);
+ wilc_set_wfi_drv_handler(vif, wilc_get_vif_idx(vif), 1);
}
wilc_set_operation_mode(vif, vif->iftype);
--
2.1.4
^ permalink raw reply related
* [PATCH 2/3] Staging:wilc1000:host_interface: Fixed alignment to match open parenthesis
From: Georgios Emmanouil @ 2017-03-02 15:37 UTC (permalink / raw)
To: aditya.shankar, ganesh.krishna, gregkh
Cc: linux-wireless, devel, linux-kernel
In-Reply-To: <1488468905-8686-1-git-send-email-geo.emmnl@gmail.com>
Fixed alignment to match open parenthesis.
Signed-off-by: Georgios Emmanouil <geo.emmnl@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 090fd43..bbe1a09 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1349,7 +1349,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (u32RcvdAssocRespInfoLen != 0) {
s32Err = wilc_parse_assoc_resp_info(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
- &pstrConnectRespInfo);
+ &pstrConnectRespInfo);
if (s32Err) {
netdev_err(vif->ndev, "wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
} else {
--
2.1.4
^ permalink raw reply related
* [PATCH 1/3] Staging:wilc1000:host_interface: Removed unnecessary blank line
From: Georgios Emmanouil @ 2017-03-02 15:35 UTC (permalink / raw)
To: aditya.shankar, ganesh.krishna, gregkh
Cc: linux-wireless, devel, linux-kernel
Removed unnecessary blank line.
Signed-off-by: Georgios Emmanouil <geo.emmnl@gmail.com>
---
drivers/staging/wilc1000/host_interface.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index c307cce..090fd43 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -287,7 +287,6 @@ static int wilc_enqueue_cmd(struct host_if_msg *msg)
return 0;
}
-
/* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
* special purpose in wilc device, so we add 1 to the index to starts from 1.
* As a result, the returned index will be 1 to NUM_CONCURRENT_IFC.
--
2.1.4
^ permalink raw reply related
* Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: Johannes Berg @ 2017-03-02 13:43 UTC (permalink / raw)
To: Raja, Tamizh Chelvam, linux-wireless@vger.kernel.org
Cc: ath10k@lists.infradead.org
In-Reply-To: <b461827bad634932a8f0f3b3bfe5e6b4@aphydexm01f.ap.qualcomm.com>
>
> [Tamizh] I'm planning to do this check in iw itself and converting
> into a value,
>
> iw command will looks like below
>
> iw btcoex enable [<be> <bk> <vo> <vi> <mgmt><beacon>]
>
> If anything other than this given by user will be rejected and will
> not forward to cfg80211.
> Do you have any concern on this?
Yes, you really need to check it in cfg80211 and define the bits that
are valid in nl80211.
johannes
^ permalink raw reply
* Re: [PATCH 099/306] mac80211-hwsim: notify user-space about channel change.
From: Ben Greear @ 2017-03-02 14:26 UTC (permalink / raw)
To: Johannes Berg, linux-wireless
In-Reply-To: <1488443884.8390.4.camel@sipsolutions.net>
On 03/02/2017 12:38 AM, Johannes Berg wrote:
> On Mon, 2017-02-27 at 12:48 -0800, Ben Greear wrote:
>> On 02/23/2017 10:36 PM, Johannes Berg wrote:
>>>
>>>
>>>> + msg_head = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0,
>>>> + HWSIM_CMD_NOTIFY);
>>>
>>> I think you should use a more specific command name.
>>>
>>>> + if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
>>>> + ETH_ALEN, data->addresses[1].addr))
>>>> + goto nla_put_failure;
>>>
>>> and at least also add a more specific identifier like the radio ID.
>>>
>>>> + if (data->channel)
>>>> + center_freq = data->channel->center_freq;
>>>> +
>>>> + if (nla_put_u32(skb, HWSIM_ATTR_FREQ, center_freq))
>>>> + goto nla_put_failure;
>>>
>>> and have the full channel definition
>>
>> You want chandef.center_freq1,
>> chandef.center_freq2,
>> chandef.width?
>>
>>
>> Anything else?
>
> The control channel center_freq is already there so that should be the
> full chandef. I guess center_freq2 should be conditional on being non-
> zero.
I posted a new patch series a day or two ago...please let me know
if that looks right to you. I un-conditionally included freq2, but
I think that is cleaner code all around. Still, I'll make it conditional
if that is important to you.
Thanks,
Ben
>
> johannes
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* RE: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: Raja, Tamizh Chelvam @ 2017-03-02 13:08 UTC (permalink / raw)
To: Johannes Berg, linux-wireless@vger.kernel.org; +Cc: ath10k@lists.infradead.org
In-Reply-To: <1488456958.8390.15.camel@sipsolutions.net>
DQo+IA0KPiA+ID4gSSB0aGluayB5b3UgbmVlZCB0byBkZWZpbmUgdGhlIGJpdHMgc29tZXdoZXJl
IGluIGFuIGVudW0gLSBpLmUuDQo+ID4gPiB3aGljaCBvbmUgaXMgVk8sDQo+ID4gPiBWSSwgLi4u
DQo+ID4gPg0KPiA+DQo+ID4gW1RhbWl6aF0gb2sgc3VyZS4gSXMgdGhpcyBmb3IgZG9jdW1lbnRh
dGlvbiBwdXJwb3NlIG9yIGRvIHlvdSB3YW50IG1lDQo+ID4gdG8gdXNlIHRoYXTCoCBlbnVtIGZv
ciBzb21ldGhpbmcgZWxzZT8NCj4gDQo+IFdlbGwgSSB0aGluayB5b3Ugc2hvdWxkIGNoZWNrIGlu
IGNmZzgwMjExIHRoYXQgbm8gYml0cyBub3QgZGVmaW5lZCBpbiB0aGUgZW51bQ0KPiBhcmUgdXNl
ZCwgDQpbVGFtaXpoXSBJJ20gcGxhbm5pbmcgdG8gZG8gdGhpcyBjaGVjayBpbiBpdyBpdHNlbGYg
YW5kIGNvbnZlcnRpbmcgaW50byBhIHZhbHVlLCANCg0KaXcgY29tbWFuZCB3aWxsIGxvb2tzIGxp
a2UgYmVsb3cNCg0KaXcgYnRjb2V4IGVuYWJsZSBbPGJlPiA8Yms+IDx2bz4gPHZpPiA8bWdtdD48
YmVhY29uPl0NCg0KSWYgYW55dGhpbmcgb3RoZXIgdGhhbiB0aGlzIGdpdmVuIGJ5IHVzZXIgd2ls
bCBiZSByZWplY3RlZCBhbmQgd2lsbCBub3QgZm9yd2FyZCB0byBjZmc4MDIxMS4NCkRvIHlvdSBo
YXZlIGFueSBjb25jZXJuIG9uIHRoaXM/DQoNCj5hbmQgdGhlbiBpbiB0aGUgZHJpdmVyIHlvdSBu
ZWVkIHRvIHVzZSB0aGF0IGVudW0gdG8gdHJhbnNsYXRlIHRvIHRoZQ0KPiBmaXJtd2FyZSBBUEks
IHJpZ2h0Pw0KPiANCltUYW1pemhdIFllcywgd2UgY2FuIGhhdmUgdGhpcyBmb3IgY2hlY2tpbmcg
aW52YWxpZCBvciB0aGUgdmFsdWUgaXMgZ3JlYXRlciB0aGUgZHJpdmVyIHN1cHBvcnQgdmFsdWUN
Cg==
^ permalink raw reply
* Re: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: Johannes Berg @ 2017-03-02 12:15 UTC (permalink / raw)
To: Raja, Tamizh Chelvam, linux-wireless@vger.kernel.org
Cc: ath10k@lists.infradead.org
In-Reply-To: <b55e902d1a5445feb3058cee1118ae39@aphydexm01f.ap.qualcomm.com>
> > I think you need to define the bits somewhere in an enum - i.e.
> > which one is VO,
> > VI, ...
> >
>
> [Tamizh] ok sure. Is this for documentation purpose or do you want me
> to use that enum for something else?
Well I think you should check in cfg80211 that no bits not defined in
the enum are used, and then in the driver you need to use that enum to
translate to the firmware API, right?
johannes
^ permalink raw reply
* Re: Hostapd de-auth connected clients
From: Arend Van Spriel @ 2017-03-02 12:37 UTC (permalink / raw)
To: ravin goyal; +Cc: Jouni Malinen, wpa_supplicant, linux-wireless
In-Reply-To: <CANU0Mn0yHhf+wjmTfo5-KPbqcWZMDOfs32ZWQndhftyQRFDBUw@mail.gmail.com>
+ linux-wireless
On 2-3-2017 10:28, ravin goyal wrote:
> Hi Arend
>
> Thanks, I will certainly try with brcmfmac if you say so.
> Currently I am testing hostapd on orange pi zero board running debian
> jessie and its wlan driver is xradio_wlan and it is working fine.
> I don't know why raspbian and debian have introduced bcmdhd for WLAN
> in their distros.
> I have filed bug on raspbian but received on response yet.
Now it gets confusing. From what I found xradio_wlan is for some
Allwinner flavor based on ST/Ericsson chipset with sdio id 0020:2281.
That would not be a device that bcmdhd would try to bind to.
Regards,
Arend
> Regards
> Ravin
>
> On 1 March 2017 at 18:59, Arend Van Spriel <arend.vanspriel@broadcom.com> wrote:
>> On 28-2-2017 23:28, Jouni Malinen wrote:
>>> On Tue, Feb 28, 2017 at 04:06:48PM +0530, ravin goyal wrote:
>>>> I am sharing link to recent debug log related to de-auth messages in
>>>> hostapd, I hope it might help to figure out what's really happening
>>>> and to know whether it is due to driver or hostapd.
>>>>
>>>> Please take a look at this.
>>>>
>>>> link to log file: https://clbin.com/0flGD
>>>
>>> It looks like number of the disconnections in the two logs are triggered
>>> by station inactivity check:
>>>
>>> 1488275056.529235: wlan0: Station 00:73:8d:43:87:2e has been inactive too long: 308 sec, max allowed: 300
>>> 1488275056.529389: Polling STA
>>> 1488275056.529457: nl80211: send_mlme - da= 00:73:8d:43:87:2e noack=0 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x248 (WLAN_FC_STYPE_NULLFUNC) nlmode=3
>>> 1488275056.529574: nl80211: Use bss->freq=2442
>>> 1488275056.529634: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=0 offchanok=0
>>> 1488275056.529711: CMD_FRAME - hexdump(len=24): 48 02 00 00 00 73 8d 43 87 2e 02 1a 11 f5 47 06 02 1a 11 f5 47 06 00 00
>>> 1488275056.530129: nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=2442 wait=0)
>>> 1488275056.530231: nl80211_send_null_frame: Failed to send poll frame
>>> 1488275056.530295: ap_handle_timer: register ap_handle_timer timeout for 00:73:8d:43:87:2e (1 seconds - AP_DISASSOC_DELAY)
>>>
>>>
>>> This code should not have been triggered at all if the driver reported
>>> activity in the expected way, so I'm assuming the driver does not
>>> support that.. And then it does not support sending out the poll frame
>>> to check whether the STA is still there.
>>>
>>> You might be able to work around this by setting a significantly larger
>>> ap_max_inactivity value in hostapd.conf, but for a proper fix, someone
>>> more familiar with the particular driver would need to take a look at
>>> what's happening and why the driver does not indicate station activity.
>>
>> I would suggest trying brcmfmac instead of bcmdhd. The bcmdhd is
>> specifically for Android and verification is done on Android targets.
>> Not saying your problems will be gone, but at least you can ask me for help.
>>
>> Regards,
>> Arend
^ permalink raw reply
* RE: [PATCHv2 1/4] cfg80211: Add support to enable or disable btcoex
From: Raja, Tamizh Chelvam @ 2017-03-02 11:49 UTC (permalink / raw)
To: Johannes Berg, linux-wireless@vger.kernel.org; +Cc: ath10k@lists.infradead.org
In-Reply-To: <1488444301.8390.6.camel@sipsolutions.net>
SGkgSm9oYW5uZXMsDQoNClRoYW5rcyBmb3IgdGhlIGNvbW1lbnRzLg0KDQo+IFlvdSBuZWVkIHRv
IGZpeCB0aGUgYnVpbGQtYm90IHdhcm5pbmcsIGl0J3MgbGVnaXRpbWF0ZSAodGhvdWdoIGhhcmQg
dG8NCj4gc3BvdCk6DQo+IA0KPiA+ICsJVFBfcHJpbnRrKFdJUEhZX1BSX0ZNVCwgIiwgZW5hYmxl
ZD0lZCIsDQo+ID4gKwkJwqDCoFdJUEhZX1BSX0FSRywgX19lbnRyeS0+ZW5hYmxlZCkNCj4gPiAr
KTsNCj4gDQo+IFlvdSBoYXZlIGEgc3RyYXkgY29tbWEgdGhlcmUgYWZ0ZXIgV0lQSFlfUFJfRk1U
Lg0KPiANCltUYW1pemhdIFllczooIFdpbGwgZml4IGl0IGluIHRoZSBuZXh0IHZlcnNpb24uDQo=
^ permalink raw reply
* RE: [PATCHv2 3/4] cfg80211: Add Support set btcoex priority value
From: Raja, Tamizh Chelvam @ 2017-03-02 11:48 UTC (permalink / raw)
To: Johannes Berg, linux-wireless@vger.kernel.org; +Cc: ath10k@lists.infradead.org
In-Reply-To: <1488444659.8390.8.camel@sipsolutions.net>
PiBJcyB0aGVyZSBtdWNoIHBvaW50IGluIGhhdmluZyA0IHJhdGhlciB0aGFuIGp1c3QgMiBwYXRj
aGVzPw0KPg0KW1RhbWl6aF0gWWVzLCBJIGFncmVlIHRvIGl0LiANCj4gDQo+ID4gKwlpbnTCoMKg
wqDCoMKgKCpzZXRfYnRjb2V4KShzdHJ1Y3Qgd2lwaHkgKndpcGh5LCBib29sIGVuYWJsZWQsDQo+
ID4gKwkJCcKgwqDCoMKgwqDCoGludCBidGNvZXhfcHJpb3JpdHkpOw0KPiANCj4gU2hvdWxkbid0
IHRoYXQgYmUgdTMyIGFzIGEgYml0bWFwPw0KPiANCltUYW1pemhdIFllcy4NCg0KPiA+ICsJYm9v
bCBidGNvZXhfcHJpb3JpdHlfc3VwcG9ydDsNCj4gDQo+IFdoeSBub3QgdXNlIGFuIGV4dGVuZGVk
IG5sODAyMTEgZmVhdHVyZSBmbGFnIGRpcmVjdGx5Pw0KPiANCltUYW1pemhdIE9rIHN1cmUuIEkn
bGwgdXNlIGV4dGVuZGVkIG5sODAyMTEgZmVhdHVyZSBmbGFnLg0KDQo+ID4gKyAqIEBOTDgwMjEx
X0FUVFJfQlRDT0VYX1BSSU9SSVRZOiBUaGlzIGlzIGZvciB0aGUgZHJpdmVyIHdoaWNoDQo+ID4g
KyAqwqDCoMKgwqDCoHN1cHBvcnQgYnRjb2V4IHByaW9yaXR5IGZlYXR1cmUuIEl0IHVzZWQgd2l0
aA0KPiA+ICVOTDgwMjExX0NNRF9TRVRfQlRDT0VYLg0KPiA+ICsgKsKgwqDCoMKgwqBUaGlzIHdp
bGwgaGF2ZSB1MzIgQklUTUFQIHZhbHVlIHdoaWNoIHJlcHJlc2VudHMNCj4gPiArICrCoMKgwqDC
oMKgZnJhbWUoYmssIGJlLCB2aSwgdm8sIG1nbXQsIGJlYWNvbikgdHlwZSBhbmQgdGhhdCB3aWxs
IGhhdmUNCj4gPiBtb3JlDQo+ID4gKyAqwqDCoMKgwqDCoHByaW9yaXR5IHRoYW4gYSBCVCB0cmFm
ZmljLg0KPiANCj4gSSB0aGluayB5b3UgbmVlZCB0byBkZWZpbmUgdGhlIGJpdHMgc29tZXdoZXJl
IGluIGFuIGVudW0gLSBpLmUuIHdoaWNoIG9uZSBpcyBWTywNCj4gVkksIC4uLg0KPg0KW1RhbWl6
aF0gb2sgc3VyZS4gSXMgdGhpcyBmb3IgZG9jdW1lbnRhdGlvbiBwdXJwb3NlIG9yIGRvIHlvdSB3
YW50IG1lIHRvIHVzZSB0aGF0IA0KZW51bSBmb3Igc29tZXRoaW5nIGVsc2U/DQogDQo+ID4gKwlp
bnQgYnRjb2V4X3ByaW9yaXR5ID0gLTE7DQo+IA0KPiBUaGF0IC0xIGlzIHByZXR0eSB1c2VsZXNz
LCBpZiB0aGUgZHJpdmVyIGRvZXNuJ3Qgc3VwcG9ydCBpdCwgaG9wZWZ1bGx5IGl0IHdvbid0IGxv
b2sNCj4gYXQgdGhlIHZhbHVlIGF0IGFsbD8NCj4gDQpbVGFtaXpoXSBPayBzdXJlDQo=
^ permalink raw reply
* Re: Usage of WoWLAN with iwlwifi driver (Device phy0 failed to suspend async: error -16)
From: Johannes Berg @ 2017-03-02 8:55 UTC (permalink / raw)
To: Oliver Freyermuth, linux-wireless
In-Reply-To: <6337fa40-adcc-b889-1842-16e0f316ea3e@googlemail.com>
> > Oh. Can you see if you have CONFIG_IWLWIFI_PCIE_RTPM enabled in
> > your configuration? If you do, please turn it off and see if that
> > fixes it.
>
> Indeed, you got it!
> I had it on, and turning that off lets me suspend just fine after
> activating WoWLAN!
[snip]
> The problem is that it seems I cannot actually wake the machine
> anymore afterwards...
> While in the suspend procedure, I see:
> [12385.893568] iwlwifi 0000:0a:00.0: System wakeup enabled by ACPI
> as expected, I could neither get it to make a tcp connection in tcp-
> connection mode,
> nor could I wake the machine via magic packet in magic-packet mode.
>
> Could that be some hardware / system firmware limitation, e.g. if my
> UEFI does not support actually powering
> the WiFi hardware if I am in S3?
Yes. Does it print something to that effect at resume time? I think it
should.
> At least, the suspend problem seems to be clearly related to some
> path only used if CONFIG_IWLWIFI_PCIE_RTPM is on.
Would you mind filing a bug on bugzilla.kernel.org (and adding linuxwif
i@intel.com as the assignee or at least in Cc)? I think we really ought
to sort out the issues with the RTPM stuff.
johannes
^ permalink raw reply
* pull-request: mac80211 2017-03-02
From: Johannes Berg @ 2017-03-02 10:34 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-wireless
Hi Dave,
As I mentioned in my other pull request, here's the change
for the average.h to make the precision easier to use.
Please pull and let me know if there's any problem.
Thanks,
johannes
The following changes since commit 48cac18ecf1de82f76259a54402c3adb7839ad01:
ipv6: orphan skbs in reassembly unit (2017-03-01 20:55:57 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211.git tags/mac80211-for-davem-2017-03-02
for you to fetch changes up to eb1e011a14748a1d9df9a7d7df9a5711721a1bdb:
average: change to declare precision, not factor (2017-03-02 08:32:46 +0100)
----------------------------------------------------------------
This contains just the average.h change in order to get it
into the tree before adding new users through -next trees.
----------------------------------------------------------------
Johannes Berg (1):
average: change to declare precision, not factor
drivers/net/virtio_net.c | 2 +-
drivers/net/wireless/ath/ath5k/ath5k.h | 2 +-
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 2 +-
include/linux/average.h | 61 +++++++++++++++++++----------
net/batman-adv/types.h | 2 +-
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/sta_info.h | 2 +-
7 files changed, 47 insertions(+), 26 deletions(-)
^ permalink raw reply
* Re: [RFC v2 2/2] cfg80211: support 4-way handshake offloading for 802.1X
From: Arend Van Spriel @ 2017-03-02 10:50 UTC (permalink / raw)
To: Johannes Berg, linux-wireless; +Cc: Avraham Stern
In-Reply-To: <1488445144.8390.13.camel@sipsolutions.net>
On 2-3-2017 9:59, Johannes Berg wrote:
>
>>> + int (*del_pmk)(struct wiphy *wiphy, struct
>>> net_device *dev,
>>> + const u8 *aa);
>>
>> Minor nit, but prefer clr_pmk to clear the pmk.
>
> Why? You don't have "the PMK" that you can clear, you have "a PMK" (for
> the network) and after deleting it you don't have it anymore. You don't
> have a "cleared PMK" afterwards, you just don't have any. I think the
> delete makes more sense?
Ah. I just looked at set_pmk and felt its counter-part should therefor
be clr_pmk. Following your logic should it be add_pmk iso set_pmk?
>>> + NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X,
>>
>> So do we need this flag. Is the fact that the driver implements the
>> set_pmk and del_pmk (or clr_pmk) callbacks not sufficient provided
>> they are listed in the "supported commands" message of wiphy dump
>> (not in this patch). Which reminds me, is "supported commands" no
>> longer preferred because that list does not seem complete?
>
> It's complicated... We've kinda naturally gravitated towards extended
> feature flags because they're so easy to handle now (only need to
> define the bit) - and with mac80211 in the picture, relying on the
> handlers only often didn't work, so it requires extra code in the CMD()
> advertising - and anyway it already requires extra code there unlike
> the feature flags...
>
> So overall - while this isn't stated policy (yet?) - I think we prefer
> the feature bits.
I see. Glad they worked out that way ;-)
Regards,
Arend
^ permalink raw reply
* pull-request: wireless-drivers 2017-03-02
From: Kalle Valo @ 2017-03-02 9:15 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel
Hi Dave,
only one patch this time, the new version of ath10k patch we reverted
earlier. I was supposed to send you this earlier but it got delayed
because I'm on vacation, so sorry about that. I'm hoping this is ok to
take also even the merge window is closed as the changes to the first
version of the patch are minimal.
Please let me know if there are any problems.
Kalle
The following changes since commit 8313064c2e75542201e557e2b496668811c2484a:
Merge tag 'nfsd-4.11' of git://linux-nfs.org/~bfields/linux (2017-02-28 15:39:09 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git tags/wireless-drivers-for-davem-2017-03-02
for you to fetch changes up to 1657b8f84ed9fc1d2a100671f1d42d6286f20073:
ath10k: search SMBIOS for OEM board file extension (2017-03-02 10:48:41 +0200)
----------------------------------------------------------------
wireless-drivers fixes for 4.11
Add back a fixed version of an ath10k patch which was reverted during
the merge window.
----------------------------------------------------------------
Waldemar Rymarkiewicz (1):
ath10k: search SMBIOS for OEM board file extension
drivers/net/wireless/ath/ath10k/core.c | 101 ++++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/core.h | 19 +++++++
2 files changed, 117 insertions(+), 3 deletions(-)
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 099/306] mac80211-hwsim: notify user-space about channel change.
From: Johannes Berg @ 2017-03-02 8:38 UTC (permalink / raw)
To: Ben Greear, linux-wireless
In-Reply-To: <03ca5a0f-0ab0-76a4-06f3-ead61ab73c94@candelatech.com>
On Mon, 2017-02-27 at 12:48 -0800, Ben Greear wrote:
> On 02/23/2017 10:36 PM, Johannes Berg wrote:
> >
> >
> > > + msg_head = genlmsg_put(skb, 0, 0, &hwsim_genl_family, 0,
> > > + HWSIM_CMD_NOTIFY);
> >
> > I think you should use a more specific command name.
> >
> > > + if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
> > > + ETH_ALEN, data->addresses[1].addr))
> > > + goto nla_put_failure;
> >
> > and at least also add a more specific identifier like the radio ID.
> >
> > > + if (data->channel)
> > > + center_freq = data->channel->center_freq;
> > > +
> > > + if (nla_put_u32(skb, HWSIM_ATTR_FREQ, center_freq))
> > > + goto nla_put_failure;
> >
> > and have the full channel definition
>
> You want chandef.center_freq1,
> chandef.center_freq2,
> chandef.width?
>
>
> Anything else?
The control channel center_freq is already there so that should be the
full chandef. I guess center_freq2 should be conditional on being non-
zero.
johannes
^ permalink raw reply
* [PATCH] mac80211_hwsim: fix command documentation indentation
From: Johannes Berg @ 2017-03-02 8:39 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/mac80211_hwsim.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.h b/drivers/net/wireless/mac80211_hwsim.h
index 39f22467ca2a..3f5eda591dba 100644
--- a/drivers/net/wireless/mac80211_hwsim.h
+++ b/drivers/net/wireless/mac80211_hwsim.h
@@ -57,12 +57,12 @@ enum hwsim_tx_control_flags {
* @HWSIM_CMD_REGISTER: request to register and received all broadcasted
* frames by any mac80211_hwsim radio device.
* @HWSIM_CMD_FRAME: send/receive a broadcasted frame from/to kernel/user
- * space, uses:
+ * space, uses:
* %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_ADDR_RECEIVER,
* %HWSIM_ATTR_FRAME, %HWSIM_ATTR_FLAGS, %HWSIM_ATTR_RX_RATE,
* %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE, %HWSIM_ATTR_FREQ (optional)
* @HWSIM_CMD_TX_INFO_FRAME: Transmission info report from user space to
- * kernel, uses:
+ * kernel, uses:
* %HWSIM_ATTR_ADDR_TRANSMITTER, %HWSIM_ATTR_FLAGS,
* %HWSIM_ATTR_TX_INFO, %HWSIM_ATTR_SIGNAL, %HWSIM_ATTR_COOKIE
* @HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters,
--
2.11.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox