Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp829598pxu; Mon, 23 Nov 2020 05:22:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3Z6+M8YV8LGR3k7G/cpODALBBMxuqYG0arEDq1Rf2cHFaMiJ5BNwiAHfHANn2Jr373bX9 X-Received: by 2002:a17:906:3782:: with SMTP id n2mr45592025ejc.493.1606137779705; Mon, 23 Nov 2020 05:22:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606137779; cv=none; d=google.com; s=arc-20160816; b=H5wxfnA0Wk7Ya5P2SaGCpKQwSG+DmO9SyQv5XMWRXZOJ62xnk6oDbRka3V1+Lg+gHr 6drJYvl1aiCjiZ4MzKERlpFaGZYKC038qGoBhtvMS5IfmsQJMaWRfxAB0owkT+Pw5KJj uX4fsURQFKEX+SPkixN57crzUexEMiKjoG21EXjpLktyEVW3KtvZOY+RnmKH+m/gQ9Q9 g5dT4LOvrlmACngGRhSIdx4UT7J8z3hZkz3aE4Y7H5332hMb2W1+wh3GQb6srsdIEbDo HOItGBqX4UipIq6mwDjR8pcUg4bo+c7bnhLexuemf5zVBUhMe7vyQGunjzPl2S6U3hKI dgAQ== 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=7r+T8LhiYDIFAHbaPvBrQYQwxcRWLvdqTbQVE+0m9eY=; b=yOjbqdLd0ZVMR0Mp6kxfEPL5TycuzJvwtIirQ4p1ZBsDJLEY8NMWOOmwv3v0BR7b1O ZMeMnSuvwsveYnzZix1kJDuZTL9fKSzGiO4wm/9+SQ9ntQpgl2LOIz2ciDxTpGez0nSD Tme/f1MG/2Xav+L4rE2rgPRmgYQFBvJTNwCpd2lr/WrsXmxGK/j9ZpU/AYA9IsmjxLWF qiwguzI30RVYcLItjiWZGEOUaOZnXb3GUDFoBNCqM0WRLAXM9wi+SpPt4rdXPLqdqPSv G/LMYYkb68SVIuTZNLb+kA2Rw1OnouAVxCumFAY5FLYHB0K2oRCr77qx8wDFJk9vH50Q vgaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kJ9rywFc; 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 e17si6787865edq.469.2020.11.23.05.22.37; Mon, 23 Nov 2020 05:22:59 -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=kJ9rywFc; 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 S1732408AbgKWNSY (ORCPT + 99 others); Mon, 23 Nov 2020 08:18:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:52888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732417AbgKWMkJ (ORCPT ); Mon, 23 Nov 2020 07:40:09 -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 E285E2065E; Mon, 23 Nov 2020 12:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606135209; bh=JLQWrrUwT4ql2E8ef7oDROak7waEQSlL1oPIRGDx4Xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJ9rywFc9i4QKXM686EOI6PxBTxpA95XnikCyfwUr8FmxGaMdPFZR9QxtHpl5PIaV yS6zGfA7kK+t7CDuz1+lHnRHQDKCQAxJdh0ZSgNlX3AUIEur89mnRvE6C9l8VV2jQy Mr2jrLkh/6XeYltAaqbZJedXW5e90yhzXwxtBsKo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Johannes Berg Subject: [PATCH 5.4 144/158] mac80211: minstrel: fix tx status processing corner case Date: Mon, 23 Nov 2020 13:22:52 +0100 Message-Id: <20201123121826.877671154@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@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 @@ -270,7 +270,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);