Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3134561lqo; Tue, 21 May 2024 07:51:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwovv6Cqp7FrOTSs9HW/oiXMMMPAUmUwwJeccNStJgat6yQu5yGRiqiGCqOVsn1Zjh0tdQ8wUCtRO2dmF/uGyfZq+W5sVNb56zgQT1SQ== X-Google-Smtp-Source: AGHT+IEOVtFNcySCyYwWlZUrAaDyWTE7VoRSuMvldI8cv4OarO/9elDu70SinBuHeV//F9B9jdNo X-Received: by 2002:a17:902:930a:b0:1eb:7dc:709a with SMTP id d9443c01a7336-1ef43e2966fmr369305635ad.40.1716303069992; Tue, 21 May 2024 07:51:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716303069; cv=pass; d=google.com; s=arc-20160816; b=NN8ehzHOeUULEQ2ruf14Dv01f2FnoDzSHnySsjhTAUDFMu6Hn/C9NbMGcbcSurV//U J8UAPoMMY8JQwtemQYI78ckjmNb40rOXY7xVRzeuTfrX53UXCX/6SwhMAZUBdC/B0Q0g h6u7v20ZZ9PnDi7KSpUP3xlTojiyPQE1/aAuMf96N88ZZxUHMfuUQBQ8TucHPkOOgjQH 0iykXhuco1jFnvv+PbLEP7ejHibXUPcDOSrM/8dxbZzXKFfd25k8WyvVQ0XNLj44UJ2s 48NsWkyqhMfRF2pSTssZ2/dlDyIz7OQdiI4SzRUlu0pxdXZ3vjo21tp9+TrupKv5fPed 9pqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=nkB1qYGyFtRVgzEqA7YLkeet9Bp5Ao1tzuWStABpghY=; fh=zpB2IRrvtBLhJpr3oKpKoTOstoQgxs5gXHFl+iQkoqs=; b=n8SFwSZ4OzhN0dozK2BZty6d2BwtYpaQrO1y5OeeE8kfsWM5refQeQ9B04J7aGFUBp li5noc48YfKpuSj8Rx0nIVL9EwnfZNNRRrlkqA7Jf+25rxfvK8PAtsOV0L2yOvpyPB3f Nv6Q43eZC+SP2a4oqtInPG2sQaCmTRUJjFZeg+6b9aNSjChSJ0bWsZlXIxS3n6xZdOmg fnM9rM3NixKFYQ4YYBgnRd8iKv4VK6z7ySQ6Qpq7hCZdeQIsahpJS9E7DPYu6lRxkQ3W ejG9ZLZHa//8BlnbmvsNZHpw4HnYPTvCHsSlGTV+TJuQuA6AmN4Rng1NFT8vSj1a0h3n l42Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dfrQs7E9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c037200si9749485ad.330.2024.05.21.07.51.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dfrQs7E9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-7901-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7901-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 42A29B25568 for ; Tue, 21 May 2024 14:29:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9892130A41; Tue, 21 May 2024 14:29:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dfrQs7E9" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD8571304BA; Tue, 21 May 2024 14:29:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716301750; cv=none; b=lI/SWp6zHYlX8KlPWpPxGCquwl5HU7lHuKxqwTfJvFS5IxL66pHAVPBlXUQly5RBR7iLhKKZDqnIPRw/6Anw2NPs24XglSI9cNygzAoWHynBaha0Udl62ri26mDtijDgp1zrjAEI20dhsXtShmp2P8ELpGLDpt5Q9xR5dzLAOjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716301750; c=relaxed/simple; bh=Fu9p9Il+lHWvAaKZCxwSLybjKw+hVxEYoGb2TSR6kTo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=VXQ4ZGAJFgf3/ndSDITWNO0qgmKykgUdcQoGWx8nMdxXeAlZ4GZNfvNFKSXL0nZg5uCphFfTY1Uxv98N/Tremp07qoiscWeTWGrYlsrIjwj1k/mavQEfd1/s6fOLiZix4DAAu6pIU7GpiF6yLN2Oq+yae0ZdmU1uzEQ+BgbTWlI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dfrQs7E9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62829C2BD11; Tue, 21 May 2024 14:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716301749; bh=Fu9p9Il+lHWvAaKZCxwSLybjKw+hVxEYoGb2TSR6kTo=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dfrQs7E9sX2oHjAle4ssovB93neL23QrrgNDQlGRBQ0NYcLBrcO6+eBBe0Wsrq2Vv DlHFnCuIbz90VOm+BvLPdFN+UfJFEUM8uf6McztWZm3mmhgKtJidsuxWsvv+p8FtIR eyVMhwgEHvPD4B3MFeu1x5hVMUU29FjqfAUzUH6LHT6o/Hm+2i0A3sNXvMdNNTjxt/ d1ma3yuUh7vRuEKXolpggP+9VgQGkq3KhCu+hcPQNABHuhQYVC9z0Nod6ww9ZXQIBB OwzTllk0GQcnhtP8FdjRR36nayP3tLhGHBe2RFxw0wLXmdrrCGnc/MIDqTiSM2vhY7 9E0rMpFAy3Siw== From: Kalle Valo To: Lin Ma Cc: johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 net] wifi: cfg80211: pmsr: use correct nla_get_uX functions References: <20240521075059.47999-1-linma@zju.edu.cn> Date: Tue, 21 May 2024 17:29:04 +0300 In-Reply-To: <20240521075059.47999-1-linma@zju.edu.cn> (Lin Ma's message of "Tue, 21 May 2024 15:50:59 +0800") Message-ID: <87jzjnnsr3.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Lin Ma writes: > The commit 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM > initiator API") defines four attributes NL80211_PMSR_FTM_REQ_ATTR_ > {NUM_BURSTS_EXP}/{BURST_PERIOD}/{BURST_DURATION}/{FTMS_PER_BURST} in > following ways. > > static const struct nla_policy > nl80211_pmsr_ftm_req_attr_policy[NL80211_PMSR_FTM_REQ_ATTR_MAX + 1] = { > ... > [NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP] = > NLA_POLICY_MAX(NLA_U8, 15), > [NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD] = { .type = NLA_U16 }, > [NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION] = > NLA_POLICY_MAX(NLA_U8, 15), > [NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST] = > NLA_POLICY_MAX(NLA_U8, 31), > ... > }; > > That is, those attributes are expected to be NLA_U8 and NLA_U16 types. > However, the consumers of these attributes in `pmsr_parse_ftm` blindly > all use `nla_get_u32`, which is incorrect and causes functionality issues > on little-endian platforms. Hence, fix them with the correct `nla_get_u8` > and `nla_get_u16` functions. > > Fixes: 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API") > Signed-off-by: Lin Ma > --- > V1->V2: add wifi prefix in title, > mention the policy that defines those attributes as suggested by johannes > > net/wireless/pmsr.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) wireless patches go to wireless or wireless-next trees, not net tree. But no need to resend because of this. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches