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
- Git
- lp:~vicamo/ubuntu/+source/backport-iwlwifi-dkms/+git/backport-iwlwifi-dkms
- bug-1884634/fix-build-against-oem-5.6/focal
- Merge into ubuntu/focal
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) |
Related bugs: |
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/
- [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec
- [NOUPSTREAM] cfg80211: use parallel_ops for genl
- backports: netlink: fix nla_validate_
- netlink: rename nl80211_
- ftrace: Rework event_create_dir()
- nl80211: fix NL80211_
- [NOUPSTREAM] nl80211: pull in NLA_POLICY_
Description of the change
[SRU Justifcation]
[Impact]
When compiled against linux-oem-
[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-
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.
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.
Alberto Milone (albertomilone) wrote : | # |
It looks good to me. Approved, thanks.
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog | |||
2 | index 4aae555..6e485d2 100644 | |||
3 | --- a/debian/changelog | |||
4 | +++ b/debian/changelog | |||
5 | @@ -1,3 +1,18 @@ | |||
6 | 1 | backport-iwlwifi-dkms (8324-0ubuntu3~20.04.2) focal; urgency=medium | ||
7 | 2 | |||
8 | 3 | * Fix build against v5.8 kernel (LP: #1884634) | ||
9 | 4 | - backport: add genlmsg_parse() | ||
10 | 5 | - backport: update include/uapi/linux/pci_regs.h | ||
11 | 6 | - [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec | ||
12 | 7 | - [NOUPSTREAM] cfg80211: use parallel_ops for genl | ||
13 | 8 | - backports: netlink: fix nla_validate_nested() | ||
14 | 9 | - netlink: rename nl80211_validate_nested() to nla_validate_nested() | ||
15 | 10 | - ftrace: Rework event_create_dir() | ||
16 | 11 | - nl80211: fix NL80211_ATTR_FTM_RESPONDER policy | ||
17 | 12 | - [NOUPSTREAM] nl80211: pull in NLA_POLICY_EXACT_LEN_WARN() usage | ||
18 | 13 | |||
19 | 14 | -- You-Sheng Yang <vicamo@gmail.com> Mon, 02 Nov 2020 13:55:31 +0000 | ||
20 | 15 | |||
21 | 1 | backport-iwlwifi-dkms (8324-0ubuntu3~20.04.1) focal; urgency=medium | 16 | backport-iwlwifi-dkms (8324-0ubuntu3~20.04.1) focal; urgency=medium |
22 | 2 | 17 | ||
23 | 3 | * dkms: stop installing kernel on 5.4 or newer (LP: #1863583) | 18 | * dkms: stop installing kernel on 5.4 or newer (LP: #1863583) |
24 | diff --git a/debian/patches/0007-backport-add-genlmsg_parse.patch b/debian/patches/0007-backport-add-genlmsg_parse.patch | |||
25 | 4 | new file mode 100644 | 19 | new file mode 100644 |
26 | index 0000000..c2e385a | |||
27 | --- /dev/null | |||
28 | +++ b/debian/patches/0007-backport-add-genlmsg_parse.patch | |||
29 | @@ -0,0 +1,50 @@ | |||
30 | 1 | From dab7f14acb372b1a0c5f0c8b0b256bbc09f2f362 Mon Sep 17 00:00:00 2001 | ||
31 | 2 | From: Johannes Berg <johannes.berg@intel.com> | ||
32 | 3 | Date: Fri, 28 Feb 2020 09:17:40 +0100 | ||
33 | 4 | Subject: [PATCH] backport: add genlmsg_parse() | ||
34 | 5 | |||
35 | 6 | We just need to provide our own version of this so that | ||
36 | 7 | the types match up correctly. | ||
37 | 8 | |||
38 | 9 | While at it, fix the version ifdef comment. | ||
39 | 10 | |||
40 | 11 | type=feature | ||
41 | 12 | ticket=none | ||
42 | 13 | |||
43 | 14 | Change-Id: Ic7f3b6424b5474b73eb2f9819569118e38e1b479 | ||
44 | 15 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
45 | 16 | Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/254152 | ||
46 | 17 | Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
47 | 18 | x-iwlwifi-stack-dev: da7591716aa2f04b80e987362033452f0e2419b6 | ||
48 | 19 | (cherry picked from commit f207b0f5e770f7f90d8a19fedc9cb72031dd4322) | ||
49 | 20 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
50 | 21 | --- | ||
51 | 22 | backport-include/net/genetlink.h | 13 ++++++++++++- | ||
52 | 23 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
53 | 24 | |||
54 | 25 | diff --git a/backport-include/net/genetlink.h b/backport-include/net/genetlink.h | ||
55 | 26 | index e6b78e02a..90ec7a789 100644 | ||
56 | 27 | --- a/backport-include/net/genetlink.h | ||
57 | 28 | +++ b/backport-include/net/genetlink.h | ||
58 | 29 | @@ -250,6 +250,17 @@ static inline struct nlattr **genl_family_attrbuf(struct genl_family *family) | ||
59 | 30 | |||
60 | 31 | return family->attrbuf; | ||
61 | 32 | } | ||
62 | 33 | -#endif /* LINUX_VERSION_IS_LESS(4,20,0) */ | ||
63 | 34 | + | ||
64 | 35 | +#define genlmsg_parse LINUX_BACKPORT(genlmsg_parse) | ||
65 | 36 | +static inline int genlmsg_parse(const struct nlmsghdr *nlh, | ||
66 | 37 | + const struct genl_family *family, | ||
67 | 38 | + struct nlattr *tb[], int maxtype, | ||
68 | 39 | + const struct nla_policy *policy, | ||
69 | 40 | + struct netlink_ext_ack *extack) | ||
70 | 41 | +{ | ||
71 | 42 | + return __nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype, | ||
72 | 43 | + policy, NL_VALIDATE_STRICT, extack); | ||
73 | 44 | +} | ||
74 | 45 | +#endif /* LINUX_VERSION_IS_LESS(5,2) */ | ||
75 | 46 | |||
76 | 47 | #endif /* __BACKPORT_NET_GENETLINK_H */ | ||
77 | 48 | -- | ||
78 | 49 | 2.25.1 | ||
79 | 50 | |||
80 | 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 | |||
81 | 0 | new file mode 100644 | 51 | new file mode 100644 |
82 | index 0000000..806f8a3 | |||
83 | --- /dev/null | |||
84 | +++ b/debian/patches/0008-backport-update-include-uapi-linux-pci_regs.h.patch | |||
85 | @@ -0,0 +1,108 @@ | |||
86 | 1 | From b9ef5cc9944385cafa3c3f9e6bb18be27b3a97f5 Mon Sep 17 00:00:00 2001 | ||
87 | 2 | From: Johannes Berg <johannes.berg@intel.com> | ||
88 | 3 | Date: Wed, 22 Jan 2020 16:11:01 +0100 | ||
89 | 4 | Subject: [PATCH] backport: update include/uapi/linux/pci_regs.h | ||
90 | 5 | |||
91 | 6 | This file is normally copied during backporting, but until | ||
92 | 7 | we update from the auto tree, pull this manually in order | ||
93 | 8 | to be able to compile against recent kernels (5.5-rc) on | ||
94 | 9 | which linux/pci.h requires PCI_STD_NUM_BARS from here. | ||
95 | 10 | |||
96 | 11 | type=feature | ||
97 | 12 | ticket=none | ||
98 | 13 | |||
99 | 14 | Change-Id: Ia8c75520ae2f937c75fcc97b760e54fc957a49bf | ||
100 | 15 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
101 | 16 | Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/250174 | ||
102 | 17 | Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
103 | 18 | Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> | ||
104 | 19 | x-iwlwifi-stack-dev: 86a15998a19c849821c133ac5df17c99c8bf6d2f | ||
105 | 20 | (cherry picked from commit 6d34e47b86a11606452ca0002965af854ea530e1) | ||
106 | 21 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
107 | 22 | --- | ||
108 | 23 | include/uapi/linux/pci_regs.h | 22 +++++++++++++++++++++- | ||
109 | 24 | 1 file changed, 21 insertions(+), 1 deletion(-) | ||
110 | 25 | |||
111 | 26 | diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h | ||
112 | 27 | index 27164769d..acb7d2bdb 100644 | ||
113 | 28 | --- a/include/uapi/linux/pci_regs.h | ||
114 | 29 | +++ b/include/uapi/linux/pci_regs.h | ||
115 | 30 | @@ -34,6 +34,7 @@ | ||
116 | 31 | * of which the first 64 bytes are standardized as follows: | ||
117 | 32 | */ | ||
118 | 33 | #define PCI_STD_HEADER_SIZEOF 64 | ||
119 | 34 | +#define PCI_STD_NUM_BARS 6 /* Number of standard BARs */ | ||
120 | 35 | #define PCI_VENDOR_ID 0x00 /* 16 bits */ | ||
121 | 36 | #define PCI_DEVICE_ID 0x02 /* 16 bits */ | ||
122 | 37 | #define PCI_COMMAND 0x04 /* 16 bits */ | ||
123 | 38 | @@ -528,6 +529,7 @@ | ||
124 | 39 | #define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */ | ||
125 | 40 | #define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */ | ||
126 | 41 | #define PCI_EXP_LNKCAP_SLS_16_0GB 0x00000004 /* LNKCAP2 SLS Vector bit 3 */ | ||
127 | 42 | +#define PCI_EXP_LNKCAP_SLS_32_0GB 0x00000005 /* LNKCAP2 SLS Vector bit 4 */ | ||
128 | 43 | #define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ | ||
129 | 44 | #define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ | ||
130 | 45 | #define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ | ||
131 | 46 | @@ -556,6 +558,7 @@ | ||
132 | 47 | #define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ | ||
133 | 48 | #define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */ | ||
134 | 49 | #define PCI_EXP_LNKSTA_CLS_16_0GB 0x0004 /* Current Link Speed 16.0GT/s */ | ||
135 | 50 | +#define PCI_EXP_LNKSTA_CLS_32_0GB 0x0005 /* Current Link Speed 32.0GT/s */ | ||
136 | 51 | #define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ | ||
137 | 52 | #define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */ | ||
138 | 53 | #define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */ | ||
139 | 54 | @@ -589,6 +592,7 @@ | ||
140 | 55 | #define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ | ||
141 | 56 | #define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ | ||
142 | 57 | #define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ | ||
143 | 58 | +#define PCI_EXP_SLTCTL_ATTN_IND_SHIFT 6 /* Attention Indicator shift */ | ||
144 | 59 | #define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */ | ||
145 | 60 | #define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */ | ||
146 | 61 | #define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */ | ||
147 | 62 | @@ -661,6 +665,7 @@ | ||
148 | 63 | #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5GT/s */ | ||
149 | 64 | #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8GT/s */ | ||
150 | 65 | #define PCI_EXP_LNKCAP2_SLS_16_0GB 0x00000010 /* Supported Speed 16GT/s */ | ||
151 | 66 | +#define PCI_EXP_LNKCAP2_SLS_32_0GB 0x00000020 /* Supported Speed 32GT/s */ | ||
152 | 67 | #define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */ | ||
153 | 68 | #define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ | ||
154 | 69 | #define PCI_EXP_LNKCTL2_TLS 0x000f | ||
155 | 70 | @@ -668,6 +673,9 @@ | ||
156 | 71 | #define PCI_EXP_LNKCTL2_TLS_5_0GT 0x0002 /* Supported Speed 5GT/s */ | ||
157 | 72 | #define PCI_EXP_LNKCTL2_TLS_8_0GT 0x0003 /* Supported Speed 8GT/s */ | ||
158 | 73 | #define PCI_EXP_LNKCTL2_TLS_16_0GT 0x0004 /* Supported Speed 16GT/s */ | ||
159 | 74 | +#define PCI_EXP_LNKCTL2_TLS_32_0GT 0x0005 /* Supported Speed 32GT/s */ | ||
160 | 75 | +#define PCI_EXP_LNKCTL2_ENTER_COMP 0x0010 /* Enter Compliance */ | ||
161 | 76 | +#define PCI_EXP_LNKCTL2_TX_MARGIN 0x0380 /* Transmit Margin */ | ||
162 | 77 | #define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ | ||
163 | 78 | #define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */ | ||
164 | 79 | #define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */ | ||
165 | 80 | @@ -709,7 +717,9 @@ | ||
166 | 81 | #define PCI_EXT_CAP_ID_DPC 0x1D /* Downstream Port Containment */ | ||
167 | 82 | #define PCI_EXT_CAP_ID_L1SS 0x1E /* L1 PM Substates */ | ||
168 | 83 | #define PCI_EXT_CAP_ID_PTM 0x1F /* Precision Time Measurement */ | ||
169 | 84 | -#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PTM | ||
170 | 85 | +#define PCI_EXT_CAP_ID_DLF 0x25 /* Data Link Feature */ | ||
171 | 86 | +#define PCI_EXT_CAP_ID_PL_16GT 0x26 /* Physical Layer 16.0 GT/s */ | ||
172 | 87 | +#define PCI_EXT_CAP_ID_MAX PCI_EXT_CAP_ID_PL_16GT | ||
173 | 88 | |||
174 | 89 | #define PCI_EXT_CAP_DSN_SIZEOF 12 | ||
175 | 90 | #define PCI_EXT_CAP_MCAST_ENDPOINT_SIZEOF 40 | ||
176 | 91 | @@ -1049,4 +1059,14 @@ | ||
177 | 92 | #define PCI_L1SS_CTL1_LTR_L12_TH_SCALE 0xe0000000 /* LTR_L1.2_THRESHOLD_Scale */ | ||
178 | 93 | #define PCI_L1SS_CTL2 0x0c /* Control 2 Register */ | ||
179 | 94 | |||
180 | 95 | +/* Data Link Feature */ | ||
181 | 96 | +#define PCI_DLF_CAP 0x04 /* Capabilities Register */ | ||
182 | 97 | +#define PCI_DLF_EXCHANGE_ENABLE 0x80000000 /* Data Link Feature Exchange Enable */ | ||
183 | 98 | + | ||
184 | 99 | +/* Physical Layer 16.0 GT/s */ | ||
185 | 100 | +#define PCI_PL_16GT_LE_CTRL 0x20 /* Lane Equalization Control Register */ | ||
186 | 101 | +#define PCI_PL_16GT_LE_CTRL_DSP_TX_PRESET_MASK 0x0000000F | ||
187 | 102 | +#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_MASK 0x000000F0 | ||
188 | 103 | +#define PCI_PL_16GT_LE_CTRL_USP_TX_PRESET_SHIFT 4 | ||
189 | 104 | + | ||
190 | 105 | #endif /* LINUX_PCI_REGS_H */ | ||
191 | 106 | -- | ||
192 | 107 | 2.25.1 | ||
193 | 108 | |||
194 | 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 | |||
195 | 0 | new file mode 100644 | 109 | new file mode 100644 |
196 | index 0000000..10bc138 | |||
197 | --- /dev/null | |||
198 | +++ b/debian/patches/0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch | |||
199 | @@ -0,0 +1,49 @@ | |||
200 | 1 | From 4c7a42b261a102267e50240f0f5c55d2737f0cd2 Mon Sep 17 00:00:00 2001 | ||
201 | 2 | From: Luca Coelho <luciano.coelho@intel.com> | ||
202 | 3 | Date: Fri, 27 Mar 2020 10:22:08 +0200 | ||
203 | 4 | Subject: [PATCH] [NOUPSTREAM] iwlwifi: mvm: use 64-bit version of timespec | ||
204 | 5 | |||
205 | 6 | The getnstimeofday() function was removed in v5.4, being replaced by a | ||
206 | 7 | truly 64-bit version. Replace our only non-upstream usage of | ||
207 | 8 | getnstimeofday() with the new ktime_get_real_s64() function. | ||
208 | 9 | |||
209 | 10 | type=maint | ||
210 | 11 | ticket=none | ||
211 | 12 | |||
212 | 13 | Change-Id: I4643aeebe79f1f48b27eab1c1edeb1d7f396f4cb | ||
213 | 14 | Signed-off-by: Luca Coelho <luciano.coelho@intel.com> | ||
214 | 15 | Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/257132 | ||
215 | 16 | automatic-review: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
216 | 17 | Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
217 | 18 | x-iwlwifi-stack-dev: 6651bda5fd07ca61729d3075acf13f655fc40690 | ||
218 | 19 | (cherry picked from commit a68daa3747f0b0643de3207cb597ffc501c510cd) | ||
219 | 20 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
220 | 21 | --- | ||
221 | 22 | drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++-- | ||
222 | 23 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
223 | 24 | |||
224 | 25 | diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | ||
225 | 26 | index 43430589d..1941c86da 100644 | ||
226 | 27 | --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | ||
227 | 28 | +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | ||
228 | 29 | @@ -5171,7 +5171,7 @@ static void iwl_mvm_event_bar_rx_callback(struct iwl_mvm *mvm, | ||
229 | 30 | static u32 iwl_mvm_send_latency_marker_cmd(struct iwl_mvm *mvm, u32 msrmnt, | ||
230 | 31 | u16 seq, u16 tid) | ||
231 | 32 | { | ||
232 | 33 | - struct timespec ts; | ||
233 | 34 | + struct timespec64 ts; | ||
234 | 35 | int ret; | ||
235 | 36 | struct iwl_mvm_marker_rsp *rsp; | ||
236 | 37 | struct iwl_mvm_marker *marker; | ||
237 | 38 | @@ -5182,7 +5182,7 @@ static u32 iwl_mvm_send_latency_marker_cmd(struct iwl_mvm *mvm, u32 msrmnt, | ||
238 | 39 | u32 cmd_size = sizeof(struct iwl_mvm_marker) + | ||
239 | 40 | MARKER_CMD_TX_LAT_PAYLOAD_SIZE * sizeof(u32); | ||
240 | 41 | |||
241 | 42 | - getnstimeofday(&ts); | ||
242 | 43 | + ktime_get_real_ts64(&ts); | ||
243 | 44 | |||
244 | 45 | marker = kzalloc(cmd_size, GFP_KERNEL); | ||
245 | 46 | if (!marker) | ||
246 | 47 | -- | ||
247 | 48 | 2.25.1 | ||
248 | 49 | |||
249 | 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 | |||
250 | 0 | new file mode 100644 | 50 | new file mode 100644 |
251 | index 0000000..da0d5fe | |||
252 | --- /dev/null | |||
253 | +++ b/debian/patches/0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch | |||
254 | @@ -0,0 +1,282 @@ | |||
255 | 1 | From 145f1fcee90302f44989aaef2486e4166525b09a Mon Sep 17 00:00:00 2001 | ||
256 | 2 | From: Johannes Berg <johannes.berg@intel.com> | ||
257 | 3 | Date: Mon, 29 Jul 2019 16:31:09 +0200 | ||
258 | 4 | Subject: [PATCH] [NOUPSTREAM] cfg80211: use parallel_ops for genl | ||
259 | 5 | |||
260 | 6 | (Imported from upstream commit 50508d941c18 since newer kernels | ||
261 | 7 | remove genl_family_attrbuf() entirely, so we can compile there) | ||
262 | 8 | |||
263 | 9 | Over time, we really need to get rid of all of our global locking. | ||
264 | 10 | One of the things needed is to use parallel_ops. This isn't really | ||
265 | 11 | the most important (RTNL is much more important) but OTOH we just | ||
266 | 12 | keep adding uses of genl_family_attrbuf() now. Use .parallel_ops to | ||
267 | 13 | disallow this. | ||
268 | 14 | |||
269 | 15 | type=feature | ||
270 | 16 | ticket=none | ||
271 | 17 | |||
272 | 18 | Reviewed-By: Denis Kenzior <denkenz@gmail.com> | ||
273 | 19 | Link: https://lore.kernel.org/r/20190729143109.18683-1-johannes@sipsolutions.net | ||
274 | 20 | Change-Id: I351cc0de9d6b6d5f5a14aaf4106ef502ee1b3840 | ||
275 | 21 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
276 | 22 | Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/250173 | ||
277 | 23 | Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
278 | 24 | Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> | ||
279 | 25 | x-iwlwifi-stack-dev: b2d6da5d545c1525b3c73cc3bfaeafbcc770ed15 | ||
280 | 26 | (cherry picked from commit 6360027e3331a93d32b259010e5f37d270f6513a) | ||
281 | 27 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
282 | 28 | --- | ||
283 | 29 | net/wireless/nl80211.c | 108 +++++++++++++++++++++++++++++------------ | ||
284 | 30 | 1 file changed, 78 insertions(+), 30 deletions(-) | ||
285 | 31 | |||
286 | 32 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c | ||
287 | 33 | index fa70b33ee..d8480b6b1 100644 | ||
288 | 34 | --- a/net/wireless/nl80211.c | ||
289 | 35 | +++ b/net/wireless/nl80211.c | ||
290 | 36 | @@ -795,17 +795,25 @@ int nl80211_prepare_wdev_dump(struct netlink_callback *cb, | ||
291 | 37 | int err; | ||
292 | 38 | |||
293 | 39 | if (!cb->args[0]) { | ||
294 | 40 | + struct nlattr **attrbuf; | ||
295 | 41 | + | ||
296 | 42 | + attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), | ||
297 | 43 | + GFP_KERNEL); | ||
298 | 44 | + if (!attrbuf) | ||
299 | 45 | + return -ENOMEM; | ||
300 | 46 | + | ||
301 | 47 | err = nlmsg_parse_deprecated(cb->nlh, | ||
302 | 48 | GENL_HDRLEN + nl80211_fam.hdrsize, | ||
303 | 49 | - genl_family_attrbuf(&nl80211_fam), | ||
304 | 50 | - nl80211_fam.maxattr, | ||
305 | 51 | + attrbuf, nl80211_fam.maxattr, | ||
306 | 52 | nl80211_policy, NULL); | ||
307 | 53 | - if (err) | ||
308 | 54 | + if (err) { | ||
309 | 55 | + kfree(attrbuf); | ||
310 | 56 | return err; | ||
311 | 57 | + } | ||
312 | 58 | |||
313 | 59 | - *wdev = __cfg80211_wdev_from_attrs( | ||
314 | 60 | - sock_net(cb->skb->sk), | ||
315 | 61 | - genl_family_attrbuf(&nl80211_fam)); | ||
316 | 62 | + *wdev = __cfg80211_wdev_from_attrs(sock_net(cb->skb->sk), | ||
317 | 63 | + attrbuf); | ||
318 | 64 | + kfree(attrbuf); | ||
319 | 65 | if (IS_ERR(*wdev)) | ||
320 | 66 | return PTR_ERR(*wdev); | ||
321 | 67 | *rdev = wiphy_to_rdev((*wdev)->wiphy); | ||
322 | 68 | @@ -2429,14 +2437,21 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, | ||
323 | 69 | struct netlink_callback *cb, | ||
324 | 70 | struct nl80211_dump_wiphy_state *state) | ||
325 | 71 | { | ||
326 | 72 | - struct nlattr **tb = genl_family_attrbuf(&nl80211_fam); | ||
327 | 73 | - int ret = nlmsg_parse_deprecated(cb->nlh, | ||
328 | 74 | - GENL_HDRLEN + nl80211_fam.hdrsize, | ||
329 | 75 | - tb, nl80211_fam.maxattr, | ||
330 | 76 | - nl80211_policy, NULL); | ||
331 | 77 | + struct nlattr **tb = kcalloc(NUM_NL80211_ATTR, sizeof(*tb), GFP_KERNEL); | ||
332 | 78 | + int ret; | ||
333 | 79 | + | ||
334 | 80 | + if (!tb) | ||
335 | 81 | + return -ENOMEM; | ||
336 | 82 | + | ||
337 | 83 | + ret = nlmsg_parse_deprecated(cb->nlh, | ||
338 | 84 | + GENL_HDRLEN + nl80211_fam.hdrsize, | ||
339 | 85 | + tb, nl80211_fam.maxattr, | ||
340 | 86 | + nl80211_policy, NULL); | ||
341 | 87 | /* ignore parse errors for backward compatibility */ | ||
342 | 88 | - if (ret) | ||
343 | 89 | - return 0; | ||
344 | 90 | + if (ret) { | ||
345 | 91 | + ret = 0; | ||
346 | 92 | + goto out; | ||
347 | 93 | + } | ||
348 | 94 | |||
349 | 95 | state->split = tb[NL80211_ATTR_SPLIT_WIPHY_DUMP]; | ||
350 | 96 | if (tb[NL80211_ATTR_WIPHY]) | ||
351 | 97 | @@ -2449,8 +2464,10 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, | ||
352 | 98 | int ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]); | ||
353 | 99 | |||
354 | 100 | netdev = __dev_get_by_index(sock_net(skb->sk), ifidx); | ||
355 | 101 | - if (!netdev) | ||
356 | 102 | - return -ENODEV; | ||
357 | 103 | + if (!netdev) { | ||
358 | 104 | + ret = -ENODEV; | ||
359 | 105 | + goto out; | ||
360 | 106 | + } | ||
361 | 107 | if (netdev->ieee80211_ptr) { | ||
362 | 108 | rdev = wiphy_to_rdev( | ||
363 | 109 | netdev->ieee80211_ptr->wiphy); | ||
364 | 110 | @@ -2458,7 +2475,10 @@ static int nl80211_dump_wiphy_parse(struct sk_buff *skb, | ||
365 | 111 | } | ||
366 | 112 | } | ||
367 | 113 | |||
368 | 114 | - return 0; | ||
369 | 115 | + ret = 0; | ||
370 | 116 | +out: | ||
371 | 117 | + kfree(tb); | ||
372 | 118 | + return ret; | ||
373 | 119 | } | ||
374 | 120 | |||
375 | 121 | static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) | ||
376 | 122 | @@ -8774,7 +8794,7 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 portid, u32 seq, | ||
377 | 123 | |||
378 | 124 | static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) | ||
379 | 125 | { | ||
380 | 126 | - struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||
381 | 127 | + struct nlattr **attrbuf; | ||
382 | 128 | struct survey_info survey; | ||
383 | 129 | struct cfg80211_registered_device *rdev; | ||
384 | 130 | struct wireless_dev *wdev; | ||
385 | 131 | @@ -8782,6 +8802,10 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) | ||
386 | 132 | int res; | ||
387 | 133 | bool radio_stats; | ||
388 | 134 | |||
389 | 135 | + attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL); | ||
390 | 136 | + if (!attrbuf) | ||
391 | 137 | + return -ENOMEM; | ||
392 | 138 | + | ||
393 | 139 | rtnl_lock(); | ||
394 | 140 | res = nl80211_prepare_wdev_dump(cb, &rdev, &wdev); | ||
395 | 141 | if (res) | ||
396 | 142 | @@ -8826,6 +8850,7 @@ static int nl80211_dump_survey(struct sk_buff *skb, struct netlink_callback *cb) | ||
397 | 143 | cb->args[2] = survey_idx; | ||
398 | 144 | res = skb->len; | ||
399 | 145 | out_err: | ||
400 | 146 | + kfree(attrbuf); | ||
401 | 147 | rtnl_unlock(); | ||
402 | 148 | return res; | ||
403 | 149 | } | ||
404 | 150 | @@ -9690,6 +9715,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | ||
405 | 151 | struct netlink_callback *cb) | ||
406 | 152 | { | ||
407 | 153 | struct cfg80211_registered_device *rdev; | ||
408 | 154 | + struct nlattr **attrbuf = NULL; | ||
409 | 155 | int err; | ||
410 | 156 | long phy_idx; | ||
411 | 157 | void *data = NULL; | ||
412 | 158 | @@ -9710,7 +9736,12 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | ||
413 | 159 | goto out_err; | ||
414 | 160 | } | ||
415 | 161 | } else { | ||
416 | 162 | - struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||
417 | 163 | + attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), | ||
418 | 164 | + GFP_KERNEL); | ||
419 | 165 | + if (!attrbuf) { | ||
420 | 166 | + err = -ENOMEM; | ||
421 | 167 | + goto out_err; | ||
422 | 168 | + } | ||
423 | 169 | |||
424 | 170 | err = nlmsg_parse_deprecated(cb->nlh, | ||
425 | 171 | GENL_HDRLEN + nl80211_fam.hdrsize, | ||
426 | 172 | @@ -9777,6 +9808,7 @@ static int nl80211_testmode_dump(struct sk_buff *skb, | ||
427 | 173 | /* see above */ | ||
428 | 174 | cb->args[0] = phy_idx + 1; | ||
429 | 175 | out_err: | ||
430 | 176 | + kfree(attrbuf); | ||
431 | 177 | rtnl_unlock(); | ||
432 | 178 | return err; | ||
433 | 179 | } | ||
434 | 180 | @@ -13140,7 +13172,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | ||
435 | 181 | struct cfg80211_registered_device **rdev, | ||
436 | 182 | struct wireless_dev **wdev) | ||
437 | 183 | { | ||
438 | 184 | - struct nlattr **attrbuf = genl_family_attrbuf(&nl80211_fam); | ||
439 | 185 | + struct nlattr **attrbuf; | ||
440 | 186 | u32 vid, subcmd; | ||
441 | 187 | unsigned int i; | ||
442 | 188 | int vcmd_idx = -1; | ||
443 | 189 | @@ -13171,24 +13203,32 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | ||
444 | 190 | return 0; | ||
445 | 191 | } | ||
446 | 192 | |||
447 | 193 | + attrbuf = kcalloc(NUM_NL80211_ATTR, sizeof(*attrbuf), GFP_KERNEL); | ||
448 | 194 | + if (!attrbuf) | ||
449 | 195 | + return -ENOMEM; | ||
450 | 196 | + | ||
451 | 197 | err = nlmsg_parse_deprecated(cb->nlh, | ||
452 | 198 | GENL_HDRLEN + nl80211_fam.hdrsize, | ||
453 | 199 | attrbuf, nl80211_fam.maxattr, | ||
454 | 200 | nl80211_policy, NULL); | ||
455 | 201 | if (err) | ||
456 | 202 | - return err; | ||
457 | 203 | + goto out; | ||
458 | 204 | |||
459 | 205 | if (!attrbuf[NL80211_ATTR_VENDOR_ID] || | ||
460 | 206 | - !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) | ||
461 | 207 | - return -EINVAL; | ||
462 | 208 | + !attrbuf[NL80211_ATTR_VENDOR_SUBCMD]) { | ||
463 | 209 | + err = -EINVAL; | ||
464 | 210 | + goto out; | ||
465 | 211 | + } | ||
466 | 212 | |||
467 | 213 | *wdev = __cfg80211_wdev_from_attrs(sock_net(skb->sk), attrbuf); | ||
468 | 214 | if (IS_ERR(*wdev)) | ||
469 | 215 | *wdev = NULL; | ||
470 | 216 | |||
471 | 217 | *rdev = __cfg80211_rdev_from_attrs(sock_net(skb->sk), attrbuf); | ||
472 | 218 | - if (IS_ERR(*rdev)) | ||
473 | 219 | - return PTR_ERR(*rdev); | ||
474 | 220 | + if (IS_ERR(*rdev)) { | ||
475 | 221 | + err = PTR_ERR(*rdev); | ||
476 | 222 | + goto out; | ||
477 | 223 | + } | ||
478 | 224 | |||
479 | 225 | vid = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_ID]); | ||
480 | 226 | subcmd = nla_get_u32(attrbuf[NL80211_ATTR_VENDOR_SUBCMD]); | ||
481 | 227 | @@ -13201,15 +13241,19 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | ||
482 | 228 | if (vcmd->info.vendor_id != vid || vcmd->info.subcmd != subcmd) | ||
483 | 229 | continue; | ||
484 | 230 | |||
485 | 231 | - if (!vcmd->dumpit) | ||
486 | 232 | - return -EOPNOTSUPP; | ||
487 | 233 | + if (!vcmd->dumpit) { | ||
488 | 234 | + err = -EOPNOTSUPP; | ||
489 | 235 | + goto out; | ||
490 | 236 | + } | ||
491 | 237 | |||
492 | 238 | vcmd_idx = i; | ||
493 | 239 | break; | ||
494 | 240 | } | ||
495 | 241 | |||
496 | 242 | - if (vcmd_idx < 0) | ||
497 | 243 | - return -EOPNOTSUPP; | ||
498 | 244 | + if (vcmd_idx < 0) { | ||
499 | 245 | + err = -EOPNOTSUPP; | ||
500 | 246 | + goto out; | ||
501 | 247 | + } | ||
502 | 248 | |||
503 | 249 | if (attrbuf[NL80211_ATTR_VENDOR_DATA]) { | ||
504 | 250 | data = nla_data(attrbuf[NL80211_ATTR_VENDOR_DATA]); | ||
505 | 251 | @@ -13220,7 +13264,7 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | ||
506 | 252 | attrbuf[NL80211_ATTR_VENDOR_DATA], | ||
507 | 253 | genl_callback_extack(cb)); | ||
508 | 254 | if (err) | ||
509 | 255 | - return err; | ||
510 | 256 | + goto out; | ||
511 | 257 | } | ||
512 | 258 | |||
513 | 259 | /* 0 is the first index - add 1 to parse only once */ | ||
514 | 260 | @@ -13232,7 +13276,10 @@ static int nl80211_prepare_vendor_dump(struct sk_buff *skb, | ||
515 | 261 | cb->args[4] = data_len; | ||
516 | 262 | |||
517 | 263 | /* keep rtnl locked in successful case */ | ||
518 | 264 | - return 0; | ||
519 | 265 | + err = 0; | ||
520 | 266 | +out: | ||
521 | 267 | + kfree(attrbuf); | ||
522 | 268 | + return err; | ||
523 | 269 | } | ||
524 | 270 | |||
525 | 271 | static int nl80211_vendor_cmd_dump(struct sk_buff *skb, | ||
526 | 272 | @@ -14927,6 +14974,7 @@ static struct genl_family nl80211_fam __genl_ro_after_init = { | ||
527 | 273 | .n_ops = ARRAY_SIZE(nl80211_ops), | ||
528 | 274 | .mcgrps = nl80211_mcgrps, | ||
529 | 275 | .n_mcgrps = ARRAY_SIZE(nl80211_mcgrps), | ||
530 | 276 | + .parallel_ops = true, | ||
531 | 277 | }; | ||
532 | 278 | |||
533 | 279 | /* notification functions */ | ||
534 | 280 | -- | ||
535 | 281 | 2.25.1 | ||
536 | 282 | |||
537 | diff --git a/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch b/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch | |||
538 | 0 | new file mode 100644 | 283 | new file mode 100644 |
539 | index 0000000..011f8da | |||
540 | --- /dev/null | |||
541 | +++ b/debian/patches/0011-backports-netlink-fix-nla_validate_nested.patch | |||
542 | @@ -0,0 +1,43 @@ | |||
543 | 1 | From: Johannes Berg <johannes.berg@intel.com> | ||
544 | 2 | Date: Thu, 12 Mar 2020 16:59:13 +0100 | ||
545 | 3 | Subject: backports: netlink: fix nla_validate_nested() | ||
546 | 4 | |||
547 | 5 | I had accidentally named this nl80211_validate_nested(), | ||
548 | 6 | and it got renamed in 5.6. | ||
549 | 7 | |||
550 | 8 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
551 | 9 | (cherry picked from commit f1708ac5643a1decf36ca92ba0644397df5da1f9 | ||
552 | 10 | https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git) | ||
553 | 11 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
554 | 12 | --- | ||
555 | 13 | backport-include/net/netlink.h | 12 ++++++------ | ||
556 | 14 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
557 | 15 | |||
558 | 16 | diff --git a/backport-include/net/netlink.h b/backport-include/net/netlink.h | ||
559 | 17 | index 9a5c270..942217e 100644 | ||
560 | 18 | --- a/backport-include/net/netlink.h | ||
561 | 19 | +++ b/backport-include/net/netlink.h | ||
562 | 20 | @@ -266,17 +266,17 @@ nla_validate_nested_deprecated(const struct nlattr *start, int maxtype, | ||
563 | 21 | } | ||
564 | 22 | #endif /* < 5.2 */ | ||
565 | 23 | |||
566 | 24 | -#if LINUX_VERSION_IS_LESS(5,3,0) | ||
567 | 25 | -#define nl80211_validate_nested LINUX_BACKPORT(nl80211_validate_nested) | ||
568 | 26 | +#if LINUX_VERSION_IS_LESS(5,6,0) | ||
569 | 27 | +#define nla_validate_nested LINUX_BACKPORT(nla_validate_nested) | ||
570 | 28 | static inline int | ||
571 | 29 | -nl80211_validate_nested(const struct nlattr *start, int maxtype, | ||
572 | 30 | - const struct nla_policy *policy, | ||
573 | 31 | - struct netlink_ext_ack *extack) | ||
574 | 32 | +nla_validate_nested(const struct nlattr *start, int maxtype, | ||
575 | 33 | + const struct nla_policy *policy, | ||
576 | 34 | + struct netlink_ext_ack *extack) | ||
577 | 35 | { | ||
578 | 36 | return __nla_validate_nested(start, maxtype, policy, | ||
579 | 37 | NL_VALIDATE_STRICT, extack); | ||
580 | 38 | } | ||
581 | 39 | -#endif /* < 5.3 */ | ||
582 | 40 | +#endif /* < 5.6 */ | ||
583 | 41 | |||
584 | 42 | #if LINUX_VERSION_IS_LESS(5,1,0) | ||
585 | 43 | #undef NLA_POLICY_NESTED | ||
586 | 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 | |||
587 | 0 | new file mode 100644 | 44 | new file mode 100644 |
588 | index 0000000..6de3bcf | |||
589 | --- /dev/null | |||
590 | +++ b/debian/patches/0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch | |||
591 | @@ -0,0 +1,34 @@ | |||
592 | 1 | From: Michal Kubecek <mkubecek@suse.cz> | ||
593 | 2 | Date: Wed, 11 Dec 2019 10:58:19 +0100 | ||
594 | 3 | Subject: netlink: rename nl80211_validate_nested() to nla_validate_nested() | ||
595 | 4 | |||
596 | 5 | Function nl80211_validate_nested() is not specific to nl80211, it's | ||
597 | 6 | a counterpart to nla_validate_nested_deprecated() with strict validation. | ||
598 | 7 | For consistency with other validation and parse functions, rename it to | ||
599 | 8 | nla_validate_nested(). | ||
600 | 9 | |||
601 | 10 | Signed-off-by: Michal Kubecek <mkubecek@suse.cz> | ||
602 | 11 | Acked-by: Jiri Pirko <jiri@mellanox.com> | ||
603 | 12 | Reviewed-by: Johannes Berg <johannes@sipsolutions.net> | ||
604 | 13 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
605 | 14 | (backported from commit 32d5109a9d864aea3981f0b5ea736eee4e11b42a | ||
606 | 15 | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) | ||
607 | 16 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
608 | 17 | --- | ||
609 | 18 | net/wireless/nl80211.c | 3 +-- | ||
610 | 19 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
611 | 20 | |||
612 | 21 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c | ||
613 | 22 | index d8480b6..702a269 100644 | ||
614 | 23 | --- a/net/wireless/nl80211.c | ||
615 | 24 | +++ b/net/wireless/nl80211.c | ||
616 | 25 | @@ -13088,8 +13088,7 @@ static int nl80211_vendor_check_policy(const struct wiphy_vendor_command *vcmd, | ||
617 | 26 | return -EINVAL; | ||
618 | 27 | } | ||
619 | 28 | |||
620 | 29 | - return nl80211_validate_nested(attr, vcmd->maxattr, vcmd->policy, | ||
621 | 30 | - extack); | ||
622 | 31 | + return nla_validate_nested(attr, vcmd->maxattr, vcmd->policy, extack); | ||
623 | 32 | } | ||
624 | 33 | |||
625 | 34 | static int nl80211_vendor_cmd(struct sk_buff *skb, struct genl_info *info) | ||
626 | diff --git a/debian/patches/0013-ftrace-Rework-event_create_dir.patch b/debian/patches/0013-ftrace-Rework-event_create_dir.patch | |||
627 | 0 | new file mode 100644 | 35 | new file mode 100644 |
628 | index 0000000..4d42878 | |||
629 | --- /dev/null | |||
630 | +++ b/debian/patches/0013-ftrace-Rework-event_create_dir.patch | |||
631 | @@ -0,0 +1,125 @@ | |||
632 | 1 | From f992b8d650c313c7788f287583c323531244abc7 Mon Sep 17 00:00:00 2001 | ||
633 | 2 | From: Peter Zijlstra <peterz@infradead.org> | ||
634 | 3 | Date: Thu, 24 Oct 2019 22:26:59 +0200 | ||
635 | 4 | Subject: [PATCH] ftrace: Rework event_create_dir() | ||
636 | 5 | |||
637 | 6 | Rework event_create_dir() to use an array of static data instead of | ||
638 | 7 | function pointers where possible. | ||
639 | 8 | |||
640 | 9 | The problem is that it would call the function pointer on module load | ||
641 | 10 | before parse_args(), possibly even before jump_labels were initialized. | ||
642 | 11 | Luckily the generated functions don't use jump_labels but it still seems | ||
643 | 12 | fragile. It also gets in the way of changing when we make the module map | ||
644 | 13 | executable. | ||
645 | 14 | |||
646 | 15 | The generated function are basically calling trace_define_field() with a | ||
647 | 16 | bunch of static arguments. So instead of a function, capture these | ||
648 | 17 | arguments in a static array, avoiding the function call. | ||
649 | 18 | |||
650 | 19 | Now there are a number of cases where the fields are dynamic (syscall | ||
651 | 20 | arguments, kprobes and uprobes), in which case a static array does not | ||
652 | 21 | work, for these we preserve the function call. Luckily all these cases | ||
653 | 22 | are not related to modules and so we can retain the function call for | ||
654 | 23 | them. | ||
655 | 24 | |||
656 | 25 | Also fix up all broken tracepoint definitions that now generate a | ||
657 | 26 | compile error. | ||
658 | 27 | |||
659 | 28 | Tested-by: Alexei Starovoitov <ast@kernel.org> | ||
660 | 29 | Tested-by: Steven Rostedt (VMware) <rostedt@goodmis.org> | ||
661 | 30 | Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> | ||
662 | 31 | Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> | ||
663 | 32 | Acked-by: Alexei Starovoitov <ast@kernel.org> | ||
664 | 33 | Cc: Andy Lutomirski <luto@kernel.org> | ||
665 | 34 | Cc: Borislav Petkov <bp@alien8.de> | ||
666 | 35 | Cc: Brian Gerst <brgerst@gmail.com> | ||
667 | 36 | Cc: Denys Vlasenko <dvlasenk@redhat.com> | ||
668 | 37 | Cc: H. Peter Anvin <hpa@zytor.com> | ||
669 | 38 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | ||
670 | 39 | Cc: Peter Zijlstra <peterz@infradead.org> | ||
671 | 40 | Cc: Steven Rostedt <rostedt@goodmis.org> | ||
672 | 41 | Cc: Thomas Gleixner <tglx@linutronix.de> | ||
673 | 42 | Link: https://lkml.kernel.org/r/20191111132458.342979914@infradead.org | ||
674 | 43 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | ||
675 | 44 | (backported from commit 04ae87a52074e2d448fc66143f1bd2c7d694d2b9 | ||
676 | 45 | https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) | ||
677 | 46 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
678 | 47 | --- | ||
679 | 48 | net/mac80211/trace.h | 28 ++++++++++++++-------------- | ||
680 | 49 | net/wireless/trace.h | 4 ++-- | ||
681 | 50 | 2 files changed, 16 insertions(+), 16 deletions(-) | ||
682 | 51 | |||
683 | 52 | diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h | ||
684 | 53 | index 009578490..9f034a3c2 100644 | ||
685 | 54 | --- a/net/mac80211/trace.h | ||
686 | 55 | +++ b/net/mac80211/trace.h | ||
687 | 56 | @@ -408,20 +408,20 @@ TRACE_EVENT(drv_bss_info_changed, | ||
688 | 57 | __field(u32, basic_rates) | ||
689 | 58 | __array(int, mcast_rate, NUM_NL80211_BANDS) | ||
690 | 59 | __field(u16, ht_operation_mode) | ||
691 | 60 | - __field(s32, cqm_rssi_thold); | ||
692 | 61 | - __field(s32, cqm_rssi_hyst); | ||
693 | 62 | - __field(u32, channel_width); | ||
694 | 63 | - __field(u32, channel_cfreq1); | ||
695 | 64 | + __field(s32, cqm_rssi_thold) | ||
696 | 65 | + __field(s32, cqm_rssi_hyst) | ||
697 | 66 | + __field(u32, channel_width) | ||
698 | 67 | + __field(u32, channel_cfreq1) | ||
699 | 68 | __dynamic_array(u32, arp_addr_list, | ||
700 | 69 | info->arp_addr_cnt > IEEE80211_BSS_ARP_ADDR_LIST_LEN ? | ||
701 | 70 | IEEE80211_BSS_ARP_ADDR_LIST_LEN : | ||
702 | 71 | - info->arp_addr_cnt); | ||
703 | 72 | - __field(int, arp_addr_cnt); | ||
704 | 73 | - __field(bool, qos); | ||
705 | 74 | - __field(bool, idle); | ||
706 | 75 | - __field(bool, ps); | ||
707 | 76 | - __dynamic_array(u8, ssid, info->ssid_len); | ||
708 | 77 | - __field(bool, hidden_ssid); | ||
709 | 78 | + info->arp_addr_cnt) | ||
710 | 79 | + __field(int, arp_addr_cnt) | ||
711 | 80 | + __field(bool, qos) | ||
712 | 81 | + __field(bool, idle) | ||
713 | 82 | + __field(bool, ps) | ||
714 | 83 | + __dynamic_array(u8, ssid, info->ssid_len) | ||
715 | 84 | + __field(bool, hidden_ssid) | ||
716 | 85 | __field(int, txpower) | ||
717 | 86 | __field(u8, p2p_oppps_ctwindow) | ||
718 | 87 | ), | ||
719 | 88 | @@ -1672,8 +1672,8 @@ TRACE_EVENT(drv_start_ap, | ||
720 | 89 | VIF_ENTRY | ||
721 | 90 | __field(u8, dtimper) | ||
722 | 91 | __field(u16, bcnint) | ||
723 | 92 | - __dynamic_array(u8, ssid, info->ssid_len); | ||
724 | 93 | - __field(bool, hidden_ssid); | ||
725 | 94 | + __dynamic_array(u8, ssid, info->ssid_len) | ||
726 | 95 | + __field(bool, hidden_ssid) | ||
727 | 96 | ), | ||
728 | 97 | |||
729 | 98 | TP_fast_assign( | ||
730 | 99 | @@ -1739,7 +1739,7 @@ TRACE_EVENT(drv_join_ibss, | ||
731 | 100 | VIF_ENTRY | ||
732 | 101 | __field(u8, dtimper) | ||
733 | 102 | __field(u16, bcnint) | ||
734 | 103 | - __dynamic_array(u8, ssid, info->ssid_len); | ||
735 | 104 | + __dynamic_array(u8, ssid, info->ssid_len) | ||
736 | 105 | ), | ||
737 | 106 | |||
738 | 107 | TP_fast_assign( | ||
739 | 108 | diff --git a/net/wireless/trace.h b/net/wireless/trace.h | ||
740 | 109 | index 896b73dc8..3aa5f116e 100644 | ||
741 | 110 | --- a/net/wireless/trace.h | ||
742 | 111 | +++ b/net/wireless/trace.h | ||
743 | 112 | @@ -2051,8 +2051,8 @@ TRACE_EVENT(rdev_nan_change_conf, | ||
744 | 113 | WIPHY_ENTRY | ||
745 | 114 | WDEV_ENTRY | ||
746 | 115 | __field(u8, master_pref) | ||
747 | 116 | - __field(u8, bands); | ||
748 | 117 | - __field(u32, changes); | ||
749 | 118 | + __field(u8, bands) | ||
750 | 119 | + __field(u32, changes) | ||
751 | 120 | ), | ||
752 | 121 | TP_fast_assign( | ||
753 | 122 | WIPHY_ASSIGN; | ||
754 | 123 | -- | ||
755 | 124 | 2.27.0 | ||
756 | 125 | |||
757 | 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 | |||
758 | 0 | new file mode 100644 | 126 | new file mode 100644 |
759 | index 0000000..1b022ef | |||
760 | --- /dev/null | |||
761 | +++ b/debian/patches/0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch | |||
762 | @@ -0,0 +1,39 @@ | |||
763 | 1 | From c3ed40441774defdec1a38256ef6dae75b5a7a11 Mon Sep 17 00:00:00 2001 | ||
764 | 2 | From: Johannes Berg <johannes.berg@intel.com> | ||
765 | 3 | Date: Sun, 12 Apr 2020 00:40:30 +0200 | ||
766 | 4 | Subject: [PATCH] nl80211: fix NL80211_ATTR_FTM_RESPONDER policy | ||
767 | 5 | |||
768 | 6 | The nested policy here should be established using the | ||
769 | 7 | NLA_POLICY_NESTED() macro so the length is properly | ||
770 | 8 | filled in. | ||
771 | 9 | |||
772 | 10 | Cc: stable@vger.kernel.org | ||
773 | 11 | Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") | ||
774 | 12 | Link: https://lore.kernel.org/r/20200412004029.9d0722bb56c8.Ie690bfcc4a1a61ff8d8ca7e475d59fcaa52fb2da@changeid | ||
775 | 13 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
776 | 14 | (cherry-picked from commit 0e012b4e4b5ec8e064be3502382579dd0bb43269) | ||
777 | 15 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
778 | 16 | --- | ||
779 | 17 | net/wireless/nl80211.c | 6 ++---- | ||
780 | 18 | 1 file changed, 2 insertions(+), 4 deletions(-) | ||
781 | 19 | |||
782 | 20 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c | ||
783 | 21 | index fa70b33ee..1c988c10f 100644 | ||
784 | 22 | --- a/net/wireless/nl80211.c | ||
785 | 23 | +++ b/net/wireless/nl80211.c | ||
786 | 24 | @@ -598,10 +598,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
787 | 25 | [NL80211_ATTR_HE_CAPABILITY] = { .type = NLA_BINARY, | ||
788 | 26 | .len = NL80211_HE_MAX_CAPABILITY_LEN }, | ||
789 | 27 | |||
790 | 28 | - [NL80211_ATTR_FTM_RESPONDER] = { | ||
791 | 29 | - .type = NLA_NESTED, | ||
792 | 30 | - .validation_data = nl80211_ftm_responder_policy, | ||
793 | 31 | - }, | ||
794 | 32 | + [NL80211_ATTR_FTM_RESPONDER] = | ||
795 | 33 | + NLA_POLICY_NESTED(nl80211_ftm_responder_policy), | ||
796 | 34 | [NL80211_ATTR_TIMEOUT] = NLA_POLICY_MIN(NLA_U32, 1), | ||
797 | 35 | [NL80211_ATTR_PEER_MEASUREMENTS] = | ||
798 | 36 | NLA_POLICY_NESTED(nl80211_pmsr_attr_policy), | ||
799 | 37 | -- | ||
800 | 38 | 2.25.1 | ||
801 | 39 | |||
802 | 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 | |||
803 | 0 | new file mode 100644 | 40 | new file mode 100644 |
804 | index 0000000..13c6281 | |||
805 | --- /dev/null | |||
806 | +++ b/debian/patches/0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch | |||
807 | @@ -0,0 +1,211 @@ | |||
808 | 1 | From 580b5af2262d5f55ffaeb9b8f265e08b193aa411 Mon Sep 17 00:00:00 2001 | ||
809 | 2 | From: Johannes Berg <johannes.berg@intel.com> | ||
810 | 3 | Date: Tue, 4 Aug 2020 10:25:29 +0200 | ||
811 | 4 | Subject: [PATCH] [NOUPSTREAM] nl80211: pull in NLA_POLICY_EXACT_LEN_WARN() | ||
812 | 5 | usage | ||
813 | 6 | |||
814 | 7 | Pull in the usage of NLA_POLICY_EXACT_LEN_WARN() to get things | ||
815 | 8 | to work on kernel 5.8 for now, until we finish the merge from | ||
816 | 9 | there. | ||
817 | 10 | |||
818 | 11 | type=feature | ||
819 | 12 | ticket=none | ||
820 | 13 | |||
821 | 14 | Change-Id: I86daa00338d40d7770451b327c7e8b9599912cda | ||
822 | 15 | Signed-off-by: Johannes Berg <johannes.berg@intel.com> | ||
823 | 16 | Reviewed-on: https://git-amr-3.devtools.intel.com/gerrit/272290 | ||
824 | 17 | Reviewed-by: Ben Ami, Golan <golan.ben.ami@intel.com> | ||
825 | 18 | Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> | ||
826 | 19 | Tested-by: ec ger unix iil jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM> | ||
827 | 20 | x-iwlwifi-stack-dev: dd1553ab7e2f1e05780a2f6ecfd7a1d0a0d62fa1 | ||
828 | 21 | (backported from commit 132470a283b85d0662206171151967b37fae330b) | ||
829 | 22 | Signed-off-by: You-Sheng Yang <vicamo.yang@canonical.com> | ||
830 | 23 | --- | ||
831 | 24 | net/wireless/nl80211.c | 81 ++++++++++-------------------------------- | ||
832 | 25 | 1 file changed, 18 insertions(+), 63 deletions(-) | ||
833 | 26 | |||
834 | 27 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c | ||
835 | 28 | index fa70b33ee..589036d2d 100644 | ||
836 | 29 | --- a/net/wireless/nl80211.c | ||
837 | 30 | +++ b/net/wireless/nl80211.c | ||
838 | 31 | @@ -339,11 +339,8 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
839 | 32 | [NL80211_ATTR_IFINDEX] = { .type = NLA_U32 }, | ||
840 | 33 | [NL80211_ATTR_IFNAME] = { .type = NLA_NUL_STRING, .len = IFNAMSIZ-1 }, | ||
841 | 34 | |||
842 | 35 | - [NL80211_ATTR_MAC] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN }, | ||
843 | 36 | - [NL80211_ATTR_PREV_BSSID] = { | ||
844 | 37 | - .type = NLA_EXACT_LEN_WARN, | ||
845 | 38 | - .len = ETH_ALEN | ||
846 | 39 | - }, | ||
847 | 40 | + [NL80211_ATTR_MAC] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
848 | 41 | + [NL80211_ATTR_PREV_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
849 | 42 | |||
850 | 43 | [NL80211_ATTR_KEY] = { .type = NLA_NESTED, }, | ||
851 | 44 | [NL80211_ATTR_KEY_DATA] = { .type = NLA_BINARY, | ||
852 | 45 | @@ -395,10 +392,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
853 | 46 | [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED }, | ||
854 | 47 | [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG }, | ||
855 | 48 | |||
856 | 49 | - [NL80211_ATTR_HT_CAPABILITY] = { | ||
857 | 50 | - .type = NLA_EXACT_LEN_WARN, | ||
858 | 51 | - .len = NL80211_HT_CAPABILITY_LEN | ||
859 | 52 | - }, | ||
860 | 53 | + [NL80211_ATTR_HT_CAPABILITY] = NLA_POLICY_EXACT_LEN_WARN(NL80211_HT_CAPABILITY_LEN), | ||
861 | 54 | |||
862 | 55 | [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 }, | ||
863 | 56 | [NL80211_ATTR_IE] = NLA_POLICY_VALIDATE_FN(NLA_BINARY, | ||
864 | 57 | @@ -427,10 +421,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
865 | 58 | [NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 }, | ||
866 | 59 | [NL80211_ATTR_PID] = { .type = NLA_U32 }, | ||
867 | 60 | [NL80211_ATTR_4ADDR] = { .type = NLA_U8 }, | ||
868 | 61 | - [NL80211_ATTR_PMKID] = { | ||
869 | 62 | - .type = NLA_EXACT_LEN_WARN, | ||
870 | 63 | - .len = WLAN_PMKID_LEN | ||
871 | 64 | - }, | ||
872 | 65 | + [NL80211_ATTR_PMKID] = NLA_POLICY_EXACT_LEN_WARN(WLAN_PMKID_LEN), | ||
873 | 66 | [NL80211_ATTR_DURATION] = { .type = NLA_U32 }, | ||
874 | 67 | [NL80211_ATTR_COOKIE] = { .type = NLA_U64 }, | ||
875 | 68 | [NL80211_ATTR_TX_RATES] = { .type = NLA_NESTED }, | ||
876 | 69 | @@ -492,10 +483,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
877 | 70 | [NL80211_ATTR_WDEV] = { .type = NLA_U64 }, | ||
878 | 71 | [NL80211_ATTR_USER_REG_HINT_TYPE] = { .type = NLA_U32 }, | ||
879 | 72 | [NL80211_ATTR_AUTH_DATA] = { .type = NLA_BINARY, }, | ||
880 | 73 | - [NL80211_ATTR_VHT_CAPABILITY] = { | ||
881 | 74 | - .type = NLA_EXACT_LEN_WARN, | ||
882 | 75 | - .len = NL80211_VHT_CAPABILITY_LEN | ||
883 | 76 | - }, | ||
884 | 77 | + [NL80211_ATTR_VHT_CAPABILITY] = NLA_POLICY_EXACT_LEN_WARN(NL80211_VHT_CAPABILITY_LEN), | ||
885 | 78 | [NL80211_ATTR_SCAN_FLAGS] = { .type = NLA_U32 }, | ||
886 | 79 | [NL80211_ATTR_P2P_CTWINDOW] = NLA_POLICY_MAX(NLA_U8, 127), | ||
887 | 80 | [NL80211_ATTR_P2P_OPPPS] = NLA_POLICY_MAX(NLA_U8, 1), | ||
888 | 81 | @@ -531,10 +519,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
889 | 82 | [NL80211_ATTR_VENDOR_DATA] = { .type = NLA_BINARY }, | ||
890 | 83 | [NL80211_ATTR_QOS_MAP] = { .type = NLA_BINARY, | ||
891 | 84 | .len = IEEE80211_QOS_MAP_LEN_MAX }, | ||
892 | 85 | - [NL80211_ATTR_MAC_HINT] = { | ||
893 | 86 | - .type = NLA_EXACT_LEN_WARN, | ||
894 | 87 | - .len = ETH_ALEN | ||
895 | 88 | - }, | ||
896 | 89 | + [NL80211_ATTR_MAC_HINT] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
897 | 90 | [NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 }, | ||
898 | 91 | [NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 }, | ||
899 | 92 | [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG }, | ||
900 | 93 | @@ -545,10 +530,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
901 | 94 | NLA_POLICY_MAX(NLA_U8, IEEE80211_NUM_UPS - 1), | ||
902 | 95 | [NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 }, | ||
903 | 96 | [NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 }, | ||
904 | 97 | - [NL80211_ATTR_MAC_MASK] = { | ||
905 | 98 | - .type = NLA_EXACT_LEN_WARN, | ||
906 | 99 | - .len = ETH_ALEN | ||
907 | 100 | - }, | ||
908 | 101 | + [NL80211_ATTR_MAC_MASK] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
909 | 102 | [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG }, | ||
910 | 103 | [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 }, | ||
911 | 104 | [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 }, | ||
912 | 105 | @@ -560,21 +542,15 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
913 | 106 | [NL80211_ATTR_MU_MIMO_GROUP_DATA] = { | ||
914 | 107 | .len = VHT_MUMIMO_GROUPS_DATA_LEN | ||
915 | 108 | }, | ||
916 | 109 | - [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = { | ||
917 | 110 | - .type = NLA_EXACT_LEN_WARN, | ||
918 | 111 | - .len = ETH_ALEN | ||
919 | 112 | - }, | ||
920 | 113 | + [NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
921 | 114 | [NL80211_ATTR_NAN_MASTER_PREF] = NLA_POLICY_MIN(NLA_U8, 1), | ||
922 | 115 | [NL80211_ATTR_BANDS] = { .type = NLA_U32 }, | ||
923 | 116 | [NL80211_ATTR_NAN_FUNC] = { .type = NLA_NESTED }, | ||
924 | 117 | [NL80211_ATTR_FILS_KEK] = { .type = NLA_BINARY, | ||
925 | 118 | .len = FILS_MAX_KEK_LEN }, | ||
926 | 119 | - [NL80211_ATTR_FILS_NONCES] = { | ||
927 | 120 | - .type = NLA_EXACT_LEN_WARN, | ||
928 | 121 | - .len = 2 * FILS_NONCE_LEN | ||
929 | 122 | - }, | ||
930 | 123 | + [NL80211_ATTR_FILS_NONCES] = NLA_POLICY_EXACT_LEN_WARN(2 * FILS_NONCE_LEN), | ||
931 | 124 | [NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED] = { .type = NLA_FLAG, }, | ||
932 | 125 | - [NL80211_ATTR_BSSID] = { .type = NLA_EXACT_LEN_WARN, .len = ETH_ALEN }, | ||
933 | 126 | + [NL80211_ATTR_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
934 | 127 | [NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI] = { .type = NLA_S8 }, | ||
935 | 128 | [NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST] = { | ||
936 | 129 | .len = sizeof(struct nl80211_bss_select_rssi_adjust) | ||
937 | 130 | @@ -587,7 +563,7 @@ const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { | ||
938 | 131 | [NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM] = { .type = NLA_U16 }, | ||
939 | 132 | [NL80211_ATTR_FILS_ERP_RRK] = { .type = NLA_BINARY, | ||
940 | 133 | .len = FILS_ERP_MAX_RRK_LEN }, | ||
941 | 134 | - [NL80211_ATTR_FILS_CACHE_ID] = { .type = NLA_EXACT_LEN_WARN, .len = 2 }, | ||
942 | 135 | + [NL80211_ATTR_FILS_CACHE_ID] = NLA_POLICY_EXACT_LEN_WARN(2), | ||
943 | 136 | [NL80211_ATTR_PMK] = { .type = NLA_BINARY, .len = PMK_MAX_LEN }, | ||
944 | 137 | [NL80211_ATTR_SCHED_SCAN_MULTI] = { .type = NLA_FLAG }, | ||
945 | 138 | [NL80211_ATTR_EXTERNAL_AUTH_SUPPORT] = { .type = NLA_FLAG }, | ||
946 | 139 | @@ -652,10 +628,7 @@ static const struct nla_policy | ||
947 | 140 | nl80211_wowlan_tcp_policy[NUM_NL80211_WOWLAN_TCP] = { | ||
948 | 141 | [NL80211_WOWLAN_TCP_SRC_IPV4] = { .type = NLA_U32 }, | ||
949 | 142 | [NL80211_WOWLAN_TCP_DST_IPV4] = { .type = NLA_U32 }, | ||
950 | 143 | - [NL80211_WOWLAN_TCP_DST_MAC] = { | ||
951 | 144 | - .type = NLA_EXACT_LEN_WARN, | ||
952 | 145 | - .len = ETH_ALEN | ||
953 | 146 | - }, | ||
954 | 147 | + [NL80211_WOWLAN_TCP_DST_MAC] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
955 | 148 | [NL80211_WOWLAN_TCP_SRC_PORT] = { .type = NLA_U16 }, | ||
956 | 149 | [NL80211_WOWLAN_TCP_DST_PORT] = { .type = NLA_U16 }, | ||
957 | 150 | [NL80211_WOWLAN_TCP_DATA_PAYLOAD] = { .type = NLA_MIN_LEN, .len = 1 }, | ||
958 | 151 | @@ -685,18 +658,9 @@ nl80211_coalesce_policy[NUM_NL80211_ATTR_COALESCE_RULE] = { | ||
959 | 152 | /* policy for GTK rekey offload attributes */ | ||
960 | 153 | static const struct nla_policy | ||
961 | 154 | nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = { | ||
962 | 155 | - [NL80211_REKEY_DATA_KEK] = { | ||
963 | 156 | - .type = NLA_EXACT_LEN_WARN, | ||
964 | 157 | - .len = NL80211_KEK_LEN, | ||
965 | 158 | - }, | ||
966 | 159 | - [NL80211_REKEY_DATA_KCK] = { | ||
967 | 160 | - .type = NLA_EXACT_LEN_WARN, | ||
968 | 161 | - .len = NL80211_KCK_LEN, | ||
969 | 162 | - }, | ||
970 | 163 | - [NL80211_REKEY_DATA_REPLAY_CTR] = { | ||
971 | 164 | - .type = NLA_EXACT_LEN_WARN, | ||
972 | 165 | - .len = NL80211_REPLAY_CTR_LEN | ||
973 | 166 | - }, | ||
974 | 167 | + [NL80211_REKEY_DATA_KEK] = NLA_POLICY_EXACT_LEN_WARN(NL80211_KEK_LEN), | ||
975 | 168 | + [NL80211_REKEY_DATA_KCK] = NLA_POLICY_EXACT_LEN_WARN(NL80211_KCK_LEN), | ||
976 | 169 | + [NL80211_REKEY_DATA_REPLAY_CTR] = NLA_POLICY_EXACT_LEN_WARN(NL80211_REPLAY_CTR_LEN), | ||
977 | 170 | }; | ||
978 | 171 | |||
979 | 172 | static const struct nla_policy | ||
980 | 173 | @@ -711,10 +675,7 @@ static const struct nla_policy | ||
981 | 174 | nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = { | ||
982 | 175 | [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY, | ||
983 | 176 | .len = IEEE80211_MAX_SSID_LEN }, | ||
984 | 177 | - [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = { | ||
985 | 178 | - .type = NLA_EXACT_LEN_WARN, | ||
986 | 179 | - .len = ETH_ALEN | ||
987 | 180 | - }, | ||
988 | 181 | + [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
989 | 182 | [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 }, | ||
990 | 183 | [NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI] = | ||
991 | 184 | NLA_POLICY_NESTED(nl80211_match_band_rssi_policy), | ||
992 | 185 | @@ -746,10 +707,7 @@ nl80211_nan_func_policy[NL80211_NAN_FUNC_ATTR_MAX + 1] = { | ||
993 | 186 | [NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE] = { .type = NLA_FLAG }, | ||
994 | 187 | [NL80211_NAN_FUNC_FOLLOW_UP_ID] = { .type = NLA_U8 }, | ||
995 | 188 | [NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID] = { .type = NLA_U8 }, | ||
996 | 189 | - [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = { | ||
997 | 190 | - .type = NLA_EXACT_LEN_WARN, | ||
998 | 191 | - .len = ETH_ALEN | ||
999 | 192 | - }, | ||
1000 | 193 | + [NL80211_NAN_FUNC_FOLLOW_UP_DEST] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN), | ||
1001 | 194 | [NL80211_NAN_FUNC_CLOSE_RANGE] = { .type = NLA_FLAG }, | ||
1002 | 195 | [NL80211_NAN_FUNC_TTL] = { .type = NLA_U32 }, | ||
1003 | 196 | [NL80211_NAN_FUNC_SERVICE_INFO] = { .type = NLA_BINARY, | ||
1004 | 197 | @@ -4172,10 +4130,7 @@ static const struct nla_policy nl80211_txattr_policy[NL80211_TXRATE_MAX + 1] = { | ||
1005 | 198 | .len = NL80211_MAX_SUPP_RATES }, | ||
1006 | 199 | [NL80211_TXRATE_HT] = { .type = NLA_BINARY, | ||
1007 | 200 | .len = NL80211_MAX_SUPP_HT_RATES }, | ||
1008 | 201 | - [NL80211_TXRATE_VHT] = { | ||
1009 | 202 | - .type = NLA_EXACT_LEN_WARN, | ||
1010 | 203 | - .len = sizeof(struct nl80211_txrate_vht), | ||
1011 | 204 | - }, | ||
1012 | 205 | + [NL80211_TXRATE_VHT] = NLA_POLICY_EXACT_LEN_WARN(sizeof(struct nl80211_txrate_vht)), | ||
1013 | 206 | [NL80211_TXRATE_GI] = { .type = NLA_U8 }, | ||
1014 | 207 | }; | ||
1015 | 208 | |||
1016 | 209 | -- | ||
1017 | 210 | 2.25.1 | ||
1018 | 211 | |||
1019 | diff --git a/debian/patches/series b/debian/patches/series | |||
1020 | index f4462c8..f19b067 100644 | |||
1021 | --- a/debian/patches/series | |||
1022 | +++ b/debian/patches/series | |||
1023 | @@ -2,3 +2,12 @@ | |||
1024 | 2 | 0002-fix-format-overflow-compile-error-in-kconf-confdata..patch | 2 | 0002-fix-format-overflow-compile-error-in-kconf-confdata..patch |
1025 | 3 | 0005-Makefile.kernel-pass-fno-stack-clash-protection-and-.patch | 3 | 0005-Makefile.kernel-pass-fno-stack-clash-protection-and-.patch |
1026 | 4 | 0006-backport-address-interface-change-in-linux-skbuff.h-.patch | 4 | 0006-backport-address-interface-change-in-linux-skbuff.h-.patch |
1027 | 5 | 0007-backport-add-genlmsg_parse.patch | ||
1028 | 6 | 0008-backport-update-include-uapi-linux-pci_regs.h.patch | ||
1029 | 7 | 0009-NOUPSTREAM-iwlwifi-mvm-use-64-bit-version-of-timespe.patch | ||
1030 | 8 | 0010-NOUPSTREAM-cfg80211-use-parallel_ops-for-genl.patch | ||
1031 | 9 | 0011-backports-netlink-fix-nla_validate_nested.patch | ||
1032 | 10 | 0012-netlink-rename-nl80211_validate_nested-to-nla_valida.patch | ||
1033 | 11 | 0013-ftrace-Rework-event_create_dir.patch | ||
1034 | 12 | 0014-nl80211-fix-NL80211_ATTR_FTM_RESPONDER-policy.patch | ||
1035 | 13 | 0015-NOUPSTREAM-nl80211-pull-in-NLA_POLICY_EXACT_LEN_WARN.patch |
this got uploaded earlier