linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFCv2 1/4] nl80211: Fix broken non-split wiphy dumps
@ 2019-08-16 19:27 Denis Kenzior
  2019-08-16 19:27 ` [RFCv2 2/4] nl80211: Support >4096 byte NEW_WIPHY event nlmsg Denis Kenzior
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Denis Kenzior @ 2019-08-16 19:27 UTC (permalink / raw)
  To: linux-wireless, johannes; +Cc: Denis Kenzior

If a (legacy) client requested a wiphy dump but did not provide the
NL80211_ATTR_SPLIT_WIPHY_DUMP attribute, the dump was supposed to be
composed of purely non-split NEW_WIPHY messages, with 1 wiphy per
message.  At least this was the intent after commit:
3713b4e364ef ("nl80211: allow splitting wiphy information in dumps")

However, in reality the non-split dumps were broken very shortly after.
Perhaps around commit:
fe1abafd942f ("nl80211: re-add channel width and extended capa advertising")

The reason for the bug is a missing setting of split_start to 0 in the
case of a non-split dump.

Here is a sample non-split dump performed on kernel 4.19, some parts
were cut for brevity:
< Request: Get Wiphy (0x01) len 0 [ack,0x300]
> Result: New Wiphy (0x03) len 3496 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
<snip>
> Result: New Wiphy (0x03) len 68 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
    Extended Capabilities: len 8
        Capability: bit  2: Extended channel switching
        Capability: bit 62: Opmode Notification
    Extended Capabilities Mask: len 8
        04 00 00 00 00 00 00 40                          .......@
    VHT Capability Mask: len 12
        f0 1f 80 33 ff ff 00 00 ff ff 00 00              ...3........
> Result: New Wiphy (0x03) len 28 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
> Result: New Wiphy (0x03) len 28 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
> Result: New Wiphy (0x03) len 52 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
    Max CSA Counters: len 1
        02                                               .
    Scheduled Scan Maximum Requests: len 4
        01 00 00 00                                      ....
    Extended Features: len 4
        02 02 00 04                                      ....
> Result: New Wiphy (0x03) len 36 [multi]
    Wiphy: 0 (0x00000000)
    Wiphy Name: phy0
    Generation: 1 (0x00000001)
    Reserved: len 4
        00 00 00 00                                      ....
> Complete: Get Wiphy (0x01) len 4 [multi]
    Status: 0

Signed-off-by: Denis Kenzior <denkenz@gmail.com>
---
 net/wireless/nl80211.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1a107f29016b..b9b0199b5ec6 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2173,6 +2173,9 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
 		 * but break unconditionally so unsplit data stops here.
 		 */
 		state->split_start++;
+
+		if (!state->split)
+			state->split_start = 0;
 		break;
 	case 9:
 		if (rdev->wiphy.extended_capabilities &&
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-08-30 19:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-16 19:27 [RFCv2 1/4] nl80211: Fix broken non-split wiphy dumps Denis Kenzior
2019-08-16 19:27 ` [RFCv2 2/4] nl80211: Support >4096 byte NEW_WIPHY event nlmsg Denis Kenzior
2019-08-30  9:36   ` Johannes Berg
2019-08-30 19:56     ` Denis Kenzior
2019-08-16 19:27 ` [RFCv2 3/4] nl80211: Don't split-dump for clients with large buffers Denis Kenzior
2019-08-16 19:27 ` [RFCv2 4/4] nl80211: Send large new_wiphy events Denis Kenzior
2019-08-30 10:14   ` Johannes Berg
2019-08-30 15:53     ` Denis Kenzior
2019-08-30  9:03 ` [RFCv2 1/4] nl80211: Fix broken non-split wiphy dumps Johannes Berg
2019-08-30  9:10   ` Johannes Berg
2019-08-30  9:40     ` Johannes Berg
2019-08-30  9:53       ` Johannes Berg
2019-08-30 16:32   ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).