Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp200789imj; Thu, 14 Feb 2019 18:33:25 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibd9ykICaIuZ7h3xODr7SXBXk1Llk6T6hv3Oh/S9tmgCPFPRbM1gJCZE4BhwIbCLE8LBzvL X-Received: by 2002:a63:1a0d:: with SMTP id a13mr3081077pga.202.1550198005867; Thu, 14 Feb 2019 18:33:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198005; cv=none; d=google.com; s=arc-20160816; b=pp0ij8ww4I3ypBP/bdjk6BSB8MDIiN6RnWybQtk2EC66PrfEhFyZEQEdlblmRzDwGN pnXzQFOrZeGPtq936vfFrj54RZeCAoz9ygdDMXfs/kCkXswBZ+XATWvyaldIgJRxj2+1 BoaMHiaSPdM/UHldDrC0sopbxps2fVYRIwUtOyse4w5qHBTkA6fDEQ1GLZ7UhQzG7pKQ pVTH3D/83QvEOdsJhZ7qrdprpZ9+Fox6p67OMPWH1jby7nO/8ZkOvmWp5yGq6XwpHfn6 WSxfC0gTdjRFJXR6Lx69ZQ6G/87Jqrif/xJseV/taeviShW74CvIgCjxT9eCJXp6terI Cp4Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QLWJ0s/9fx8S43L0XZRl+aYhHEsEsXji9jqd88htNoU=; b=M72eNfV3bCgL3oRW2PojSm9FHZxyNs2Is7LYnLXWvxvKmlbXVjti/qXhSnSp59aeUF akLJ4W1+YOOeE1eYwxrwTgaL84zjC5IhpOMkcrEgxdmk4Cfh7lvIIiWnY/wBJsxYitlE bjF7FbEtIHmG+e3WQdphT0YPeSCT1MQlRXWDQL8yfDi9T3S/KgsqBnlQYMu4wSQXw3jp jpLU/fJS3Eu5HYnFgOBBBFEQeSOXfjgwak4xPSuTJYQT6WrY371z4cHhGV2gXBIr6pGl +ZxWB+PPFqqiHA6JeRNwup7o0bCwytY/c1gI7s2SXbWDmtoAM4mPfgitpF1q9xQyaQyq tiLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I4v+ubAu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f6si3856792pgc.509.2019.02.14.18.33.10; Thu, 14 Feb 2019 18:33:25 -0800 (PST) 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=I4v+ubAu; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406063AbfBOCQw (ORCPT + 99 others); Thu, 14 Feb 2019 21:16:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:55612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392197AbfBOCQI (ORCPT ); Thu, 14 Feb 2019 21:16:08 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8C0E21934; Fri, 15 Feb 2019 02:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550196967; bh=Y9o8KsB+a9lG2Xg8g9q5V6wwNEdFY1dlkRFiCB4i6Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I4v+ubAuhNJ9s7kGmqGe52VFKmsbRaWz6Y3+mKKRNvD6Uc/n7Wbufm2RjS8CkGLb2 uhhaFeoIVUElwxhdr1hUYJIJecOUPxw0NCtPlp1UOn0XMYF+d31h3wFRe+5odKB5im mbEJzjQqVb+LuXU40ZL5G5OvKH05U7anJ4lajySk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Balaji Pothunoori , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 3.18 14/16] mac80211: don't initiate TDLS connection if station is not associated to AP Date: Thu, 14 Feb 2019 21:15:44 -0500 Message-Id: <20190215021546.179605-14-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215021546.179605-1-sashal@kernel.org> References: <20190215021546.179605-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Balaji Pothunoori [ 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 6ba5240dd61d..ffe319309d03 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