Skip to content

Conversation

@f0rm2l1n
Copy link
Contributor

@f0rm2l1n f0rm2l1n commented Apr 6, 2025

Definitions for attribute NBD_ATTR_SOCKETS, NL80211_ATTR_BSS_SELECT, NL80211_ATTR_PEER_MEASUREMENTS, and NL80211_ATTR_SCHED_SCAN_MATCH have some errors.

For example, the current definition of NBD_ATTR_SOCKETS is like

NBD_ATTR_SOCKETS  nlnest[NBD_ATTR_SOCKETS, array[nlattr[NBD_SOCK_FD, sock_nbd_client]]]

However, according to the actual parsing code:

nla_for_each_nested(attr, info->attrs[NBD_ATTR_SOCKETS],
		    rem) {
	struct nlattr *socks[NBD_SOCK_MAX+1];

	if (nla_type(attr) != NBD_SOCK_ITEM) {
		pr_err("socks must be embedded in a SOCK_ITEM attr\n");
		ret = -EINVAL;
		goto out;
	}
	ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX,
					  attr,
					  nbd_sock_policy,
					  info->extack);

The attribute NBD_ATTR_SOCKETS actually encloses stream of NBD_SOCK_ITEM
attribute first, then to the nested nbd_sock_policy attribute.

Fix them carefully, Check related parse functions: nbd_genl_reconfigure, parse_bss_select, nl80211_pmsr_start, and nl80211_parse_sched_scan for details.

Definitions for attribute `NBD_ATTR_SOCKETS`, `NL80211_ATTR_BSS_SELECT`,
`NL80211_ATTR_PEER_MEASUREMENTS`, and `NL80211_ATTR_SCHED_SCAN_MATCH`
have some errors.

Fix them carefully, Check related parse functions: nbd_genl_reconfigure,
parse_bss_select, nl80211_pmsr_start and nl80211_parse_sched_scan for
details.

Signed-off-by: Lin Ma <linma@zju.edu.cn>
Copy link
Collaborator

@a-nogikh a-nogikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@a-nogikh a-nogikh added this pull request to the merge queue Apr 7, 2025
Merged via the queue into google:master with commit 8aa6ae9 Apr 7, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants