Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2155657ybm; Thu, 23 May 2019 12:16:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDVf2eTFJgWt01ZZa2VIqECb/8TfjKE3OSVNPr+MW4MVPLSwdWHIOcNBsdZwbaqOi3olN0 X-Received: by 2002:a17:902:70c7:: with SMTP id l7mr13254650plt.47.1558638983212; Thu, 23 May 2019 12:16:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638983; cv=none; d=google.com; s=arc-20160816; b=Tql9XDFVbCL0EVRq0yXU055mYeuq741Axflds4E5Os1OXNTa1pFFk3H5BKTkQGXWbq I5Syjqa1tGofD4IndY5Vwy5sDWlPbrPwSqQq1DPMQoNGa0BfKybRYjStGa+letuRs0MU TNx+jv2hqOVZAgS9/tLVCG/rIwm+VwpxFJaKMhQoqwCgb5f6on8pkr9LV5IK03O8+Tmg 1YRv+wCqJZ0B8uvpLMXi12mxcGlxGFPEP8pMjsAyR2n5I2yVFJOm4CF/WKfpFZhnDeLb bFc8h3x45j565SefpHBSvSwziviYw24tfW3jH5eHuSYV8J39HqPMPSFCFEZvYm0RkzeR 70LA== 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=PYujZrpVlCsrCL2OcTQLXF/6Jebrf4T0By/ysHtiA5c=; b=pCkKdH896kGIw7K8WWnQeLzvYMrTyL631FY1ruhHnx/br5nOb/XRDnyzEvDNjzGdWZ FGC7B/5DbpXIqArcQqjb2sEpaQm/VpjL8nbHMwLRo1zfRBsPLw9rtcJZYRs0ulpGkaLg piqqDzns9wxlg48mkPsrz4Oj/Ope0ltjviPhI5qVo86zOfnx2gEIIWg4s/3/WAznVZlx 0Ojp4DIJSfZw/bb9nwy8MBwwj5yFLMYQcWjXG/QBxD5jem3H8oJrFQS84voPowS3SOQq 2X11KnuC7LGTk8G08zggA3A8TaVxof8jmzgUEDnjy0b4nc5+CeHvuKZ4jbIABt7ReIza +JkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UG0wnO4A; 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 n43si376216pjb.20.2019.05.23.12.16.07; Thu, 23 May 2019 12:16:23 -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=UG0wnO4A; 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 S2388506AbfEWTNI (ORCPT + 99 others); Thu, 23 May 2019 15:13:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:46948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387921AbfEWTNG (ORCPT ); Thu, 23 May 2019 15:13:06 -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 1F97E217D7; Thu, 23 May 2019 19:13:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638785; bh=QUpdGt6ebGsGSafMqL+BLhTHSI+Qz6jsqf/naCdPraQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UG0wnO4A602YpcOw7FM4hZ/P3XYN7FobD2chWJXSTiFKng5mVT0FIOvudXLXu5TzT 4KFdqtpibCqW7SOZH0NigfSw+2AWUvHCasCqkqTkXxrCsfjrEfbWNb8nUSY5KhO2M6 tRB5Au+Zg1mE+Urb7pg3iBbnUQXfT6fNHcDLJyFY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bhagavathi Perumal S , =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= , Johannes Berg , Sasha Levin Subject: [PATCH 4.14 64/77] mac80211: Fix kernel panic due to use of txq after free Date: Thu, 23 May 2019 21:06:22 +0200 Message-Id: <20190523181728.834027065@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit f1267cf3c01b12e0f843fb6a7450a7f0b2efab8a ] The txq of vif is added to active_txqs list for ATF TXQ scheduling in the function ieee80211_queue_skb(), but it was not properly removed before freeing the txq object. It was causing use after free of the txq objects from the active_txqs list, result was kernel panic due to invalid memory access. Fix kernel invalid memory access by properly removing txq object from active_txqs list before free the object. Signed-off-by: Bhagavathi Perumal S Acked-by: Toke Høiland-Jørgensen Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/iface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 222c063244f56..6ce13e976b7a2 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1924,6 +1924,9 @@ void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata) list_del_rcu(&sdata->list); mutex_unlock(&sdata->local->iflist_mtx); + if (sdata->vif.txq) + ieee80211_txq_purge(sdata->local, to_txq_info(sdata->vif.txq)); + synchronize_rcu(); if (sdata->dev) { -- 2.20.1