Search Linux Wireless

Re: [PATCH wireless-next v9 03/10] wifi: cfg80211: extend to embed link level statistics in NL message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/22/2025 3:05 PM, Johannes Berg wrote:
On Thu, 2025-05-22 at 14:33 +0530, Sarika Sharma wrote:

+	if (sinfo->valid_links) {
+		links = nla_nest_start(msg, NL80211_ATTR_MLO_LINKS);
+		if (!links)
+			goto nla_put_failure;
+
+		for_each_valid_link(sinfo, link_id) {
+			link_sinfo = sinfo->links[link_id];
+
+			if (!link_sinfo)
+				continue;

I have removed the WARN_ON_ONCE() check for !link_sinfo because
link_sinfo can be NULL during sta_destroy.
It appears that nl80211_dump_station is being invoked during sta
destroy, though it's not very clear why this happens in that context.
Introduced in patch " mac80211: avoid excessive stack usage in sta_info".

Since link_sinfo memory isn't allocated during sta_destroy, there's a
valid chance it remains uninitialized,
which triggers the WARN_ON_ONCE() and causes hw_sim test cases to fail.

Let me know if I am missing the requirement to allocate link_sinfo
memory during sta destroy.

Probably not, though maybe we do want the link addresses in the station
delete message to userspace?

Then may be reporting station data will work here?( already happening)
As overall station is getting removed, not just any of links.

If really a use case then can allocate memory for link_sinfo as well during the station delete?


But the warning was just an inconsistency issue - why should users set
the valid bits for a link but then not have any link data? That seems
wrong?

It's not exactly incorrect, since there's a scenario where memory isn't allocated for link_station (such as during station deletion).
Perhaps we could add a comment to clarify this behavior?

Then either way, if really link_sinfo required to be reported(for link address), then need to allocate memory during station delete for links.

or if need to add WARN_ON_ONCE(), can reset valid_links during station delete?


johannes





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux