libnl3 3.4.0 doesn't work with WCN3980

Bug #1998765 reported by Robert Liu
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Status tracked in Focal
Focal
Fix Committed
High
Robert Liu
libnl3 (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned

Bug Description

[ Impact ]
When testing Qualcomm qcs410 with WCN3980 with 20.04 and UC20, WCN3980 is not able connect to an AP.

However, with the libnl3 (3.5.0) from BSP, WCN3980 can work correctly.

After bisecting the commits from 3.4.0 to 3.5.0, this commit[1] is identified as the root cause.

According to the commit, the "NLA_F_NESTED" flag should be set for kernel later than 5.2.

[ Test Plan ]
Verify with the updated version, the WIFI module can:
  1. scan WIFI networks
  2. connect to an available network
  3. access to the connected network

[ Where problems could occur ]
1. kernel versions without NLA_F_NESTED flag defined
  This flag is introduced before Linux kernel v5 (checked v3.x and v4.x have it). It would not be a problem for an older kernel to understand/work with this change. Since the GA kernel is 5.4, so a generic image would still work.

2. Drivers don't use the NESTED flag.
  According to hui.wang's input, this change should not affect drivers which don't use the NESTED flag. But, it'd be better to cover more Wifi modules.

[ Other Info ]
22.04 is using libnl3 3.0.5-0.1, so only 20.04 needs this patch.

[1] https://github.com/thom311/libnl/commit/7de65a051fb37ece16f896a7385073274b77a133

Revision history for this message
Robert Liu (robertliu) wrote :

I made a test build (debdiff attached) and tried it on the target device. This version works correctly.

Robert Liu (robertliu)
tags: added: orignate-from-lp1998578
Revision history for this message
Robert Liu (robertliu) wrote :

this issue was discovered in an OEM project.

affects: libnl3 (Ubuntu) → oem-priority
Changed in oem-priority:
assignee: nobody → Robert Liu (robertliu)
tags: added: oem-priority
Revision history for this message
Hui Wang (hui.wang) wrote :

Yes,the OEM project we are working on is based on a qualcomm chip qcs410, in this BSP, we integrate an out-of-tree WiFi driver for WCN3980 (https://git.codelinaro.org/clo/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0), this driver is also used in the qualcomm Android kernel, this driver has more features than linux in-tree drivers. And in qcacld-3.0 driver, there are many wiphy features are set netlink attribute NESTED flag (please see the log below), so with the kernel 5.2 and later version, the validate_nla() will check if the netlink message set the NLA_F_NESTED or not, if not set, the validation will fail for qcacld-3.0 driver.

And this change is safe for in-tree drivers, since these drivers don't have netlink attribute NESTED flag, the validate_nla() will not be impacted even we set NLA_F_NESTED to the netlink messages.

wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_SSID_LIST] = { .type = NLA_NESTED },
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_BSSID_PREFS] = { .type = NLA_NESTED },
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_BSSID_PARAMS] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_ROAM_CONTROL_CONFIG] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_SCAN_FREQ_LIST] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [PARAM_FREQ_LIST_SCHEME] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [QCA_ATTR_ROAM_CONTROL_SELECTION_CRITERIA] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: .type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: .type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: .type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: .type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [SET_CHAN_CHAN_LIST] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [SET_CHAN_FREQ_LIST] = {.type = NLA_NESTED},
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: [STATS_SET_DATA_PKT_INFO] = {.type = NLA_NESTED },
wlan/qcacld-3.0/core/hdd/src/wlan_hdd_cfg80211.c: VENDOR_NLA_POLICY_NESTED(qca_wlan_vendor_set_trace_level_policy),

Robert Liu (robertliu)
description: updated
Timo Aaltonen (tjaalton)
Changed in libnl3 (Ubuntu):
status: New → Fix Released
Changed in libnl3 (Ubuntu Jammy):
status: New → Invalid
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Robert, or anyone else affected,

Accepted libnl3 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/libnl3/3.4.0-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in libnl3 (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Robert Liu (robertliu) wrote :

I installed the updated version on the platform which needs this patch. After updating the packages, the platform can scan and connect to a WiFi network correctly.

I also tried other amd64, armhf and arm64 platforms which don't require the patch originally and their wifi device still work after upgrading.

$ dpkg -l |grep libnl
ii libnl-3-200:armhf 3.4.0-1ubuntu0.1 armhf library for dealing with netlink sockets
ii libnl-genl-3-200:armhf 3.4.0-1ubuntu0.1 armhf library for dealing with netlink sockets - generic netlink
ii libnl-route-3-200:armhf 3.4.0-1ubuntu0.1 armhf library for dealing with netlink sockets - route interface

$ sudo netplan apply
$ ip a
  ...
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether dc:a6:32:37:fa:a7 brd ff:ff:ff:ff:ff:ff
    inet 10.102.138.56/22 brd 10.102.139.255 scope global dynamic wlan0
       valid_lft 600sec preferred_lft 600sec
    inet6 fe80::dea6:32ff:fe37:faa7/64 scope link
       valid_lft forever preferred_lft forever

$ sudo ping -I wlan0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.102.138.56 wlan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=10.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=5.64 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=5.73 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=6.09 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=57 time=6.98 ms

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Chris Halse Rogers (raof) wrote : Update Released

The verification of the Stable Release Update for libnl3 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libnl3 - 3.4.0-1ubuntu0.1

---------------
libnl3 (3.4.0-1ubuntu0.1) focal; urgency=medium

  * Backport one upstream fix to support devices using NLA_F_NESTED
    - 7de65a051fb3 (attr: mark nested attributes as NLA_F_NESTED)
      (LP: #1998765)

 -- Robert Liu <email address hidden> Fri, 02 Dec 2022 22:05:28 +0800

Changed in libnl3 (Ubuntu Focal):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.