Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp577406img; Fri, 22 Mar 2019 04:24:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvS5c9f9kMdeRyivhahBXq1rvv9X4Gskl+is1Al0cjQWBntsAB+ps8c3uS1osu5nzFfm7B X-Received: by 2002:a63:581c:: with SMTP id m28mr8259897pgb.332.1553253873164; Fri, 22 Mar 2019 04:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553253873; cv=none; d=google.com; s=arc-20160816; b=D2U7iJvRPazTX+FPVYVeQEOwJycc+K5/1AdNarP773levOQQtPfzRYhIdyRmmUNY5J bYUlLj3cdfCjIFuTIwJO5zOro7tTSII8IAMrzSbYJruO/Fyd7Ob/G9Sxr+71lnNTlTP8 ANAYqxQn0GalLAVyGmuBd4+NtXDZRADR/GDSIrOxggcGTvjAUQfOkvNiG9xKGVA5aihP tpSDs2P1kfqK9/dJe+GVM2RVOZ/jQDga+3Bb8W7rB18L7PwrDzW8ghgRVcMMusUMFs80 ndDIELRDqIMTAWLGDIHePAQcmWgicynh4pMqmwNzwuUmlWHX8rWH7p8SVj7FdC6Uxvbd 2JEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LJbzLvEDxwihBgqeFvNDzBktUdQ+fbAWlPvGwge/TzM=; b=hTM7ZAaQ9f/PjxtRwChXcXDwcwizubIq5hAl2WcQzImTE0NzbWQHIEB7/VhYqjIATU JWqJQj7kfc8E1CkBGg/GyfHMyQYySDB5JheKLMYC4BEKwRhp4a+FwIkypd+9828zcXmm U7WeFDnQNpfJu+tmotC/xIE8UX64pN4fZPNroyYkRLsPWAGMI4PzWzdfOCJtfXY7XEA5 6oHo8R7JrdaHllQ3nyTJDA6iY8zaikSGpmW5MwLrSr2R7tI5ZRCSZijkpOxFnLpow0T3 iBZmDeMV+bkCMf2jvvepwwEYUby6JgZi2Xm/PSpuew2WLswBgXZa1D9t6QwnocsnYoNT lXMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=St+VPKCf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si6943397ply.103.2019.03.22.04.24.18; Fri, 22 Mar 2019 04:24:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=St+VPKCf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728869AbfCVLWu (ORCPT + 99 others); Fri, 22 Mar 2019 07:22:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728855AbfCVLWp (ORCPT ); Fri, 22 Mar 2019 07:22:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41A14218D4; Fri, 22 Mar 2019 11:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253764; bh=/AGrJ3CGZGLNpqMxBlYCc0WN30z+AN2SqmnEykwq3H4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=St+VPKCf/4z3xXl54FSw5ONEXUDx69gZZ0R9dUweffLk+o6WywuYjfwVZ36Xcs/o5 QS/4LdS6sOXJXC7xp10S89EuYJqxeR7zN7HyVvx6pzPeTfRK8x489MuIUDaICTf2Su bjIHrrwvIVlBYm/TWmzWM4ZeQdqgEvTa13xDQICs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Balaji Pothunoori , Johannes Berg , Sasha Levin Subject: [PATCH 3.18 038/134] mac80211: dont initiate TDLS connection if station is not associated to AP Date: Fri, 22 Mar 2019 12:14:11 +0100 Message-Id: <20190322111212.535031291@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 7ed5285396c257fd4070b1e29e7b2341aae2a1ce ] Following call trace is observed while adding TDLS peer entry in driver during TDLS setup. Call Trace: [] dump_stack+0x47/0x61 [] __warn+0xe2/0x100 [] ? sta_apply_parameters+0x49f/0x550 [mac80211] [] warn_slowpath_null+0x25/0x30 [] sta_apply_parameters+0x49f/0x550 [mac80211] [] ? sta_info_alloc+0x1c2/0x450 [mac80211] [] ieee80211_add_station+0xe3/0x160 [mac80211] [] nl80211_new_station+0x273/0x420 [] genl_rcv_msg+0x219/0x3c0 [] ? genl_rcv+0x30/0x30 [] netlink_rcv_skb+0x8e/0xb0 [] genl_rcv+0x1c/0x30 [] netlink_unicast+0x13a/0x1d0 [] netlink_sendmsg+0x2d8/0x390 [] sock_sendmsg+0x2d/0x40 [] ___sys_sendmsg+0x1d9/0x1e0 Fixing this by allowing TDLS setup request only when we have completed association. Signed-off-by: Balaji Pothunoori Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/cfg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 6ba5240dd61da..ffe319309d033 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1194,6 +1194,10 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, sta->sta.tdls = true; } + if (sta->sta.tdls && sdata->vif.type == NL80211_IFTYPE_STATION && + !sdata->u.mgd.associated) + return -EINVAL; + err = sta_apply_parameters(local, sta, params); if (err) { sta_info_free(local, sta); -- 2.19.1