Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2454286imd; Fri, 2 Nov 2018 11:40:51 -0700 (PDT) X-Google-Smtp-Source: AJdET5fpjl5tjDlvuYZ4OdAMBogFApDAFCwze/wERRQWtIwVaf559QUfVEGQ1mZkGagIkjZK+/mP X-Received: by 2002:a17:902:6801:: with SMTP id h1-v6mr12628208plk.177.1541184051817; Fri, 02 Nov 2018 11:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541184051; cv=none; d=google.com; s=arc-20160816; b=IlsDLHz0/3iFBnJ2e16O4FDy0Gy671wBqtBygn2C4NqlPzHEQGDYtfzzmtEBWmxHyi Sw3iHwtZbbqFRkXFqmh0XukaYp66DE+lh3UCnwUyAOAfqixUmHXUSE4DeuThAEzqrTCY bK8YNlQV4h3N+SVJBg3AB22Lu3chTUGlANcj379xnLZaP+ccSIGFs4T8WbaXNPkDy9aG zrWw19rPUHAGadeC5mBI2+QeM/9pRbfRrHTJYXANAP688tm0uVWgJPgK8wCTKVSOjPtC L86uwbYEvR8cnx5tnUlVarvxwQGxg5buO9wymvgSnXqSJx0GWaFQBEpfG5/4pdB2w1vx 60wQ== 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=V7IcK58LpAcYeeLHu+sWqFQzSeoaBVUUAVkEIxU4Z9g=; b=kYZFrPoiUgiSCkaerHZUlt4rlX2NnUctoQqZc3Pc2tPqDDFaiPbuBJnFi0I5kSwPU/ je9ZtKV/QFSAXdapX36t8Q/Qv6PHV2L2XuN8LlA1VGtOFH2lL71AGmi5osIq/4L6v6Hs I/GAqDNOB+1YkGTuSjgY7iFYx5K4iIX+tajM+DjmAeHA1tCx3zDW/MTCvaerLuFU88OP qZkdxdx35d96jb7Z3eUF4sX+zXxNL5HY8CDdj3WV66NbC9X6Li+X9dgah0aYOGZBhnwc DgspTmbFa4I3KHyEpcOjQjnqBlGq/bNahpD6/UpJ3xM6vQXy9Fi6RZUTzzVqdxXM6gS/ dS7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GuTiYj5J; 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 g7-v6si22855573plb.426.2018.11.02.11.40.37; Fri, 02 Nov 2018 11:40:51 -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=GuTiYj5J; 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 S1729191AbeKCDru (ORCPT + 99 others); Fri, 2 Nov 2018 23:47:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:42000 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729170AbeKCDru (ORCPT ); Fri, 2 Nov 2018 23:47:50 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.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 1EDEF2082E; Fri, 2 Nov 2018 18:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541183978; bh=nzEoemtOrmyrnAcIV3sjAdafPN37gEUVyWnDqISvWmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GuTiYj5JwoScAZ9rB2Nuqepd4uZjz3eRKiw1Zv8hed29AqnEE6bS/WpKTgB/mqoJm SXw7sLCF5BjI/DXXjSEK/bWPwK3+x34ses7aMKV4DQMkH7X50XhmQMvuOQlbYFxiZC /0YIKvpmZs7c50zzYYgOxv8exJtnQeT4s3rsWRzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masashi Honma , Johannes Berg , Sasha Levin Subject: [PATCH 4.18 023/150] nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT Date: Fri, 2 Nov 2018 19:33:05 +0100 Message-Id: <20181102182904.705847770@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182902.250560510@linuxfoundation.org> References: <20181102182902.250560510@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 30fe6d50eb088783c8729c7d930f65296b2b3fa7 ] Use array_index_nospec() to sanitize ridx with respect to speculation. Signed-off-by: Masashi Honma Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 733ccf867972..3b80cf012438 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3699,6 +3699,7 @@ static bool ht_rateset_to_mask(struct ieee80211_supported_band *sband, return false; /* check availability */ + ridx = array_index_nospec(ridx, IEEE80211_HT_MCS_MASK_LEN); if (sband->ht_cap.mcs.rx_mask[ridx] & rbit) mcs[ridx] |= rbit; else -- 2.17.1