]>
Commit | Line | Data |
---|---|---|
b5e011cd SL |
1 | From 969bc289baa2ab5a83dc2b373920d5db595fa40d Mon Sep 17 00:00:00 2001 |
2 | From: Balaji Pothunoori <bpothuno@codeaurora.org> | |
3 | Date: Mon, 21 Jan 2019 12:30:43 +0530 | |
4 | Subject: mac80211: don't initiate TDLS connection if station is not associated | |
5 | to AP | |
6 | ||
7 | [ Upstream commit 7ed5285396c257fd4070b1e29e7b2341aae2a1ce ] | |
8 | ||
9 | Following call trace is observed while adding TDLS peer entry in driver | |
10 | during TDLS setup. | |
11 | ||
12 | Call Trace: | |
13 | [<c1301476>] dump_stack+0x47/0x61 | |
14 | [<c10537d2>] __warn+0xe2/0x100 | |
15 | [<fa22415f>] ? sta_apply_parameters+0x49f/0x550 [mac80211] | |
16 | [<c1053895>] warn_slowpath_null+0x25/0x30 | |
17 | [<fa22415f>] sta_apply_parameters+0x49f/0x550 [mac80211] | |
18 | [<fa20ad42>] ? sta_info_alloc+0x1c2/0x450 [mac80211] | |
19 | [<fa224623>] ieee80211_add_station+0xe3/0x160 [mac80211] | |
20 | [<c1876fe3>] nl80211_new_station+0x273/0x420 | |
21 | [<c170f6d9>] genl_rcv_msg+0x219/0x3c0 | |
22 | [<c170f4c0>] ? genl_rcv+0x30/0x30 | |
23 | [<c170ee7e>] netlink_rcv_skb+0x8e/0xb0 | |
24 | [<c170f4ac>] genl_rcv+0x1c/0x30 | |
25 | [<c170e8aa>] netlink_unicast+0x13a/0x1d0 | |
26 | [<c170ec18>] netlink_sendmsg+0x2d8/0x390 | |
27 | [<c16c5acd>] sock_sendmsg+0x2d/0x40 | |
28 | [<c16c6369>] ___sys_sendmsg+0x1d9/0x1e0 | |
29 | ||
30 | Fixing this by allowing TDLS setup request only when we have completed | |
31 | association. | |
32 | ||
33 | Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org> | |
34 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | |
35 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
36 | --- | |
37 | net/mac80211/cfg.c | 4 ++++ | |
38 | 1 file changed, 4 insertions(+) | |
39 | ||
40 | diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c | |
41 | index 6ba5240dd61da..ffe319309d033 100644 | |
42 | --- a/net/mac80211/cfg.c | |
43 | +++ b/net/mac80211/cfg.c | |
44 | @@ -1194,6 +1194,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |
45 | sta->sta.tdls = true; | |
46 | } | |
47 | ||
48 | + if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && | |
49 | + !sdata->u.mgd.associated) | |
50 | + return -EINVAL; | |
51 | + | |
52 | err = sta_apply_parameters(local, sta, params); | |
53 | if (err) { | |
54 | sta_info_free(local, sta); | |
55 | -- | |
56 | 2.19.1 | |
57 |