Merge ~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:bug-1884634/fix-build-against-oem-5.6/focal into ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/focal

Proposed by You-Sheng Yang
Status: Merged
Approved by: Timo Aaltonen
Approved revision: cc77d3c32596fdefeec3bed7d55a3d8c95babf4c
Merged at revision: 4adf4cdd4f4b24a56c4414b31b921f12e520dd0e
Proposed branch: ~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:bug-1884634/fix-build-against-oem-5.6/focal
Merge into: ~canonical-hwe-team/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms:ubuntu/focal
Diff against target: 1035 lines (+965/-0)
11 files modified
debian/changelog (+15/-0)
debian/patches/0007-backport-add-genlmsg_parse.patch (+50/-0)
debian/patches/0008-backport-update-include-uapi-linux-pci_regs.h.patch (+108/-0)
debian/patches/0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch (+49/-0)
debian/patches/0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch (+282/-0)
debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch (+43/-0)
debian/patches/0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch (+34/-0)
debian/patches/0013-ftrace-Rework-event_create_dir.patch (+125/-0)
debian/patches/0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch (+39/-0)
debian/patches/0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch (+211/-0)
debian/patches/series (+9/-0)
Reviewer Review Type Date Requested Status
Alberto Milone (community) Approve
Timo Aaltonen Approve
Review via email: mp+387731@code.launchpad.net

Commit message

* Fix build against v5.8 kernel (LP: #1884634)
  - backport: add genlmsg_parse()
  - backport: update include/uapi/linux/pci_regs.h
  - [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec
  - [NOUPSTREAM] cfg80211: use parallel_ops for genl
  - backports: netlink: fix nla_validate_nested()
  - netlink: rename nl80211_validate_nested() to nla_validate_nested()
  - ftrace: Rework event_create_dir()
  - nl80211: fix NL80211_ATTR_FTM_RESPONDER policy
  - [NOUPSTREAM] nl80211: pull in NLA_POLICY_EXACT_LEN_WARN() usage

Description of the change

[SRU Justifcation]

[Impact]
When compiled against linux-oem-5.6/linux-5.8 kernels on Focal, backport-iwlwifi-dkms gives numerous errors due to in kernel interface changes and fails the installation.

[Fix]
This backports several patches from upstream backport-iwlwifi, mainline kernel, and backports project.

[Test Case]
Tested build on 5.4.0-52-generic, 5.6.0-1032-oem and 5.8.0-25-generic on Focal. Since the current version 8324 has been marked obsoleted by 5.4 or newer in bug 1863583 and bug 1869587, built modules are not installed currently so no runtime tests are required.

[Regression Potential]
Low. So far backport-iwlwifi-dkms is still marked OBSOLETED_BY=5.4.0, so it has totally no effect in the runtime system. This will only change when future enablements based on LTS series Focal that relies on out-of-tree driver support from this package.

To post a comment you must log in.
Revision history for this message
Timo Aaltonen (tjaalton) wrote :

this got uploaded earlier

review: Approve
Revision history for this message
You-Sheng Yang (vicamo) wrote :

Was rejected due to too much changes while SRU back to Focal. Redo with cherry-picking necessary patches. Still need some more polishing and tests.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

Updated commits to include only necessary changes backported from upstream backport-iwlwifi, mainline kernel, and backports project.

Need review & submit.

Revision history for this message
Alberto Milone (albertomilone) wrote :

It looks good to me. Approved, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 4aae555..6e485d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
1backport-iwlwifi-dkms (8324-0ubuntu3~20.04.2) focal; urgency=medium
2
3 * Fix build against v5.8 kernel (LP: #1884634)
4 - backport: add genlmsg_parse()
5 - backport: update include/uapi/linux/pci_regs.h
6 - [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec
7 - [NOUPSTREAM] cfg80211: use parallel_ops for genl
8 - backports: netlink: fix nla_validate_nested()
9 - netlink: rename nl80211_validate_nested() to nla_validate_nested()
10 - ftrace: Rework event_create_dir()
11 - nl80211: fix NL80211_ATTR_FTM_RESPONDER policy
12 - [NOUPSTREAM] nl80211: pull in NLA_POLICY_EXACT_LEN_WARN() usage
13
14 -- You-Sheng Yang <vicamo@gmail.com> Mon, 02 Nov 2020 13:55:31 +0000
15
1backport-iwlwifi-dkms (8324-0ubuntu3~20.04.1) focal; urgency=medium16backport-iwlwifi-dkms (8324-0ubuntu3~20.04.1) focal; urgency=medium
217
3 * dkms: stop installing kernel on 5.4 or newer (LP: #1863583)18 * dkms: stop installing kernel on 5.4 or newer (LP: #1863583)
diff --git a/debian/patches/0007-backport-add-genlmsg_parse.patch b/debian/patches/0007-backport-add-genlmsg_parse.patch
4new file mode 10064419new file mode 100644
index 0000000..c2e385a
--- /dev/null
+++ b/debian/patches/0007-backport-add-genlmsg_parse.patch
@@ -0,0 +1,50 @@
1From dab7f14acb372b1a0c5f0c8b0b256bbc09f2f362 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Fri, 28 Feb 2020 09:17:40 +0100
4Subject: [PATCH] backport: add genlmsg_parse()
5
6We just need to provide our own version of this so that
7the types match up correctly.
8
9While at it, fix the version ifdef comment.
10
11type=feature
12ticket=none
13
14Change-Id: Ic7f3b6424b5474b73eb2f9819569118e38e1b479
15Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/254152
17Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
18x-iwlwifi-stack-dev: da7591716aa2f04b80e987362033452f0e2419b6
19(cherry picked from commit f207b0f5e770f7f90d8a19fedc9cb72031dd4322)
20Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
21---
22 backport-include/net/genetlink.h | 13 ++++++++++++-
23 1 file changed, 12 insertions(+), 1 deletion(-)
24
25diff --git a/backport-include/net/genetlink.h b/backport-include/net/genetlink.h
26index e6b78e02a..90ec7a789 100644
27--- a/backport-include/net/genetlink.h
28+++ b/backport-include/net/genetlink.h
29@@ -250,6 +250,17 @@ static inline struct nlattr **genl_family_attrbuf(struct genl_family *family)
30
31 return family->attrbuf;
32 }
33-#endif /* LINUX_VERSION_IS_LESS(4,20,0) */
34+
35+#define genlmsg_parse LINUX_BACKPORT(genlmsg_parse)
36+static inline int genlmsg_parse(const struct nlmsghdr *nlh,
37+ const struct genl_family *family,
38+ struct nlattr *tb[], int maxtype,
39+ const struct nla_policy *policy,
40+ struct netlink_ext_ack *extack)
41+{
42+ return __nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype,
43+ policy, NL_VALIDATE_STRICT, extack);
44+}
45+#endif /* LINUX_VERSION_IS_LESS(5,2) */
46
47 #endif /* __BACKPORT_NET_GENETLINK_H */
48--
492.25.1
50
diff --git a/debian/patches/0008-backport-update-include-uapi-linux-pci_regs.h.patch b/debian/patches/0008-backport-update-include-uapi-linux-pci_regs.h.patch
0new file mode 10064451new file mode 100644
index 0000000..806f8a3
--- /dev/null
+++ b/debian/patches/0008-backport-update-include-uapi-linux-pci_regs.h.patch
@@ -0,0 +1,108 @@
1From b9ef5cc9944385cafa3c3f9e6bb18be27b3a97f5 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Wed, 22 Jan 2020 16:11:01 +0100
4Subject: [PATCH] backport: update include/uapi/linux/pci_regs.h
5
6This file is normally copied during backporting, but until
7we update from the auto tree, pull this manually in order
8to be able to compile against recent kernels (5.5-rc) on
9which linux/pci.h requires PCI_STD_NUM_BARS from here.
10
11type=feature
12ticket=none
13
14Change-Id: Ia8c75520ae2f937c75fcc97b760e54fc957a49bf
15Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/250174
17Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
18Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
19x-iwlwifi-stack-dev: 86a15998a19c849821c133ac5df17c99c8bf6d2f
20(cherry picked from commit 6d34e47b86a11606452ca0002965af854ea530e1)
21Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
22---
23 include/uapi/linux/pci_regs.h | 22 +++++++++++++++++++++-
24 1 file changed, 21 insertions(+), 1 deletion(-)
25
26diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
27index 27164769d..acb7d2bdb 100644
28--- a/include/uapi/linux/pci_regs.h
29+++ b/include/uapi/linux/pci_regs.h
30@@ -34,6 +34,7 @@
31 * of which the first 64 bytes are standardized as follows:
32 */
33 #define PCI_STD_HEADER_SIZEOF 64
34+#define PCI_STD_NUM_BARS 6 /* Number of standard BARs */
35 #define PCI_VENDOR_ID 0x00 /* 16 bits */
36 #define PCI_DEVICE_ID 0x02 /* 16 bits */
37 #define PCI_COMMAND 0x04 /* 16 bits */
38@@ -528,6 +529,7 @@
39 #define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
40 #define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */
41 #define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */
42+#define PCI_EXP_LNKCAP_SLS_32_0GB 0x00000005 /* LNKCAP2 SLS Vector bit 4 */
43 #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
44 #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
45 #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
46@@ -556,6 +558,7 @@
47 #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
48 #define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */
49 #define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */
50+#define PCI_EXP_LNKSTA_CLS_32_0GB 0x0005 /* Current Link Speed 32.0GT/s */
51 #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */
52 #define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */
53 #define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */
54@@ -589,6 +592,7 @@
55 #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */
56 #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */
57 #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */
58+#define PCI_EXP_SLTCTL_ATTN_IND_SHIFT 6 /* Attention Indicator shift */
59 #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */
60 #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */
61 #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */
62@@ -661,6 +665,7 @@
63 #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */
64 #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */
65 #define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */
66+#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */
67 #define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */
68 #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
69 #define PCI_EXP_LNKCTL2_TLS 0x000f
70@@ -668,6 +673,9 @@
71 #define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */
72 #define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */
73 #define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */
74+#define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */
75+#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */
76+#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */
77 #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
78 #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */
79 #define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */
80@@ -709,7 +717,9 @@
81 #define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */
82 #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */
83 #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */
84-#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM
85+#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */
86+#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */
87+#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT
88
89 #define PCI_EXT_CAP_DSN_SIZEOF 12
90 #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40
91@@ -1049,4 +1059,14 @@
92 #define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */
93 #define PCI_L1SS_CTL2 0x0c /* Control 2 Register */
94
95+/* Data Link Feature */
96+#define PCI_DLF_CAP 0x04 /* Capabilities Register */
97+#define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */
98+
99+/* Physical Layer 16.0 GT/s */
100+#define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */
101+#define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F
102+#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0
103+#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4
104+
105 #endif /* LINUX_PCI_REGS_H */
106--
1072.25.1
108
diff --git a/debian/patches/0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch b/debian/patches/0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch
0new file mode 100644109new file mode 100644
index 0000000..10bc138
--- /dev/null
+++ b/debian/patches/0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch
@@ -0,0 +1,49 @@
1From 4c7a42b261a102267e50240f0f5c55d2737f0cd2 Mon Sep 17 00:00:00 2001
2From: Luca Coelho <luciano.coelho@intel.com>
3Date: Fri, 27 Mar 2020 10:22:08 +0200
4Subject: [PATCH] [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec
5
6The getnstimeofday() function was removed in v5.4, being replaced by a
7truly 64-bit version. Replace our only non-upstream usage of
8getnstimeofday() with the new ktime_get_real_s64() function.
9
10type=maint
11ticket=none
12
13Change-Id: I4643aeebe79f1f48b27eab1c1edeb1d7f396f4cb
14Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
15Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/257132
16automatic-review: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
17Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
18x-iwlwifi-stack-dev: 6651bda5fd07ca61729d3075acf13f655fc40690
19(cherry picked from commit a68daa3747f0b0643de3207cb597ffc501c510cd)
20Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
21---
22 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
26index 43430589d..1941c86da 100644
27--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
28+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
29@@ -5171,7 +5171,7 @@ static void iwl_mvm_event_bar_rx_callback(struct iwl_mvm *mvm,
30 static u32 iwl_mvm_send_latency_marker_cmd(struct iwl_mvm *mvm, u32 msrmnt,
31 u16 seq, u16 tid)
32 {
33- struct timespec ts;
34+ struct timespec64 ts;
35 int ret;
36 struct iwl_mvm_marker_rsp *rsp;
37 struct iwl_mvm_marker *marker;
38@@ -5182,7 +5182,7 @@ static u32 iwl_mvm_send_latency_marker_cmd(struct iwl_mvm *mvm, u32 msrmnt,
39 u32 cmd_size = sizeof(struct iwl_mvm_marker) +
40 MARKER_CMD_TX_LAT_PAYLOAD_SIZE * sizeof(u32);
41
42- getnstimeofday(&ts);
43+ ktime_get_real_ts64(&ts);
44
45 marker = kzalloc(cmd_size, GFP_KERNEL);
46 if (!marker)
47--
482.25.1
49
diff --git a/debian/patches/0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch b/debian/patches/0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch
0new file mode 10064450new file mode 100644
index 0000000..da0d5fe
--- /dev/null
+++ b/debian/patches/0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch
@@ -0,0 +1,282 @@
1From 145f1fcee90302f44989aaef2486e4166525b09a Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Mon, 29 Jul 2019 16:31:09 +0200
4Subject: [PATCH] [NOUPSTREAM] cfg80211: use parallel_ops for genl
5
6(Imported from upstream commit 50508d941c18 since newer kernels
7remove genl_family_attrbuf() entirely, so we can compile there)
8
9Over time, we really need to get rid of all of our global locking.
10One of the things needed is to use parallel_ops. This isn't really
11the most important (RTNL is much more important) but OTOH we just
12keep adding uses of genl_family_attrbuf() now. Use .parallel_ops to
13disallow this.
14
15type=feature
16ticket=none
17
18Reviewed-By: Denis Kenzior <denkenz@gmail.com>
19Link: https://lore.kernel.org/r/20190729143109.18683-1-johannes@sipsolutions.net
20Change-Id: I351cc0de9d6b6d5f5a14aaf4106ef502ee1b3840
21Signed-off-by: Johannes Berg <johannes.berg@intel.com>
22Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/250173
23Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
24Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
25x-iwlwifi-stack-dev: b2d6da5d545c1525b3c73cc3bfaeafbcc770ed15
26(cherry picked from commit 6360027e3331a93d32b259010e5f37d270f6513a)
27Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
28---
29 net/wireless/nl80211.c | 108 +++++++++++++++++++++++++++++------------
30 1 file changed, 78 insertions(+), 30 deletions(-)
31
32diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
33index fa70b33ee..d8480b6b1 100644
34--- a/net/wireless/nl80211.c
35+++ b/net/wireless/nl80211.c
36@@ -795,17 +795,25 @@ int nl80211_prepare_wdev_dump(struct netlink_callback *cb,
37 int err;
38
39 if (!cb->args[0]) {
40+ struct nlattr **attrbuf;
41+
42+ attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf),
43+ GFP_KERNEL);
44+ if (!attrbuf)
45+ return -ENOMEM;
46+
47 err = nlmsg_parse_deprecated(cb->nlh,
48 GENL_HDRLEN + nl80211_fam.hdrsize,
49- genl_family_attrbuf(&nl80211_fam),
50- nl80211_fam.maxattr,
51+ attrbuf, nl80211_fam.maxattr,
52 nl80211_policy, NULL);
53- if (err)
54+ if (err) {
55+ kfree(attrbuf);
56 return err;
57+ }
58
59- *wdev = __cfg80211_wdev_from_attrs(
60- sock_net(cb->skb->sk),
61- genl_family_attrbuf(&nl80211_fam));
62+ *wdev = __cfg80211_wdev_from_attrs(sock_net(cb->skb->sk),
63+ attrbuf);
64+ kfree(attrbuf);
65 if (IS_ERR(*wdev))
66 return PTR_ERR(*wdev);
67 *rdev = wiphy_to_rdev((*wdev)->wiphy);
68@@ -2429,14 +2437,21 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb,
69 struct netlink_callback *cb,
70 struct nl80211_dump_wiphy_state *state)
71 {
72- struct nlattr **tb = genl_family_attrbuf(&nl80211_fam);
73- int ret = nlmsg_parse_deprecated(cb->nlh,
74- GENL_HDRLEN + nl80211_fam.hdrsize,
75- tb, nl80211_fam.maxattr,
76- nl80211_policy, NULL);
77+ struct nlattr **tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL);
78+ int ret;
79+
80+ if (!tb)
81+ return -ENOMEM;
82+
83+ ret = nlmsg_parse_deprecated(cb->nlh,
84+ GENL_HDRLEN + nl80211_fam.hdrsize,
85+ tb, nl80211_fam.maxattr,
86+ nl80211_policy, NULL);
87 /* ignore parse errors for backward compatibility */
88- if (ret)
89- return 0;
90+ if (ret) {
91+ ret = 0;
92+ goto out;
93+ }
94
95 state->split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP];
96 if (tb[NL80211_ATTR_WIPHY])
97@@ -2449,8 +2464,10 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb,
98 int ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
99
100 netdev = __dev_get_by_index(sock_net(skb->sk), ifidx);
101- if (!netdev)
102- return -ENODEV;
103+ if (!netdev) {
104+ ret = -ENODEV;
105+ goto out;
106+ }
107 if (netdev->ieee80211_ptr) {
108 rdev = wiphy_to_rdev(
109 netdev->ieee80211_ptr->wiphy);
110@@ -2458,7 +2475,10 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb,
111 }
112 }
113
114- return 0;
115+ ret = 0;
116+out:
117+ kfree(tb);
118+ return ret;
119 }
120
121 static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
122@@ -8774,7 +8794,7 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq,
123
124 static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb)
125 {
126- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam);
127+ struct nlattr **attrbuf;
128 struct survey_info survey;
129 struct cfg80211_registered_device *rdev;
130 struct wireless_dev *wdev;
131@@ -8782,6 +8802,10 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb)
132 int res;
133 bool radio_stats;
134
135+ attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL);
136+ if (!attrbuf)
137+ return -ENOMEM;
138+
139 rtnl_lock();
140 res = nl80211_prepare_wdev_dump(cb, &rdev, &wdev);
141 if (res)
142@@ -8826,6 +8850,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb)
143 cb->args[2] = survey_idx;
144 res = skb->len;
145 out_err:
146+ kfree(attrbuf);
147 rtnl_unlock();
148 return res;
149 }
150@@ -9690,6 +9715,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
151 struct netlink_callback *cb)
152 {
153 struct cfg80211_registered_device *rdev;
154+ struct nlattr **attrbuf = NULL;
155 int err;
156 long phy_idx;
157 void *data = NULL;
158@@ -9710,7 +9736,12 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
159 goto out_err;
160 }
161 } else {
162- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam);
163+ attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf),
164+ GFP_KERNEL);
165+ if (!attrbuf) {
166+ err = -ENOMEM;
167+ goto out_err;
168+ }
169
170 err = nlmsg_parse_deprecated(cb->nlh,
171 GENL_HDRLEN + nl80211_fam.hdrsize,
172@@ -9777,6 +9808,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
173 /* see above */
174 cb->args[0] = phy_idx + 1;
175 out_err:
176+ kfree(attrbuf);
177 rtnl_unlock();
178 return err;
179 }
180@@ -13140,7 +13172,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb,
181 struct cfg80211_registered_device **rdev,
182 struct wireless_dev **wdev)
183 {
184- struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam);
185+ struct nlattr **attrbuf;
186 u32 vid, subcmd;
187 unsigned int i;
188 int vcmd_idx = -1;
189@@ -13171,24 +13203,32 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb,
190 return 0;
191 }
192
193+ attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL);
194+ if (!attrbuf)
195+ return -ENOMEM;
196+
197 err = nlmsg_parse_deprecated(cb->nlh,
198 GENL_HDRLEN + nl80211_fam.hdrsize,
199 attrbuf, nl80211_fam.maxattr,
200 nl80211_policy, NULL);
201 if (err)
202- return err;
203+ goto out;
204
205 if (!attrbuf[NL80211_ATTR_VENDOR_ID] ||
206- !attrbuf[NL80211_ATTR_VENDOR_SUBCMD])
207- return -EINVAL;
208+ !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) {
209+ err = -EINVAL;
210+ goto out;
211+ }
212
213 *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), attrbuf);
214 if (IS_ERR(*wdev))
215 *wdev = NULL;
216
217 *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf);
218- if (IS_ERR(*rdev))
219- return PTR_ERR(*rdev);
220+ if (IS_ERR(*rdev)) {
221+ err = PTR_ERR(*rdev);
222+ goto out;
223+ }
224
225 vid = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_ID]);
226 subcmd = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_SUBCMD]);
227@@ -13201,15 +13241,19 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb,
228 if (vcmd->info.vendor_id != vid || vcmd->info.subcmd != subcmd)
229 continue;
230
231- if (!vcmd->dumpit)
232- return -EOPNOTSUPP;
233+ if (!vcmd->dumpit) {
234+ err = -EOPNOTSUPP;
235+ goto out;
236+ }
237
238 vcmd_idx = i;
239 break;
240 }
241
242- if (vcmd_idx < 0)
243- return -EOPNOTSUPP;
244+ if (vcmd_idx < 0) {
245+ err = -EOPNOTSUPP;
246+ goto out;
247+ }
248
249 if (attrbuf[NL80211_ATTR_VENDOR_DATA]) {
250 data = nla_data(attrbuf[NL80211_ATTR_VENDOR_DATA]);
251@@ -13220,7 +13264,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb,
252 attrbuf[NL80211_ATTR_VENDOR_DATA],
253 genl_callback_extack(cb));
254 if (err)
255- return err;
256+ goto out;
257 }
258
259 /* 0 is the first index - add 1 to parse only once */
260@@ -13232,7 +13276,10 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb,
261 cb->args[4] = data_len;
262
263 /* keep rtnl locked in successful case */
264- return 0;
265+ err = 0;
266+out:
267+ kfree(attrbuf);
268+ return err;
269 }
270
271 static int nl80211_vendor_cmd_dump(struct sk_buff *skb,
272@@ -14927,6 +14974,7 @@ static struct genl_family nl80211_fam __genl_ro_after_init = {
273 .n_ops = ARRAY_SIZE(nl80211_ops),
274 .mcgrps = nl80211_mcgrps,
275 .n_mcgrps = ARRAY_SIZE(nl80211_mcgrps),
276+ .parallel_ops = true,
277 };
278
279 /* notification functions */
280--
2812.25.1
282
diff --git a/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch b/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch
0new file mode 100644283new file mode 100644
index 0000000..011f8da
--- /dev/null
+++ b/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch
@@ -0,0 +1,43 @@
1From: Johannes Berg <johannes.berg@intel.com>
2Date: Thu, 12 Mar 2020 16:59:13 +0100
3Subject: backports: netlink: fix nla_validate_nested()
4
5I had accidentally named this nl80211_validate_nested(),
6and it got renamed in 5.6.
7
8Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9(cherry picked from commit f1708ac5643a1decf36ca92ba0644397df5da1f9
10https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git)
11Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
12---
13 backport-include/net/netlink.h | 12 ++++++------
14 1 file changed, 6 insertions(+), 6 deletions(-)
15
16diff --git a/backport-include/net/netlink.h b/backport-include/net/netlink.h
17index 9a5c270..942217e 100644
18--- a/backport-include/net/netlink.h
19+++ b/backport-include/net/netlink.h
20@@ -266,17 +266,17 @@ nla_validate_nested_deprecated(const struct nlattr *start, int maxtype,
21 }
22 #endif /* < 5.2 */
23
24-#if LINUX_VERSION_IS_LESS(5,3,0)
25-#define nl80211_validate_nested LINUX_BACKPORT(nl80211_validate_nested)
26+#if LINUX_VERSION_IS_LESS(5,6,0)
27+#define nla_validate_nested LINUX_BACKPORT(nla_validate_nested)
28 static inline int
29-nl80211_validate_nested(const struct nlattr *start, int maxtype,
30- const struct nla_policy *policy,
31- struct netlink_ext_ack *extack)
32+nla_validate_nested(const struct nlattr *start, int maxtype,
33+ const struct nla_policy *policy,
34+ struct netlink_ext_ack *extack)
35 {
36 return __nla_validate_nested(start, maxtype, policy,
37 NL_VALIDATE_STRICT, extack);
38 }
39-#endif /* < 5.3 */
40+#endif /* < 5.6 */
41
42 #if LINUX_VERSION_IS_LESS(5,1,0)
43 #undef NLA_POLICY_NESTED
diff --git a/debian/patches/0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch b/debian/patches/0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch
0new file mode 10064444new file mode 100644
index 0000000..6de3bcf
--- /dev/null
+++ b/debian/patches/0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch
@@ -0,0 +1,34 @@
1From: Michal Kubecek <mkubecek@suse.cz>
2Date: Wed, 11 Dec 2019 10:58:19 +0100
3Subject: netlink: rename nl80211_validate_nested() to nla_validate_nested()
4
5Function nl80211_validate_nested() is not specific to nl80211, it's
6a counterpart to nla_validate_nested_deprecated() with strict validation.
7For consistency with other validation and parse functions, rename it to
8nla_validate_nested().
9
10Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
11Acked-by: Jiri Pirko <jiri@mellanox.com>
12Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
13Signed-off-by: David S. Miller <davem@davemloft.net>
14(backported from commit 32d5109a9d864aea3981f0b5ea736eee4e11b42a
15https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
16Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
17---
18 net/wireless/nl80211.c | 3 +--
19 1 file changed, 1 insertion(+), 2 deletions(-)
20
21diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
22index d8480b6..702a269 100644
23--- a/net/wireless/nl80211.c
24+++ b/net/wireless/nl80211.c
25@@ -13088,8 +13088,7 @@ static int nl80211_vendor_check_policy(const struct wiphy_vendor_command *vcmd,
26 return -EINVAL;
27 }
28
29- return nl80211_validate_nested(attr, vcmd->maxattr, vcmd->policy,
30- extack);
31+ return nla_validate_nested(attr, vcmd->maxattr, vcmd->policy, extack);
32 }
33
34 static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info)
diff --git a/debian/patches/0013-ftrace-Rework-event_create_dir.patch b/debian/patches/0013-ftrace-Rework-event_create_dir.patch
0new file mode 10064435new file mode 100644
index 0000000..4d42878
--- /dev/null
+++ b/debian/patches/0013-ftrace-Rework-event_create_dir.patch
@@ -0,0 +1,125 @@
1From f992b8d650c313c7788f287583c323531244abc7 Mon Sep 17 00:00:00 2001
2From: Peter Zijlstra <peterz@infradead.org>
3Date: Thu, 24 Oct 2019 22:26:59 +0200
4Subject: [PATCH] ftrace: Rework event_create_dir()
5
6Rework event_create_dir() to use an array of static data instead of
7function pointers where possible.
8
9The problem is that it would call the function pointer on module load
10before parse_args(), possibly even before jump_labels were initialized.
11Luckily the generated functions don't use jump_labels but it still seems
12fragile. It also gets in the way of changing when we make the module map
13executable.
14
15The generated function are basically calling trace_define_field() with a
16bunch of static arguments. So instead of a function, capture these
17arguments in a static array, avoiding the function call.
18
19Now there are a number of cases where the fields are dynamic (syscall
20arguments, kprobes and uprobes), in which case a static array does not
21work, for these we preserve the function call. Luckily all these cases
22are not related to modules and so we can retain the function call for
23them.
24
25Also fix up all broken tracepoint definitions that now generate a
26compile error.
27
28Tested-by: Alexei Starovoitov <ast@kernel.org>
29Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
30Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
31Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
32Acked-by: Alexei Starovoitov <ast@kernel.org>
33Cc: Andy Lutomirski <luto@kernel.org>
34Cc: Borislav Petkov <bp@alien8.de>
35Cc: Brian Gerst <brgerst@gmail.com>
36Cc: Denys Vlasenko <dvlasenk@redhat.com>
37Cc: H. Peter Anvin <hpa@zytor.com>
38Cc: Linus Torvalds <torvalds@linux-foundation.org>
39Cc: Peter Zijlstra <peterz@infradead.org>
40Cc: Steven Rostedt <rostedt@goodmis.org>
41Cc: Thomas Gleixner <tglx@linutronix.de>
42Link: https://lkml.kernel.org/r/20191111132458.342979914@infradead.org
43Signed-off-by: Ingo Molnar <mingo@kernel.org>
44(backported from commit 04ae87a52074e2d448fc66143f1bd2c7d694d2b9
45https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
46Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
47---
48 net/mac80211/trace.h | 28 ++++++++++++++--------------
49 net/wireless/trace.h | 4 ++--
50 2 files changed, 16 insertions(+), 16 deletions(-)
51
52diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
53index 009578490..9f034a3c2 100644
54--- a/net/mac80211/trace.h
55+++ b/net/mac80211/trace.h
56@@ -408,20 +408,20 @@ TRACE_EVENT(drv_bss_info_changed,
57 __field(u32, basic_rates)
58 __array(int, mcast_rate, NUM_NL80211_BANDS)
59 __field(u16, ht_operation_mode)
60- __field(s32, cqm_rssi_thold);
61- __field(s32, cqm_rssi_hyst);
62- __field(u32, channel_width);
63- __field(u32, channel_cfreq1);
64+ __field(s32, cqm_rssi_thold)
65+ __field(s32, cqm_rssi_hyst)
66+ __field(u32, channel_width)
67+ __field(u32, channel_cfreq1)
68 __dynamic_array(u32, arp_addr_list,
69 info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ?
70 IEEE80211_BSS_ARP_ADDR_LIST_LEN :
71- info->arp_addr_cnt);
72- __field(int, arp_addr_cnt);
73- __field(bool, qos);
74- __field(bool, idle);
75- __field(bool, ps);
76- __dynamic_array(u8, ssid, info->ssid_len);
77- __field(bool, hidden_ssid);
78+ info->arp_addr_cnt)
79+ __field(int, arp_addr_cnt)
80+ __field(bool, qos)
81+ __field(bool, idle)
82+ __field(bool, ps)
83+ __dynamic_array(u8, ssid, info->ssid_len)
84+ __field(bool, hidden_ssid)
85 __field(int, txpower)
86 __field(u8, p2p_oppps_ctwindow)
87 ),
88@@ -1672,8 +1672,8 @@ TRACE_EVENT(drv_start_ap,
89 VIF_ENTRY
90 __field(u8, dtimper)
91 __field(u16, bcnint)
92- __dynamic_array(u8, ssid, info->ssid_len);
93- __field(bool, hidden_ssid);
94+ __dynamic_array(u8, ssid, info->ssid_len)
95+ __field(bool, hidden_ssid)
96 ),
97
98 TP_fast_assign(
99@@ -1739,7 +1739,7 @@ TRACE_EVENT(drv_join_ibss,
100 VIF_ENTRY
101 __field(u8, dtimper)
102 __field(u16, bcnint)
103- __dynamic_array(u8, ssid, info->ssid_len);
104+ __dynamic_array(u8, ssid, info->ssid_len)
105 ),
106
107 TP_fast_assign(
108diff --git a/net/wireless/trace.h b/net/wireless/trace.h
109index 896b73dc8..3aa5f116e 100644
110--- a/net/wireless/trace.h
111+++ b/net/wireless/trace.h
112@@ -2051,8 +2051,8 @@ TRACE_EVENT(rdev_nan_change_conf,
113 WIPHY_ENTRY
114 WDEV_ENTRY
115 __field(u8, master_pref)
116- __field(u8, bands);
117- __field(u32, changes);
118+ __field(u8, bands)
119+ __field(u32, changes)
120 ),
121 TP_fast_assign(
122 WIPHY_ASSIGN;
123--
1242.27.0
125
diff --git a/debian/patches/0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch b/debian/patches/0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch
0new file mode 100644126new file mode 100644
index 0000000..1b022ef
--- /dev/null
+++ b/debian/patches/0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch
@@ -0,0 +1,39 @@
1From c3ed40441774defdec1a38256ef6dae75b5a7a11 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Sun, 12 Apr 2020 00:40:30 +0200
4Subject: [PATCH] nl80211: fix NL80211_ATTR_FTM_RESPONDER policy
5
6The nested policy here should be established using the
7NLA_POLICY_NESTED() macro so the length is properly
8filled in.
9
10Cc: stable@vger.kernel.org
11Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics")
12Link: https://lore.kernel.org/r/20200412004029.9d0722bb56c8.Ie690bfcc4a1a61ff8d8ca7e475d59fcaa52fb2da@changeid
13Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14(cherry-picked from commit 0e012b4e4b5ec8e064be3502382579dd0bb43269)
15Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
16---
17 net/wireless/nl80211.c | 6 ++----
18 1 file changed, 2 insertions(+), 4 deletions(-)
19
20diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
21index fa70b33ee..1c988c10f 100644
22--- a/net/wireless/nl80211.c
23+++ b/net/wireless/nl80211.c
24@@ -598,10 +598,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
25 [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY,
26 .len = NL80211_HE_MAX_CAPABILITY_LEN },
27
28- [NL80211_ATTR_FTM_RESPONDER] = {
29- .type = NLA_NESTED,
30- .validation_data = nl80211_ftm_responder_policy,
31- },
32+ [NL80211_ATTR_FTM_RESPONDER] =
33+ NLA_POLICY_NESTED(nl80211_ftm_responder_policy),
34 [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1),
35 [NL80211_ATTR_PEER_MEASUREMENTS] =
36 NLA_POLICY_NESTED(nl80211_pmsr_attr_policy),
37--
382.25.1
39
diff --git a/debian/patches/0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch b/debian/patches/0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch
0new file mode 10064440new file mode 100644
index 0000000..13c6281
--- /dev/null
+++ b/debian/patches/0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch
@@ -0,0 +1,211 @@
1From 580b5af2262d5f55ffaeb9b8f265e08b193aa411 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Tue, 4 Aug 2020 10:25:29 +0200
4Subject: [PATCH] [NOUPSTREAM] nl80211: pull in NLA_POLICY_EXACT_LEN_WARN()
5 usage
6
7Pull in the usage of NLA_POLICY_EXACT_LEN_WARN() to get things
8to work on kernel 5.8 for now, until we finish the merge from
9there.
10
11type=feature
12ticket=none
13
14Change-Id: I86daa00338d40d7770451b327c7e8b9599912cda
15Signed-off-by: Johannes Berg <johannes.berg@intel.com>
16Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/272290
17Reviewed-by: Ben Ami, Golan <golan.ben.ami@intel.com>
18Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
19Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
20x-iwlwifi-stack-dev: dd1553ab7e2f1e05780a2f6ecfd7a1d0a0d62fa1
21(backported from commit 132470a283b85d0662206171151967b37fae330b)
22Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com>
23---
24 net/wireless/nl80211.c | 81 ++++++++++--------------------------------
25 1 file changed, 18 insertions(+), 63 deletions(-)
26
27diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
28index fa70b33ee..589036d2d 100644
29--- a/net/wireless/nl80211.c
30+++ b/net/wireless/nl80211.c
31@@ -339,11 +339,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
32 [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 },
33 [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 },
34
35- [NL80211_ATTR_MAC] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN },
36- [NL80211_ATTR_PREV_BSSID] = {
37- .type = NLA_EXACT_LEN_WARN,
38- .len = ETH_ALEN
39- },
40+ [NL80211_ATTR_MAC] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
41+ [NL80211_ATTR_PREV_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
42
43 [NL80211_ATTR_KEY] = { .type = NLA_NESTED, },
44 [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY,
45@@ -395,10 +392,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
46 [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED },
47 [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG },
48
49- [NL80211_ATTR_HT_CAPABILITY] = {
50- .type = NLA_EXACT_LEN_WARN,
51- .len = NL80211_HT_CAPABILITY_LEN
52- },
53+ [NL80211_ATTR_HT_CAPABILITY] = NLA_POLICY_EXACT_LEN_WARN(NL80211_HT_CAPABILITY_LEN),
54
55 [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 },
56 [NL80211_ATTR_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY,
57@@ -427,10 +421,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
58 [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
59 [NL80211_ATTR_PID] = { .type = NLA_U32 },
60 [NL80211_ATTR_4ADDR] = { .type = NLA_U8 },
61- [NL80211_ATTR_PMKID] = {
62- .type = NLA_EXACT_LEN_WARN,
63- .len = WLAN_PMKID_LEN
64- },
65+ [NL80211_ATTR_PMKID] = NLA_POLICY_EXACT_LEN_WARN(WLAN_PMKID_LEN),
66 [NL80211_ATTR_DURATION] = { .type = NLA_U32 },
67 [NL80211_ATTR_COOKIE] = { .type = NLA_U64 },
68 [NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED },
69@@ -492,10 +483,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
70 [NL80211_ATTR_WDEV] = { .type = NLA_U64 },
71 [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 },
72 [NL80211_ATTR_AUTH_DATA] = { .type = NLA_BINARY, },
73- [NL80211_ATTR_VHT_CAPABILITY] = {
74- .type = NLA_EXACT_LEN_WARN,
75- .len = NL80211_VHT_CAPABILITY_LEN
76- },
77+ [NL80211_ATTR_VHT_CAPABILITY] = NLA_POLICY_EXACT_LEN_WARN(NL80211_VHT_CAPABILITY_LEN),
78 [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 },
79 [NL80211_ATTR_P2P_CTWINDOW] = NLA_POLICY_MAX(NLA_U8, 127),
80 [NL80211_ATTR_P2P_OPPPS] = NLA_POLICY_MAX(NLA_U8, 1),
81@@ -531,10 +519,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
82 [NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY },
83 [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY,
84 .len = IEEE80211_QOS_MAP_LEN_MAX },
85- [NL80211_ATTR_MAC_HINT] = {
86- .type = NLA_EXACT_LEN_WARN,
87- .len = ETH_ALEN
88- },
89+ [NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
90 [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
91 [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
92 [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG },
93@@ -545,10 +530,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
94 NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1),
95 [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 },
96 [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 },
97- [NL80211_ATTR_MAC_MASK] = {
98- .type = NLA_EXACT_LEN_WARN,
99- .len = ETH_ALEN
100- },
101+ [NL80211_ATTR_MAC_MASK] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
102 [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG },
103 [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 },
104 [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 },
105@@ -560,21 +542,15 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
106 [NL80211_ATTR_MU_MIMO_GROUP_DATA] = {
107 .len = VHT_MUMIMO_GROUPS_DATA_LEN
108 },
109- [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = {
110- .type = NLA_EXACT_LEN_WARN,
111- .len = ETH_ALEN
112- },
113+ [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
114 [NL80211_ATTR_NAN_MASTER_PREF] = NLA_POLICY_MIN(NLA_U8, 1),
115 [NL80211_ATTR_BANDS] = { .type = NLA_U32 },
116 [NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED },
117 [NL80211_ATTR_FILS_KEK] = { .type = NLA_BINARY,
118 .len = FILS_MAX_KEK_LEN },
119- [NL80211_ATTR_FILS_NONCES] = {
120- .type = NLA_EXACT_LEN_WARN,
121- .len = 2 * FILS_NONCE_LEN
122- },
123+ [NL80211_ATTR_FILS_NONCES] = NLA_POLICY_EXACT_LEN_WARN(2 * FILS_NONCE_LEN),
124 [NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED] = { .type = NLA_FLAG, },
125- [NL80211_ATTR_BSSID] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN },
126+ [NL80211_ATTR_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
127 [NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI] = { .type = NLA_S8 },
128 [NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST] = {
129 .len = sizeof(struct nl80211_bss_select_rssi_adjust)
130@@ -587,7 +563,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = {
131 [NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] = { .type = NLA_U16 },
132 [NL80211_ATTR_FILS_ERP_RRK] = { .type = NLA_BINARY,
133 .len = FILS_ERP_MAX_RRK_LEN },
134- [NL80211_ATTR_FILS_CACHE_ID] = { .type = NLA_EXACT_LEN_WARN, .len = 2 },
135+ [NL80211_ATTR_FILS_CACHE_ID] = NLA_POLICY_EXACT_LEN_WARN(2),
136 [NL80211_ATTR_PMK] = { .type = NLA_BINARY, .len = PMK_MAX_LEN },
137 [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG },
138 [NL80211_ATTR_EXTERNAL_AUTH_SUPPORT] = { .type = NLA_FLAG },
139@@ -652,10 +628,7 @@ static const struct nla_policy
140 nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = {
141 [NL80211_WOWLAN_TCP_SRC_IPV4] = { .type = NLA_U32 },
142 [NL80211_WOWLAN_TCP_DST_IPV4] = { .type = NLA_U32 },
143- [NL80211_WOWLAN_TCP_DST_MAC] = {
144- .type = NLA_EXACT_LEN_WARN,
145- .len = ETH_ALEN
146- },
147+ [NL80211_WOWLAN_TCP_DST_MAC] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
148 [NL80211_WOWLAN_TCP_SRC_PORT] = { .type = NLA_U16 },
149 [NL80211_WOWLAN_TCP_DST_PORT] = { .type = NLA_U16 },
150 [NL80211_WOWLAN_TCP_DATA_PAYLOAD] = { .type = NLA_MIN_LEN, .len = 1 },
151@@ -685,18 +658,9 @@ nl80211_coalesce_policy[NUM_NL80211_ATTR_COALESCE_RULE] = {
152 /* policy for GTK rekey offload attributes */
153 static const struct nla_policy
154 nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = {
155- [NL80211_REKEY_DATA_KEK] = {
156- .type = NLA_EXACT_LEN_WARN,
157- .len = NL80211_KEK_LEN,
158- },
159- [NL80211_REKEY_DATA_KCK] = {
160- .type = NLA_EXACT_LEN_WARN,
161- .len = NL80211_KCK_LEN,
162- },
163- [NL80211_REKEY_DATA_REPLAY_CTR] = {
164- .type = NLA_EXACT_LEN_WARN,
165- .len = NL80211_REPLAY_CTR_LEN
166- },
167+ [NL80211_REKEY_DATA_KEK] = NLA_POLICY_EXACT_LEN_WARN(NL80211_KEK_LEN),
168+ [NL80211_REKEY_DATA_KCK] = NLA_POLICY_EXACT_LEN_WARN(NL80211_KCK_LEN),
169+ [NL80211_REKEY_DATA_REPLAY_CTR] = NLA_POLICY_EXACT_LEN_WARN(NL80211_REPLAY_CTR_LEN),
170 };
171
172 static const struct nla_policy
173@@ -711,10 +675,7 @@ static const struct nla_policy
174 nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = {
175 [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY,
176 .len = IEEE80211_MAX_SSID_LEN },
177- [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = {
178- .type = NLA_EXACT_LEN_WARN,
179- .len = ETH_ALEN
180- },
181+ [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
182 [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 },
183 [NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI] =
184 NLA_POLICY_NESTED(nl80211_match_band_rssi_policy),
185@@ -746,10 +707,7 @@ nl80211_nan_func_policy[NL80211_NAN_FUNC_ATTR_MAX + 1] = {
186 [NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE] = { .type = NLA_FLAG },
187 [NL80211_NAN_FUNC_FOLLOW_UP_ID] = { .type = NLA_U8 },
188 [NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID] = { .type = NLA_U8 },
189- [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = {
190- .type = NLA_EXACT_LEN_WARN,
191- .len = ETH_ALEN
192- },
193+ [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
194 [NL80211_NAN_FUNC_CLOSE_RANGE] = { .type = NLA_FLAG },
195 [NL80211_NAN_FUNC_TTL] = { .type = NLA_U32 },
196 [NL80211_NAN_FUNC_SERVICE_INFO] = { .type = NLA_BINARY,
197@@ -4172,10 +4130,7 @@ static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = {
198 .len = NL80211_MAX_SUPP_RATES },
199 [NL80211_TXRATE_HT] = { .type = NLA_BINARY,
200 .len = NL80211_MAX_SUPP_HT_RATES },
201- [NL80211_TXRATE_VHT] = {
202- .type = NLA_EXACT_LEN_WARN,
203- .len = sizeof(struct nl80211_txrate_vht),
204- },
205+ [NL80211_TXRATE_VHT] = NLA_POLICY_EXACT_LEN_WARN(sizeof(struct nl80211_txrate_vht)),
206 [NL80211_TXRATE_GI] = { .type = NLA_U8 },
207 };
208
209--
2102.25.1
211
diff --git a/debian/patches/series b/debian/patches/series
index f4462c8..f19b067 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,12 @@
20002-fix-format-overflow-compile-error-in-kconf-confdata..patch20002-fix-format-overflow-compile-error-in-kconf-confdata..patch
30005-Makefile.kernel-pass-fno-stack-clash-protection-and-.patch30005-Makefile.kernel-pass-fno-stack-clash-protection-and-.patch
40006-backport-address-interface-change-in-linux-skbuff.h-.patch40006-backport-address-interface-change-in-linux-skbuff.h-.patch
50007-backport-add-genlmsg_parse.patch
60008-backport-update-include-uapi-linux-pci_regs.h.patch
70009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch
80010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch
90011-backports-netlink-fix-nla_validate_nested.patch
100012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch
110013-ftrace-Rework-event_create_dir.patch
120014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch
130015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch

Subscribers

People subscribed via source and target branches