Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1238375pxu; Mon, 23 Nov 2020 15:36:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwL8+KwPK9PL2ZWZTAClnEyz4nLIJaAD9Gul23oZXZ3tvOCXrFyPNkUq7PWnwWxCyIil7T X-Received: by 2002:a17:906:7190:: with SMTP id h16mr1746564ejk.221.1606174602529; Mon, 23 Nov 2020 15:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606174602; cv=none; d=google.com; s=arc-20160816; b=LKdZqocx4rXF1qJ2g9PS1h/VyR5CwPh88f4qZek4hvVI1s+AmVvkpgDpa2dX7QqhoB i7QX8ewILYI24qpBrlBbkSLQhs0rQZjUXqHLE48q4YN3llYOybVgcNTH+almRWlupHq0 88oZTz9Ns1MdnNR1VzZZj5endb2/n4bAWfZsCadUkSANJMH1T+I+8preYKPJQC5bxF0W EuH7i190qsfqJlkdkl4DfZP+qww03HAGM9UHqqurN/w3sVS4vG2HNVPAsB35N66zsB8y O+ytvU+tN8vYKAPqdXhu5OtYMdpfS6ta47Y+AC5PROm/ZGkQSL52B/YBbz0HGJWF/uTS NdIg== 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=9Nhr3LybdRQgwRyoNbD5e0cj/e+TCX+4lizROYv1lzY=; b=wsDH7/M9QHFzx5g4Dy5JSbCRE8YwB31f6+OIqzhCzUrhKQ6Cu5vD3LxDOEwBrikI8W EIx00jY1e48oa+rH/5Qciw9wBfYpLEH2CDYQwrFcDOe9ZAxNwRLwrhbUFHOFwkfNARcT zXBAt8pguIBatoPytiSmtmX6MAReTfT0C1CEzx0ozsBz+DqXBIFlBbzXa7aFE7BrIMPz qpeg0XLUpWtg2XNFS6qv0ZUvXtzVMjR0g2bkoHjlvbAolMoVPps5ZvrQ/8DxTrGjTIoS lv5ArsuX2gyX0zLVRMaXIXt69kEvngg9jaqcnX2VaSMhq/n+GoYukLPbV47Xt+VECA7H Zfmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0tGckBqw; 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 j26si7344918edy.130.2020.11.23.15.36.19; Mon, 23 Nov 2020 15:36:42 -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=0tGckBqw; 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 S1731219AbgKWMd1 (ORCPT + 99 others); Mon, 23 Nov 2020 07:33:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:44668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731170AbgKWMdL (ORCPT ); Mon, 23 Nov 2020 07:33: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 9D0652065E; Mon, 23 Nov 2020 12:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134791; bh=a5VPfCgx+ZvYrOxZ08N88GWvxf4bGUowlK9tjl2ZcCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0tGckBqwmtUXMqJ8txrzlvXGICr3RLZoaKBwmorhjgpfg6KDFrtE6nfjJbXR9+3M6 K8BuTM1b3kgVx/iOXx1HEptS8MSH2m+mIB6VL3Bz/XWrscLYFM2hSl3m5cvuPiUab7 K1qmG2KP6NS1Yx1tFunQP36yMpIozHg6nbTFlxWc= 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.19 84/91] mac80211: minstrel: fix tx status processing corner case Date: Mon, 23 Nov 2020 13:22:44 +0100 Message-Id: <20201123121813.406089581@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 @@ -276,7 +276,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);