Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3385711lkq; Mon, 23 Nov 2020 04:30:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwOxppP3z8SAauZyKdlVIpjR4TjsnYm363aYXD1dADrksk9NBLl7V36FT0kqhCL1dE8tlvS X-Received: by 2002:a17:906:4e4b:: with SMTP id g11mr23601208ejw.244.1606134611444; Mon, 23 Nov 2020 04:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134611; cv=none; d=google.com; s=arc-20160816; b=PycdrwaoQ6rFAuNU4UDcH95HbA3wN2GfWYFxiFVIlEQ2vrh7bsx/yuKOl+xVEzkwmG cNSmgv1fUeuUwMF5L4MYYcLeE72HtCUyB5fBi/4bqHEVasPsBprnS52I1UYQSCap6Rc1 OFiH+6CKAMVGb+7twHZDgFNn8q78vulF6Fm7DXxqctn1NiltSla+DqXvl20DpycJZz5Q QFaTsXQNTJxKyBvfTTiP2sjklNEUgJF1BGyRle18Hvnkwwt0lByLR6D2dqgtENJLUeu4 awGXKQCAf/WPPbbN1E5Oar654GLOacAAS7Pe+szNy8MkRiS/UCyyR6At2r1k2MBgSJSZ oj1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vWzjyxfhsFhu2VmT3uHti5cP0BM2OgPWH4AXFRyI2T4=; b=R83oD4QYjjeXnwZagvqXCYue/kpBQyV3lBlgWKVJXCRdFUlbm3e1G/UZmoXyBx0bOf zkKmmquAxsr9gLnLkD2Ry+m3Eoz79lJItq+i86GQJqiNAkMEHBziKBasSGS4y/30YowP IkF9cNUhNLQ1Nb5pA87B4lqkknKc3lUywN7Xc9XUKLEK+zVuD5l4q1iLN9qupNWVGbwJ agXrscrGtkKEm36qAtxqKbCUsz/oxvkwNPDJTD2qztTHbp9iJqrXnN0huXnW60+onKp6 XBSvwLgQEKC3DcKoIGvJb2Q+tE/ykjuhGpa346aooukF6t3ADy8VbhwPFnNgjDZwSR8F kQ5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IOqRXjf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ca26si6532954edb.116.2020.11.23.04.29.48; Mon, 23 Nov 2020 04:30:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IOqRXjf1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730119AbgKWM0O (ORCPT + 99 others); Mon, 23 Nov 2020 07:26:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:35964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730109AbgKWM0L (ORCPT ); Mon, 23 Nov 2020 07:26:11 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 92A1220781; Mon, 23 Nov 2020 12:26:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134371; bh=HeojfOZ6wP/5ai0cJ0vvsBGZEVopctrrvmzK5hPJf1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOqRXjf1cUV0lILHYlKcP+HmPSFzJ12f/0mTQxokSqIHcDgRYBRpX1DArsJaGrx81 S9dDM11ZxgQtwtjMegRkkfQIS3/r10g+3sWLPIxRG/MaiUSSl0mVF+lnlNvfayCAr7 N5vxd7PaGxFYs6mMpXYhDCb8t6dMlaic7WURXRf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Johannes Berg Subject: [PATCH 4.9 44/47] mac80211: minstrel: fix tx status processing corner case Date: Mon, 23 Nov 2020 13:22:30 +0100 Message-Id: <20201123121807.686294075@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121805.530891002@linuxfoundation.org> References: <20201123121805.530891002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau commit b2911a84396f72149dce310a3b64d8948212c1b3 upstream. Some drivers fill the status rate list without setting the rate index after the final rate to -1. minstrel_ht already deals with this, but minstrel doesn't, which causes it to get stuck at the lowest rate on these drivers. Fix this by checking the count as well. Cc: stable@vger.kernel.org Fixes: cccf129f820e ("mac80211: add the 'minstrel' rate control algorithm") Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20201111183359.43528-3-nbd@nbd.name Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/rc80211_minstrel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -274,7 +274,7 @@ minstrel_tx_status(void *priv, struct ie success = !!(info->flags & IEEE80211_TX_STAT_ACK); for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { - if (ar[i].idx < 0) + if (ar[i].idx < 0 || !ar[i].count) break; ndx = rix_to_ndx(mi, ar[i].idx);