netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Lin Ma <linma@zju.edu.cn>
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
Date: Tue, 21 May 2024 17:29:04 +0300	[thread overview]
Message-ID: <87jzjnnsr3.fsf@kernel.org> (raw)
In-Reply-To: <20240521075059.47999-1-linma@zju.edu.cn> (Lin Ma's message of "Tue, 21 May 2024 15:50:59 +0800")

Lin Ma <linma@zju.edu.cn> 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 <linma@zju.edu.cn>
> ---
> 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

      reply	other threads:[~2024-05-21 14:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21  7:50 [PATCH v2 net] wifi: cfg80211: pmsr: use correct nla_get_uX functions Lin Ma
2024-05-21 14:29 ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzjnnsr3.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linma@zju.edu.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).