Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2296954pxb; Fri, 5 Feb 2021 14:12:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzL8Cy1s41K14n2VKP0phk0hKb2YW2WTnoH3upioBVzUnsMYCFEi6G4R2PyYwbNsrSbZM+X X-Received: by 2002:a17:906:158c:: with SMTP id k12mr6093084ejd.119.1612563162274; Fri, 05 Feb 2021 14:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612563162; cv=none; d=google.com; s=arc-20160816; b=tTI0miE929gFS4Ew/cMoDOgRvZcWKw+zIG833z0NsmDa9cyhHeCGZMxz/Opo78wkpf Z0qBfhBbZOMn6mXB1CGNlqmSOoMwWPOpIKdBPdHRa0VD9VAXT/b3KVLJEcDVQCFVhDu1 ORUXg7957DUsUYcRPTXzomNgXnq/gCtHNuwxzAcd3vPGfD8RNtaYX61Okm9RWWWls379 N6BWwAa/EKpcOYKBKz0Hi7nEqtHNOsKG5Z5OAFHJgz09JohysfxLSKKcCFlJ/EDpMdcO DPRvCO6Fs5RYsFAEVoF5koC/1B6nY+MiDVGZJTplm5HG/v91c8tgsFL/afEelGyVdDUo Bn5Q== 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=yDYAmNyO5iVoqSFkXe6L7o861pmvHnx8MSp5LU4AmHk=; b=C2iiywphsTP5Nua1Pbcg9ErPc6vOGiYA0MjAN2GQvsh/auCZ4QMnP68XMjAeXD68l+ GtE2dm7ELdgfo5T0U4kymyCtOY5sf+fJzC4j7QegCSnWzgYLp0HzPSY+om7R+RSCyCsj I/zDJBEXnIJS5bSHII1prDaX+Svao0g6uUZqDd1zP3utvJ+WUjNoVJeu9gE2uh3Uydiv aptKUe4u3juCLSZMk/DLTZu3kcxp/XbWPobIqCDFhKfGZ22he3okNRJLOBO2XPUSpTB3 Q6dC2VtfZTbvaRq7zarEWC3Pn/IwOVEfgKGHNLBI2o6fwoKb7ohZuZr1ZDihQhGW6MIn iFYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CQM4rJcM; 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 he18si2163763ejc.699.2021.02.05.14.12.18; Fri, 05 Feb 2021 14:12: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=CQM4rJcM; 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 S231810AbhBEWLn (ORCPT + 99 others); Fri, 5 Feb 2021 17:11:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:45250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232942AbhBEO5X (ORCPT ); Fri, 5 Feb 2021 09:57:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B8A4650B3; Fri, 5 Feb 2021 14:14:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534470; bh=9fMKtInmWq7RhAaImznFoCR4n1sZdP2RPNNb1gM0Cqo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CQM4rJcM6XHQNo3TbGUU7QJEfbEvI6K6xgZdC/ZnqlIKDRRucGyHn0a3O0ket05ty flraC98vZsHQ4rAJ8/RSyjAp27BuhGiH6TWpkbp2B1rbHiNamsLfET+X/jk1Y1ucon cJz4ol2Ul/LD+d3gEfPoUPPPe6hviidE9fYbDIXg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Johannes Berg , Sasha Levin Subject: [PATCH 4.14 12/15] mac80211: fix fast-rx encryption check Date: Fri, 5 Feb 2021 15:08:57 +0100 Message-Id: <20210205140650.229598170@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140649.733510103@linuxfoundation.org> References: <20210205140649.733510103@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 [ Upstream commit 622d3b4e39381262da7b18ca1ed1311df227de86 ] When using WEP, the default unicast key needs to be selected, instead of the STA PTK. Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20201218184718.93650-5-nbd@nbd.name Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 04ae9de55d74b..48c6aa337c925 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3823,6 +3823,8 @@ void ieee80211_check_fast_rx(struct sta_info *sta) rcu_read_lock(); key = rcu_dereference(sta->ptk[sta->ptk_idx]); + if (!key) + key = rcu_dereference(sdata->default_unicast_key); if (key) { switch (key->conf.cipher) { case WLAN_CIPHER_SUITE_TKIP: -- 2.27.0