Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3287317ybb; Tue, 31 Mar 2020 02:08:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtg5m+UKiv7jTKUzFutWEUZA7l6DG3Pwp+lQqtwvSF8V8dKfdgWn69TL5115EFBHK9+2nhi X-Received: by 2002:a05:6830:11d5:: with SMTP id v21mr938223otq.91.1585645719047; Tue, 31 Mar 2020 02:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645719; cv=none; d=google.com; s=arc-20160816; b=T+JNVfwOhxnWmea0JgqByKrDaAyah/cfK+p7ndwfwyhkQFQbtBfKzNJiZY/DIfdd3y Efh9E2tanG6vJ7dO2zGX41o2qN8kYpI50O7IfJhdLcImIZ/oqCUshWJKSIHCPLiWZIeM bYrMeyIeC68Bxk506aRo4PF7nwUhLGkJj0ih8pEfUJ3pB2n5HQFQVoxHzfdm4DXLEwPC 0zbDzYjPfPwo7HORf0nhSdVhh7HSKLsMUOrGZxEIWm/In6SFbLAj7Aef5TTaTryJYJuY sM5v1PprDHj/Dyxj0EDFdBKs2lP5Eg/X/HtgDTDx9qPTHhUClcpdnRHxssf0KOgST0Yu 7VkQ== 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=AXl0/5egNR6J3TbfIK4HPORkk7vnmfyZR7rxzvnu+5k=; b=tWpnItD45m2no1SYVscHXkDPUJpBO3fcxmdd+7+JCcsl2/aYWJtBrQd5Vxg4lm7Tm/ kPsViD1NLhLBdcedyyxUbUXj7fQz3pk4x6FkMCpUBz1D/UMaG7Vl7h8ROcZ+GUJhHMtL KJ/t6wpcrlBS11gJix+MQlXGQ0OSu8ufu5v0ERjyK/nDXg1R/Hmh1y3rx0yBXJEkJBIB fSJeUcd5SpSVrInmQpiOATmqCi+l3CDPKwRoer6p8mzNqEAARmie1Oo3o/YCede4nYWR EODGeJqXV9u0vKP7IJNJ8JJJ2YFvttJykws+ppggnTpe9LK/L0Ef/Kte/9tPYzKAWHZG 3GQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bCIcDXXM; 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 e17si7365653oti.82.2020.03.31.02.08.26; Tue, 31 Mar 2020 02:08:39 -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=bCIcDXXM; 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 S1731319AbgCaJIN (ORCPT + 99 others); Tue, 31 Mar 2020 05:08:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:50404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731314AbgCaJIK (ORCPT ); Tue, 31 Mar 2020 05:08:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 C58EF20675; Tue, 31 Mar 2020 09:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645690; bh=+1xLu4UM8eC0DtDYdw0C89iwUWF2tSN4pL1u48vjWDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCIcDXXMaeHxhTFL6TW6le+adUKW6OKRuC5p6Y2gS1EGMbShDw0wcuFmhu7QPcn5t 3gkyeKQpdw1gm4WX308FKVaexH8jUmYI67uzipsUTrPYm0Py/yWv/PtX1DSZkjvUoY yw+ikrXbMuF6rh794GCO82We2K7FEckknxOEq3N8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg Subject: [PATCH 5.5 133/170] ieee80211: fix HE SPR size calculation Date: Tue, 31 Mar 2020 10:59:07 +0200 Message-Id: <20200331085437.747111522@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Johannes Berg commit 575a97acc3b7446094b0dcaf6285c7c6934c2477 upstream. The he_sr_control field is just a u8, so le32_to_cpu() shouldn't be applied to it; this was evidently copied from ieee80211_he_oper_size(). Fix it, and also adjust the type of the local variable. Fixes: ef11a931bd1c ("mac80211: HE: add Spatial Reuse element parsing support") Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20200325090918.dfe483b49e06.Ia53622f23b2610a2ae6ea39a199866196fe946c1@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- include/linux/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2102,14 +2102,14 @@ ieee80211_he_spr_size(const u8 *he_spr_i { struct ieee80211_he_spr *he_spr = (void *)he_spr_ie; u8 spr_len = sizeof(struct ieee80211_he_spr); - u32 he_spr_params; + u8 he_spr_params; /* Make sure the input is not NULL */ if (!he_spr_ie) return 0; /* Calc required length */ - he_spr_params = le32_to_cpu(he_spr->he_sr_control); + he_spr_params = he_spr->he_sr_control; if (he_spr_params & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) spr_len++; if (he_spr_params & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT)