Currently, the buffer size allocated for the get_station command in nl80211_get_station is NLMSG_DEFAULT_SIZE, which, in some cases, is insufficient to send complete output to user space and results in "no buffer space available" error. This is especially evident in setups with 3 links, where the amount of station info exceeds the default allocation, leading to underflows and incomplete netlink messages. To fix this, increase the buffer size to 4096 bytes. This ensures that the nl80211_get_station() command can return complete station information for up to 3 links without allocation failure. Fixes: 82d7f841d9bd ("wifi: cfg80211: extend to embed link level statistics in NL message") Signed-off-by: Sarika Sharma --- While this static increase is a practical short-term solution, it is not scalable for configurations with more than 3 links. To address this, planning to introduce a mechanism where user space can optionally pass a specific link ID to request link-level statistics. If no link ID is provided, only MLD-level (Multi-Link devices) statistics will be returned. If user space requires data for multiple links, it can invoke the get_station command multiple times, each time specifying a different link ID. This approach keeps individual message sizes manageable, avoids excessive memory allocation, and provides fine-grained control over the data retrieved. --- net/wireless/nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 89519aa52893..042cfff78bb3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -7624,7 +7624,7 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info) return err; } - msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); + msg = nlmsg_new(4096, GFP_KERNEL); if (!msg) { cfg80211_sinfo_release_content(&sinfo); return -ENOMEM; base-commit: d9104cec3e8fe4b458b74709853231385779001f -- 2.34.1