1 |
commit: 9df81cf24bb9d8761a8b3f37eb5f1b8d9a806f27 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 28 11:00:04 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Mar 28 11:00:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=9df81cf2 |
7 |
|
8 |
Linux patch 4.14.274 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1273_linux-4.14.274.patch | 612 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 616 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 8814bc18..1469ce24 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1139,6 +1139,10 @@ Patch: 1272_linux-4.14.273.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.273 |
23 |
|
24 |
+Patch: 1273_linux-4.14.274.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.274 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1273_linux-4.14.274.patch b/1273_linux-4.14.274.patch |
33 |
new file mode 100644 |
34 |
index 00000000..1166b9be |
35 |
--- /dev/null |
36 |
+++ b/1273_linux-4.14.274.patch |
37 |
@@ -0,0 +1,612 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index bc909859dd8b9..a06abc38f35db 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 273 |
47 |
++SUBLEVEL = 274 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c |
52 |
+index 3613681b49cf3..fd9c4479880d9 100644 |
53 |
+--- a/arch/x86/kernel/acpi/boot.c |
54 |
++++ b/arch/x86/kernel/acpi/boot.c |
55 |
+@@ -1343,6 +1343,17 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d) |
56 |
+ return 0; |
57 |
+ } |
58 |
+ |
59 |
++static int __init disable_acpi_xsdt(const struct dmi_system_id *d) |
60 |
++{ |
61 |
++ if (!acpi_force) { |
62 |
++ pr_notice("%s detected: force use of acpi=rsdt\n", d->ident); |
63 |
++ acpi_gbl_do_not_use_xsdt = TRUE; |
64 |
++ } else { |
65 |
++ pr_notice("Warning: DMI blacklist says broken, but acpi XSDT forced\n"); |
66 |
++ } |
67 |
++ return 0; |
68 |
++} |
69 |
++ |
70 |
+ static int __init dmi_disable_acpi(const struct dmi_system_id *d) |
71 |
+ { |
72 |
+ if (!acpi_force) { |
73 |
+@@ -1463,6 +1474,19 @@ static const struct dmi_system_id acpi_dmi_table[] __initconst = { |
74 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), |
75 |
+ }, |
76 |
+ }, |
77 |
++ /* |
78 |
++ * Boxes that need ACPI XSDT use disabled due to corrupted tables |
79 |
++ */ |
80 |
++ { |
81 |
++ .callback = disable_acpi_xsdt, |
82 |
++ .ident = "Advantech DAC-BJ01", |
83 |
++ .matches = { |
84 |
++ DMI_MATCH(DMI_SYS_VENDOR, "NEC"), |
85 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Bearlake CRB Board"), |
86 |
++ DMI_MATCH(DMI_BIOS_VERSION, "V1.12"), |
87 |
++ DMI_MATCH(DMI_BIOS_DATE, "02/01/2011"), |
88 |
++ }, |
89 |
++ }, |
90 |
+ {} |
91 |
+ }; |
92 |
+ |
93 |
+diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c |
94 |
+index 30996effc491b..42fba8493854f 100644 |
95 |
+--- a/drivers/acpi/battery.c |
96 |
++++ b/drivers/acpi/battery.c |
97 |
+@@ -89,6 +89,10 @@ enum acpi_battery_files { |
98 |
+ |
99 |
+ static const struct acpi_device_id battery_device_ids[] = { |
100 |
+ {"PNP0C0A", 0}, |
101 |
++ |
102 |
++ /* Microsoft Surface Go 3 */ |
103 |
++ {"MSHW0146", 0}, |
104 |
++ |
105 |
+ {"", 0}, |
106 |
+ }; |
107 |
+ |
108 |
+@@ -1183,6 +1187,14 @@ static const struct dmi_system_id bat_dmi_table[] __initconst = { |
109 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-573G"), |
110 |
+ }, |
111 |
+ }, |
112 |
++ { |
113 |
++ /* Microsoft Surface Go 3 */ |
114 |
++ .callback = battery_notification_delay_quirk, |
115 |
++ .matches = { |
116 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"), |
117 |
++ DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go 3"), |
118 |
++ }, |
119 |
++ }, |
120 |
+ {}, |
121 |
+ }; |
122 |
+ |
123 |
+diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c |
124 |
+index 86ffb4af4afca..298d9c65e0848 100644 |
125 |
+--- a/drivers/acpi/video_detect.c |
126 |
++++ b/drivers/acpi/video_detect.c |
127 |
+@@ -356,6 +356,81 @@ static const struct dmi_system_id video_detect_dmi_table[] = { |
128 |
+ DMI_MATCH(DMI_BOARD_NAME, "BA51_MV"), |
129 |
+ }, |
130 |
+ }, |
131 |
++ /* |
132 |
++ * Clevo NL5xRU and NL5xNU/TUXEDO Aura 15 Gen1 and Gen2 have both a |
133 |
++ * working native and video interface. However the default detection |
134 |
++ * mechanism first registers the video interface before unregistering |
135 |
++ * it again and switching to the native interface during boot. This |
136 |
++ * results in a dangling SBIOS request for backlight change for some |
137 |
++ * reason, causing the backlight to switch to ~2% once per boot on the |
138 |
++ * first power cord connect or disconnect event. Setting the native |
139 |
++ * interface explicitly circumvents this buggy behaviour, by avoiding |
140 |
++ * the unregistering process. |
141 |
++ */ |
142 |
++ { |
143 |
++ .callback = video_detect_force_native, |
144 |
++ .ident = "Clevo NL5xRU", |
145 |
++ .matches = { |
146 |
++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), |
147 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), |
148 |
++ }, |
149 |
++ }, |
150 |
++ { |
151 |
++ .callback = video_detect_force_native, |
152 |
++ .ident = "Clevo NL5xRU", |
153 |
++ .matches = { |
154 |
++ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), |
155 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), |
156 |
++ }, |
157 |
++ }, |
158 |
++ { |
159 |
++ .callback = video_detect_force_native, |
160 |
++ .ident = "Clevo NL5xRU", |
161 |
++ .matches = { |
162 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), |
163 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), |
164 |
++ }, |
165 |
++ }, |
166 |
++ { |
167 |
++ .callback = video_detect_force_native, |
168 |
++ .ident = "Clevo NL5xRU", |
169 |
++ .matches = { |
170 |
++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), |
171 |
++ DMI_MATCH(DMI_BOARD_NAME, "AURA1501"), |
172 |
++ }, |
173 |
++ }, |
174 |
++ { |
175 |
++ .callback = video_detect_force_native, |
176 |
++ .ident = "Clevo NL5xRU", |
177 |
++ .matches = { |
178 |
++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), |
179 |
++ DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"), |
180 |
++ }, |
181 |
++ }, |
182 |
++ { |
183 |
++ .callback = video_detect_force_native, |
184 |
++ .ident = "Clevo NL5xNU", |
185 |
++ .matches = { |
186 |
++ DMI_MATCH(DMI_SYS_VENDOR, "TUXEDO"), |
187 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), |
188 |
++ }, |
189 |
++ }, |
190 |
++ { |
191 |
++ .callback = video_detect_force_native, |
192 |
++ .ident = "Clevo NL5xNU", |
193 |
++ .matches = { |
194 |
++ DMI_MATCH(DMI_SYS_VENDOR, "SchenkerTechnologiesGmbH"), |
195 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), |
196 |
++ }, |
197 |
++ }, |
198 |
++ { |
199 |
++ .callback = video_detect_force_native, |
200 |
++ .ident = "Clevo NL5xNU", |
201 |
++ .matches = { |
202 |
++ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"), |
203 |
++ DMI_MATCH(DMI_BOARD_NAME, "NL5xNU"), |
204 |
++ }, |
205 |
++ }, |
206 |
+ |
207 |
+ /* |
208 |
+ * Desktops which falsely report a backlight and which our heuristics |
209 |
+diff --git a/drivers/crypto/qat/qat_common/qat_crypto.c b/drivers/crypto/qat/qat_common/qat_crypto.c |
210 |
+index 3852d31ce0a4b..37a9f969c59cd 100644 |
211 |
+--- a/drivers/crypto/qat/qat_common/qat_crypto.c |
212 |
++++ b/drivers/crypto/qat/qat_common/qat_crypto.c |
213 |
+@@ -170,6 +170,14 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev) |
214 |
+ goto err; |
215 |
+ if (adf_cfg_section_add(accel_dev, "Accelerator0")) |
216 |
+ goto err; |
217 |
++ |
218 |
++ /* Temporarily set the number of crypto instances to zero to avoid |
219 |
++ * registering the crypto algorithms. |
220 |
++ * This will be removed when the algorithms will support the |
221 |
++ * CRYPTO_TFM_REQ_MAY_BACKLOG flag |
222 |
++ */ |
223 |
++ instances = 0; |
224 |
++ |
225 |
+ for (i = 0; i < instances; i++) { |
226 |
+ val = i; |
227 |
+ snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_BANK_NUM, i); |
228 |
+diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c |
229 |
+index 3a489b2b99c99..86811de191edb 100644 |
230 |
+--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c |
231 |
++++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c |
232 |
+@@ -707,6 +707,12 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring, |
233 |
+ buf_pool->rx_skb[skb_index] = NULL; |
234 |
+ |
235 |
+ datalen = xgene_enet_get_data_len(le64_to_cpu(raw_desc->m1)); |
236 |
++ |
237 |
++ /* strip off CRC as HW isn't doing this */ |
238 |
++ nv = GET_VAL(NV, le64_to_cpu(raw_desc->m0)); |
239 |
++ if (!nv) |
240 |
++ datalen -= 4; |
241 |
++ |
242 |
+ skb_put(skb, datalen); |
243 |
+ prefetch(skb->data - NET_IP_ALIGN); |
244 |
+ skb->protocol = eth_type_trans(skb, ndev); |
245 |
+@@ -728,12 +734,8 @@ static int xgene_enet_rx_frame(struct xgene_enet_desc_ring *rx_ring, |
246 |
+ } |
247 |
+ } |
248 |
+ |
249 |
+- nv = GET_VAL(NV, le64_to_cpu(raw_desc->m0)); |
250 |
+- if (!nv) { |
251 |
+- /* strip off CRC as HW isn't doing this */ |
252 |
+- datalen -= 4; |
253 |
++ if (!nv) |
254 |
+ goto skip_jumbo; |
255 |
+- } |
256 |
+ |
257 |
+ slots = page_pool->slots - 1; |
258 |
+ head = page_pool->head; |
259 |
+diff --git a/drivers/nfc/st21nfca/se.c b/drivers/nfc/st21nfca/se.c |
260 |
+index eac608a457f03..475f8a67856d0 100644 |
261 |
+--- a/drivers/nfc/st21nfca/se.c |
262 |
++++ b/drivers/nfc/st21nfca/se.c |
263 |
+@@ -330,6 +330,11 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, |
264 |
+ return -ENOMEM; |
265 |
+ |
266 |
+ transaction->aid_len = skb->data[1]; |
267 |
++ |
268 |
++ /* Checking if the length of the AID is valid */ |
269 |
++ if (transaction->aid_len > sizeof(transaction->aid)) |
270 |
++ return -EINVAL; |
271 |
++ |
272 |
+ memcpy(transaction->aid, &skb->data[2], |
273 |
+ transaction->aid_len); |
274 |
+ |
275 |
+@@ -339,6 +344,11 @@ int st21nfca_connectivity_event_received(struct nfc_hci_dev *hdev, u8 host, |
276 |
+ return -EPROTO; |
277 |
+ |
278 |
+ transaction->params_len = skb->data[transaction->aid_len + 3]; |
279 |
++ |
280 |
++ /* Total size is allocated (skb->len - 2) minus fixed array members */ |
281 |
++ if (transaction->params_len > ((skb->len - 2) - sizeof(struct nfc_evt_transaction))) |
282 |
++ return -EINVAL; |
283 |
++ |
284 |
+ memcpy(transaction->params, skb->data + |
285 |
+ transaction->aid_len + 4, transaction->params_len); |
286 |
+ |
287 |
+diff --git a/drivers/staging/fbtft/fb_st7789v.c b/drivers/staging/fbtft/fb_st7789v.c |
288 |
+index a5d7c87557f85..b790b18de98b3 100644 |
289 |
+--- a/drivers/staging/fbtft/fb_st7789v.c |
290 |
++++ b/drivers/staging/fbtft/fb_st7789v.c |
291 |
+@@ -85,6 +85,8 @@ enum st7789v_command { |
292 |
+ */ |
293 |
+ static int init_display(struct fbtft_par *par) |
294 |
+ { |
295 |
++ par->fbtftops.reset(par); |
296 |
++ |
297 |
+ /* turn off sleep mode */ |
298 |
+ write_reg(par, MIPI_DCS_EXIT_SLEEP_MODE); |
299 |
+ mdelay(120); |
300 |
+diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c |
301 |
+index 4a20f4d47b1de..d7cd861160844 100644 |
302 |
+--- a/drivers/thermal/int340x_thermal/int3400_thermal.c |
303 |
++++ b/drivers/thermal/int340x_thermal/int3400_thermal.c |
304 |
+@@ -223,6 +223,10 @@ static void int3400_notify(acpi_handle handle, |
305 |
+ thermal_prop[4] = NULL; |
306 |
+ kobject_uevent_env(&priv->thermal->device.kobj, KOBJ_CHANGE, |
307 |
+ thermal_prop); |
308 |
++ kfree(thermal_prop[0]); |
309 |
++ kfree(thermal_prop[1]); |
310 |
++ kfree(thermal_prop[2]); |
311 |
++ kfree(thermal_prop[3]); |
312 |
+ break; |
313 |
+ default: |
314 |
+ dev_err(&priv->adev->dev, "Unsupported event [0x%x]\n", event); |
315 |
+diff --git a/include/net/esp.h b/include/net/esp.h |
316 |
+index 117652eb6ea32..465e38890ee98 100644 |
317 |
+--- a/include/net/esp.h |
318 |
++++ b/include/net/esp.h |
319 |
+@@ -4,6 +4,8 @@ |
320 |
+ |
321 |
+ #include <linux/skbuff.h> |
322 |
+ |
323 |
++#define ESP_SKB_FRAG_MAXSIZE (PAGE_SIZE << SKB_FRAG_PAGE_ORDER) |
324 |
++ |
325 |
+ struct ip_esp_hdr; |
326 |
+ |
327 |
+ static inline struct ip_esp_hdr *ip_esp_hdr(const struct sk_buff *skb) |
328 |
+diff --git a/include/net/sock.h b/include/net/sock.h |
329 |
+index 029df5cdeaf12..f72753391accc 100644 |
330 |
+--- a/include/net/sock.h |
331 |
++++ b/include/net/sock.h |
332 |
+@@ -2438,4 +2438,7 @@ extern int sysctl_optmem_max; |
333 |
+ extern __u32 sysctl_wmem_default; |
334 |
+ extern __u32 sysctl_rmem_default; |
335 |
+ |
336 |
++/* On 32bit arches, an skb frag is limited to 2^15 */ |
337 |
++#define SKB_FRAG_PAGE_ORDER get_order(32768) |
338 |
++ |
339 |
+ #endif /* _SOCK_H */ |
340 |
+diff --git a/net/core/sock.c b/net/core/sock.c |
341 |
+index 427024597204d..bbf9517218ff3 100644 |
342 |
+--- a/net/core/sock.c |
343 |
++++ b/net/core/sock.c |
344 |
+@@ -2193,9 +2193,6 @@ static void sk_leave_memory_pressure(struct sock *sk) |
345 |
+ } |
346 |
+ } |
347 |
+ |
348 |
+-/* On 32bit arches, an skb frag is limited to 2^15 */ |
349 |
+-#define SKB_FRAG_PAGE_ORDER get_order(32768) |
350 |
+- |
351 |
+ /** |
352 |
+ * skb_page_frag_refill - check that a page_frag contains enough room |
353 |
+ * @sz: minimum size of the fragment we want to get |
354 |
+diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c |
355 |
+index 9e664b6cef132..38e2aa2b2a31c 100644 |
356 |
+--- a/net/ipv4/esp4.c |
357 |
++++ b/net/ipv4/esp4.c |
358 |
+@@ -257,6 +257,7 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * |
359 |
+ struct page *page; |
360 |
+ struct sk_buff *trailer; |
361 |
+ int tailen = esp->tailen; |
362 |
++ unsigned int allocsz; |
363 |
+ |
364 |
+ /* this is non-NULL only with UDP Encapsulation */ |
365 |
+ if (x->encap) { |
366 |
+@@ -266,6 +267,10 @@ int esp_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info * |
367 |
+ return err; |
368 |
+ } |
369 |
+ |
370 |
++ allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES); |
371 |
++ if (allocsz > ESP_SKB_FRAG_MAXSIZE) |
372 |
++ goto cow; |
373 |
++ |
374 |
+ if (!skb_cloned(skb)) { |
375 |
+ if (tailen <= skb_tailroom(skb)) { |
376 |
+ nfrags = 1; |
377 |
+diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c |
378 |
+index dd1f4ed3fc2bf..a9baf562bb9b9 100644 |
379 |
+--- a/net/ipv6/esp6.c |
380 |
++++ b/net/ipv6/esp6.c |
381 |
+@@ -223,6 +223,11 @@ int esp6_output_head(struct xfrm_state *x, struct sk_buff *skb, struct esp_info |
382 |
+ struct page *page; |
383 |
+ struct sk_buff *trailer; |
384 |
+ int tailen = esp->tailen; |
385 |
++ unsigned int allocsz; |
386 |
++ |
387 |
++ allocsz = ALIGN(skb->data_len + tailen, L1_CACHE_BYTES); |
388 |
++ if (allocsz > ESP_SKB_FRAG_MAXSIZE) |
389 |
++ goto cow; |
390 |
+ |
391 |
+ if (!skb_cloned(skb)) { |
392 |
+ if (tailen <= skb_tailroom(skb)) { |
393 |
+diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c |
394 |
+index c474e4b4c4bbf..fbad7828568f1 100644 |
395 |
+--- a/net/ipv6/ip6_output.c |
396 |
++++ b/net/ipv6/ip6_output.c |
397 |
+@@ -1321,8 +1321,8 @@ static int __ip6_append_data(struct sock *sk, |
398 |
+ sizeof(struct frag_hdr) : 0) + |
399 |
+ rt->rt6i_nfheader_len; |
400 |
+ |
401 |
+- if (mtu < fragheaderlen || |
402 |
+- ((mtu - fragheaderlen) & ~7) + fragheaderlen < sizeof(struct frag_hdr)) |
403 |
++ if (mtu <= fragheaderlen || |
404 |
++ ((mtu - fragheaderlen) & ~7) + fragheaderlen <= sizeof(struct frag_hdr)) |
405 |
+ goto emsgsize; |
406 |
+ |
407 |
+ maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - |
408 |
+diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c |
409 |
+index ec48fb3fd30eb..1e20b719fb3c3 100644 |
410 |
+--- a/net/llc/af_llc.c |
411 |
++++ b/net/llc/af_llc.c |
412 |
+@@ -276,6 +276,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) |
413 |
+ { |
414 |
+ struct sock *sk = sock->sk; |
415 |
+ struct llc_sock *llc = llc_sk(sk); |
416 |
++ struct net_device *dev = NULL; |
417 |
+ struct llc_sap *sap; |
418 |
+ int rc = -EINVAL; |
419 |
+ |
420 |
+@@ -287,14 +288,14 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) |
421 |
+ goto out; |
422 |
+ rc = -ENODEV; |
423 |
+ if (sk->sk_bound_dev_if) { |
424 |
+- llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); |
425 |
+- if (llc->dev && addr->sllc_arphrd != llc->dev->type) { |
426 |
+- dev_put(llc->dev); |
427 |
+- llc->dev = NULL; |
428 |
++ dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); |
429 |
++ if (dev && addr->sllc_arphrd != dev->type) { |
430 |
++ dev_put(dev); |
431 |
++ dev = NULL; |
432 |
+ } |
433 |
+ } else |
434 |
+- llc->dev = dev_getfirstbyhwtype(&init_net, addr->sllc_arphrd); |
435 |
+- if (!llc->dev) |
436 |
++ dev = dev_getfirstbyhwtype(&init_net, addr->sllc_arphrd); |
437 |
++ if (!dev) |
438 |
+ goto out; |
439 |
+ rc = -EUSERS; |
440 |
+ llc->laddr.lsap = llc_ui_autoport(); |
441 |
+@@ -304,6 +305,11 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) |
442 |
+ sap = llc_sap_open(llc->laddr.lsap, NULL); |
443 |
+ if (!sap) |
444 |
+ goto out; |
445 |
++ |
446 |
++ /* Note: We do not expect errors from this point. */ |
447 |
++ llc->dev = dev; |
448 |
++ dev = NULL; |
449 |
++ |
450 |
+ memcpy(llc->laddr.mac, llc->dev->dev_addr, IFHWADDRLEN); |
451 |
+ memcpy(&llc->addr, addr, sizeof(llc->addr)); |
452 |
+ /* assign new connection to its SAP */ |
453 |
+@@ -311,6 +317,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) |
454 |
+ sock_reset_flag(sk, SOCK_ZAPPED); |
455 |
+ rc = 0; |
456 |
+ out: |
457 |
++ dev_put(dev); |
458 |
+ return rc; |
459 |
+ } |
460 |
+ |
461 |
+@@ -333,6 +340,7 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) |
462 |
+ struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; |
463 |
+ struct sock *sk = sock->sk; |
464 |
+ struct llc_sock *llc = llc_sk(sk); |
465 |
++ struct net_device *dev = NULL; |
466 |
+ struct llc_sap *sap; |
467 |
+ int rc = -EINVAL; |
468 |
+ |
469 |
+@@ -349,25 +357,26 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) |
470 |
+ rc = -ENODEV; |
471 |
+ rcu_read_lock(); |
472 |
+ if (sk->sk_bound_dev_if) { |
473 |
+- llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); |
474 |
+- if (llc->dev) { |
475 |
++ dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); |
476 |
++ if (dev) { |
477 |
+ if (is_zero_ether_addr(addr->sllc_mac)) |
478 |
+- memcpy(addr->sllc_mac, llc->dev->dev_addr, |
479 |
++ memcpy(addr->sllc_mac, dev->dev_addr, |
480 |
+ IFHWADDRLEN); |
481 |
+- if (addr->sllc_arphrd != llc->dev->type || |
482 |
++ if (addr->sllc_arphrd != dev->type || |
483 |
+ !ether_addr_equal(addr->sllc_mac, |
484 |
+- llc->dev->dev_addr)) { |
485 |
++ dev->dev_addr)) { |
486 |
+ rc = -EINVAL; |
487 |
+- llc->dev = NULL; |
488 |
++ dev = NULL; |
489 |
+ } |
490 |
+ } |
491 |
+- } else |
492 |
+- llc->dev = dev_getbyhwaddr_rcu(&init_net, addr->sllc_arphrd, |
493 |
++ } else { |
494 |
++ dev = dev_getbyhwaddr_rcu(&init_net, addr->sllc_arphrd, |
495 |
+ addr->sllc_mac); |
496 |
+- if (llc->dev) |
497 |
+- dev_hold(llc->dev); |
498 |
++ } |
499 |
++ if (dev) |
500 |
++ dev_hold(dev); |
501 |
+ rcu_read_unlock(); |
502 |
+- if (!llc->dev) |
503 |
++ if (!dev) |
504 |
+ goto out; |
505 |
+ if (!addr->sllc_sap) { |
506 |
+ rc = -EUSERS; |
507 |
+@@ -400,6 +409,11 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) |
508 |
+ goto out_put; |
509 |
+ } |
510 |
+ } |
511 |
++ |
512 |
++ /* Note: We do not expect errors from this point. */ |
513 |
++ llc->dev = dev; |
514 |
++ dev = NULL; |
515 |
++ |
516 |
+ llc->laddr.lsap = addr->sllc_sap; |
517 |
+ memcpy(llc->laddr.mac, addr->sllc_mac, IFHWADDRLEN); |
518 |
+ memcpy(&llc->addr, addr, sizeof(llc->addr)); |
519 |
+@@ -410,6 +424,7 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) |
520 |
+ out_put: |
521 |
+ llc_sap_put(sap); |
522 |
+ out: |
523 |
++ dev_put(dev); |
524 |
+ release_sock(sk); |
525 |
+ return rc; |
526 |
+ } |
527 |
+diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c |
528 |
+index 3b3ed96c19e52..f769b08e6f2ab 100644 |
529 |
+--- a/net/mac80211/cfg.c |
530 |
++++ b/net/mac80211/cfg.c |
531 |
+@@ -1811,13 +1811,11 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, |
532 |
+ const struct mesh_setup *setup) |
533 |
+ { |
534 |
+ u8 *new_ie; |
535 |
+- const u8 *old_ie; |
536 |
+ struct ieee80211_sub_if_data *sdata = container_of(ifmsh, |
537 |
+ struct ieee80211_sub_if_data, u.mesh); |
538 |
+ |
539 |
+ /* allocate information elements */ |
540 |
+ new_ie = NULL; |
541 |
+- old_ie = ifmsh->ie; |
542 |
+ |
543 |
+ if (setup->ie_len) { |
544 |
+ new_ie = kmemdup(setup->ie, setup->ie_len, |
545 |
+@@ -1827,7 +1825,6 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh, |
546 |
+ } |
547 |
+ ifmsh->ie_len = setup->ie_len; |
548 |
+ ifmsh->ie = new_ie; |
549 |
+- kfree(old_ie); |
550 |
+ |
551 |
+ /* now copy the rest of the setup parameters */ |
552 |
+ ifmsh->mesh_id_len = setup->mesh_id_len; |
553 |
+diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c |
554 |
+index 32b7896929f3e..7d60fa57bf804 100644 |
555 |
+--- a/net/netfilter/nf_tables_core.c |
556 |
++++ b/net/netfilter/nf_tables_core.c |
557 |
+@@ -150,7 +150,7 @@ nft_do_chain(struct nft_pktinfo *pkt, void *priv) |
558 |
+ const struct net *net = nft_net(pkt); |
559 |
+ const struct nft_rule *rule; |
560 |
+ const struct nft_expr *expr, *last; |
561 |
+- struct nft_regs regs; |
562 |
++ struct nft_regs regs = {}; |
563 |
+ unsigned int stackptr = 0; |
564 |
+ struct nft_jumpstack jumpstack[NFT_JUMP_STACK_SIZE]; |
565 |
+ int rulenum; |
566 |
+diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c |
567 |
+index c78db361cbbaa..c530d008fe01d 100644 |
568 |
+--- a/sound/core/pcm_native.c |
569 |
++++ b/sound/core/pcm_native.c |
570 |
+@@ -1616,21 +1616,25 @@ static int snd_pcm_do_reset(struct snd_pcm_substream *substream, int state) |
571 |
+ int err = substream->ops->ioctl(substream, SNDRV_PCM_IOCTL1_RESET, NULL); |
572 |
+ if (err < 0) |
573 |
+ return err; |
574 |
++ snd_pcm_stream_lock_irq(substream); |
575 |
+ runtime->hw_ptr_base = 0; |
576 |
+ runtime->hw_ptr_interrupt = runtime->status->hw_ptr - |
577 |
+ runtime->status->hw_ptr % runtime->period_size; |
578 |
+ runtime->silence_start = runtime->status->hw_ptr; |
579 |
+ runtime->silence_filled = 0; |
580 |
++ snd_pcm_stream_unlock_irq(substream); |
581 |
+ return 0; |
582 |
+ } |
583 |
+ |
584 |
+ static void snd_pcm_post_reset(struct snd_pcm_substream *substream, int state) |
585 |
+ { |
586 |
+ struct snd_pcm_runtime *runtime = substream->runtime; |
587 |
++ snd_pcm_stream_lock_irq(substream); |
588 |
+ runtime->control->appl_ptr = runtime->status->hw_ptr; |
589 |
+ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && |
590 |
+ runtime->silence_size > 0) |
591 |
+ snd_pcm_playback_silence(substream, ULONG_MAX); |
592 |
++ snd_pcm_stream_unlock_irq(substream); |
593 |
+ } |
594 |
+ |
595 |
+ static const struct action_ops snd_pcm_action_reset = { |
596 |
+diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c |
597 |
+index 38f355ae1863a..1cb2a1ecf3cfa 100644 |
598 |
+--- a/sound/pci/ac97/ac97_codec.c |
599 |
++++ b/sound/pci/ac97/ac97_codec.c |
600 |
+@@ -958,8 +958,8 @@ static int snd_ac97_ad18xx_pcm_get_volume(struct snd_kcontrol *kcontrol, struct |
601 |
+ int codec = kcontrol->private_value & 3; |
602 |
+ |
603 |
+ mutex_lock(&ac97->page_mutex); |
604 |
+- ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31); |
605 |
+- ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31); |
606 |
++ ucontrol->value.integer.value[0] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 8) & 31); |
607 |
++ ucontrol->value.integer.value[1] = 31 - ((ac97->spec.ad18xx.pcmreg[codec] >> 0) & 31); |
608 |
+ mutex_unlock(&ac97->page_mutex); |
609 |
+ return 0; |
610 |
+ } |
611 |
+diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c |
612 |
+index 26a6578706642..3d0f8f31b2e5b 100644 |
613 |
+--- a/sound/pci/cmipci.c |
614 |
++++ b/sound/pci/cmipci.c |
615 |
+@@ -315,7 +315,6 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address."); |
616 |
+ #define CM_MICGAINZ 0x01 /* mic boost */ |
617 |
+ #define CM_MICGAINZ_SHIFT 0 |
618 |
+ |
619 |
+-#define CM_REG_MIXER3 0x24 |
620 |
+ #define CM_REG_AUX_VOL 0x26 |
621 |
+ #define CM_VAUXL_MASK 0xf0 |
622 |
+ #define CM_VAUXR_MASK 0x0f |
623 |
+@@ -3326,7 +3325,7 @@ static void snd_cmipci_remove(struct pci_dev *pci) |
624 |
+ */ |
625 |
+ static unsigned char saved_regs[] = { |
626 |
+ CM_REG_FUNCTRL1, CM_REG_CHFORMAT, CM_REG_LEGACY_CTRL, CM_REG_MISC_CTRL, |
627 |
+- CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_MIXER3, CM_REG_PLL, |
628 |
++ CM_REG_MIXER0, CM_REG_MIXER1, CM_REG_MIXER2, CM_REG_AUX_VOL, CM_REG_PLL, |
629 |
+ CM_REG_CH0_FRAME1, CM_REG_CH0_FRAME2, |
630 |
+ CM_REG_CH1_FRAME1, CM_REG_CH1_FRAME2, CM_REG_EXT_MISC, |
631 |
+ CM_REG_INT_STATUS, CM_REG_INT_HLDCLR, CM_REG_FUNCTRL0, |
632 |
+diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c |
633 |
+index d7878ed5ecc07..a84d3c9254d5e 100644 |
634 |
+--- a/sound/usb/mixer_quirks.c |
635 |
++++ b/sound/usb/mixer_quirks.c |
636 |
+@@ -1884,9 +1884,10 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, |
637 |
+ if (unitid == 7 && cval->control == UAC_FU_VOLUME) |
638 |
+ snd_dragonfly_quirk_db_scale(mixer, cval, kctl); |
639 |
+ break; |
640 |
+- /* lowest playback value is muted on C-Media devices */ |
641 |
+- case USB_ID(0x0d8c, 0x000c): |
642 |
+- case USB_ID(0x0d8c, 0x0014): |
643 |
++ /* lowest playback value is muted on some devices */ |
644 |
++ case USB_ID(0x0d8c, 0x000c): /* C-Media */ |
645 |
++ case USB_ID(0x0d8c, 0x0014): /* C-Media */ |
646 |
++ case USB_ID(0x19f7, 0x0003): /* RODE NT-USB */ |
647 |
+ if (strstr(kctl->id.name, "Playback")) |
648 |
+ cval->min_mute = 1; |
649 |
+ break; |