kernel_samsung_a53x/net/wireless
Lin Ma fb0e400ec4 wifi: cfg80211: pmsr: use correct nla_get_uX functions
[ Upstream commit ab904521f4de52fef4f179d2dfc1877645ef5f5c ]

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>
Link: https://msgid.link/20240521075059.47999-1-linma@zju.edu.cn
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:00 +01:00
..
certs wifi: cfg80211: fix certs build to not depend on file order 2024-11-18 12:12:00 +01:00
ap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
chan.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
core.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ethtool.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ibss.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lib80211.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lib80211_crypt_ccmp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lib80211_crypt_tkip.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lib80211_crypt_wep.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mesh.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mlme.c Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
nl80211.c wifi: nl80211: don't free NULL coalescing rule 2024-11-19 11:32:41 +01:00
nl80211.h Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
ocb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
of.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmsr.c wifi: cfg80211: pmsr: use correct nla_get_uX functions 2024-11-19 14:19:00 +01:00
radiotap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rdev-ops.h Backport mac80211 patches from linux-6.1.y 2024-06-15 16:29:20 -03:00
reg.c net: reg: Unlock all channels 2024-06-15 16:29:21 -03:00
reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
scan.c wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update 2024-11-18 12:13:21 +01:00
sme.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sysfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class 2024-11-19 12:26:51 +01:00
util.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-compat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-compat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-priv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-proc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-sme.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
wext-spy.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00