From patchwork Tue Sep 25 02:15:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 10613231 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 00B3E913 for ; Tue, 25 Sep 2018 02:15:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E033C2A0CC for ; Tue, 25 Sep 2018 02:15:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D45E22A1A5; Tue, 25 Sep 2018 02:15:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E0E12A0CC for ; Tue, 25 Sep 2018 02:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726318AbeIYIU2 (ORCPT ); Tue, 25 Sep 2018 04:20:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46935 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbeIYIU1 (ORCPT ); Tue, 25 Sep 2018 04:20:27 -0400 Received: by mail-pg1-f195.google.com with SMTP id b129-v6so10278418pga.13 for ; Mon, 24 Sep 2018 19:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4aX9RqGYEOpUqmN/JMdMOVPkrGv1L6UeKT+wuh3HtjA=; b=iM+99vVOPCxQto8A8NoH9mB88niLecNbHP6QPLtYSKH8PLVLRg2Y0zljeXNoEJvV01 raknAfZbrqppIS+r84/yBHKF1qRkAhK1M5xci6KhGc1Y8dyVx3PFIKyPky4djRtQUR00 gpXRYXh6OxcbZnrZmn+5jcnutCIZ7cETwhAOquRMyH2AUatsB3qqEjme/LAojAGQRt/5 aiMl2WVG4J1+Zo/tX47fdIu/9SJZEoJGLJiHYgeLJAmWgx10H26s3U+3EcI82UARZojW LFsmmXUJ/BW/FqI4ntBkm4IxV6ycAupAZU4BCja+PYx9VJsI52Yn8txYgCU3S9U8aGem m3/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4aX9RqGYEOpUqmN/JMdMOVPkrGv1L6UeKT+wuh3HtjA=; b=WNmvbl5HFRqVY0Hm4yS30ykF/eAgFLxfvZ4kITBp3Cxg4YouVFqtRavqf6oIPE7jjn VXp5ZSIFcBb1rDRTQdRunNpSeRNbBidPRgSeE/gEqsANjENtFHvfZhlzMv70k91WdPQJ tP+zH1W0bwfqwK8Bo0vTQtFLX7PWmTp6rLHQxmBDBbVInBeUf6jjm+VTSMKLUJ3DgHGJ xo5T/dnq3Yz20NGZKkH08jvGTj3z1pWgO6n9FtiJFT0fq6Lz7fwgWXc8RSiva6qznkk5 mBYiC3hZMfc/N7TWxYG3oHrFyux/gmInRH9Nrc9aw3w0vmmVYQIpd1fZMlBq89bXQnh3 Qr1w== X-Gm-Message-State: ABuFfohrvwkRJrXxPRSw1LJJUxwDRFAHOgP+6V0NXeeAB6pGErSt03+2 8Wb5J7jUimrKD+O91zb2cXfWV1l2 X-Google-Smtp-Source: ACcGV62xtF+riTwmINUXnnaJKr0w9MBqMz3I+TXwld1mV5pI9ORa9syRPUovP7gcTT2lGjeOLC7puA== X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr1277156pld.98.1537841719196; Mon, 24 Sep 2018 19:15:19 -0700 (PDT) Received: from corei7.flets-east.jp ([2409:11:321:2100:1e:7de8:2e95:9a06]) by smtp.gmail.com with ESMTPSA id p19-v6sm684865pgh.60.2018.09.24.19.15.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Sep 2018 19:15:18 -0700 (PDT) From: Masashi Honma To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Masashi Honma Subject: [PATCH 1/2] nl80211: Fix possible Spectre-v1 for NL80211_TXRATE_HT Date: Tue, 25 Sep 2018 11:15:00 +0900 Message-Id: <1537841701-3092-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use array_index_nospec() to sanitize ridx with respect to speculation. Signed-off-by: Masashi Honma --- net/wireless/nl80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 0827cbd..3c469c1 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3748,6 +3748,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