Comment 3 for bug 1998765

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),