From f1fc9cf74e02aaeac0ed06147f6e58606d87383f Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Tue, 19 Jan 2021 16:28:28 +0800 Subject: [PATCH] nl80211: Fix the size of the maximum MAC ACL size NL80211_ATTR_MAC_ACL_MAX is a u32 attribute to advertise the maximum number of MAC addresses that a device can support for MAC ACL. This was incorrectly used as a u8 attribute which would not work with any values larger than 255 or on big endian CPUs. Fix this by moving from nla_get_u8() to nla_get_u32(). Fixes: 3c4ca36330c0 ("hostapd: Support MAC address based access control list") Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211_capa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index d3d43d48a..cd596e311 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -891,7 +891,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) if (tb[NL80211_ATTR_MAC_ACL_MAX]) capa->max_acl_mac_addrs = - nla_get_u8(tb[NL80211_ATTR_MAC_ACL_MAX]); + nla_get_u32(tb[NL80211_ATTR_MAC_ACL_MAX]); wiphy_info_supported_iftypes(info, tb[NL80211_ATTR_SUPPORTED_IFTYPES]); wiphy_info_iface_comb(info, tb[NL80211_ATTR_INTERFACE_COMBINATIONS]);