1 |
commit: 7982d508340a660599631685d0ff0ea8455073bd |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 6 13:25:44 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 6 13:25:44 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7982d508 |
7 |
|
8 |
Linux patch 5.4.158 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1157_linux-5.4.158.patch | 331 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 335 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index eb1b9b5..e290e24 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -671,6 +671,10 @@ Patch: 1156_linux-5.4.157.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.157 |
23 |
|
24 |
+Patch: 1157_linux-5.4.158.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.158 |
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/1157_linux-5.4.158.patch b/1157_linux-5.4.158.patch |
33 |
new file mode 100644 |
34 |
index 0000000..452c5bd |
35 |
--- /dev/null |
36 |
+++ b/1157_linux-5.4.158.patch |
37 |
@@ -0,0 +1,331 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 49d639fe5a801..cef1d2704c410 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 157 |
47 |
++SUBLEVEL = 158 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c |
52 |
+index af58768a03937..702284bcd467c 100644 |
53 |
+--- a/drivers/amba/bus.c |
54 |
++++ b/drivers/amba/bus.c |
55 |
+@@ -375,9 +375,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) |
56 |
+ void __iomem *tmp; |
57 |
+ int i, ret; |
58 |
+ |
59 |
+- WARN_ON(dev->irq[0] == (unsigned int)-1); |
60 |
+- WARN_ON(dev->irq[1] == (unsigned int)-1); |
61 |
+- |
62 |
+ ret = request_resource(parent, &dev->res); |
63 |
+ if (ret) |
64 |
+ goto err_out; |
65 |
+diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c |
66 |
+index a7b88ca8b97b3..fe81c565e7ef8 100644 |
67 |
+--- a/drivers/gpu/drm/ttm/ttm_bo_util.c |
68 |
++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c |
69 |
+@@ -463,7 +463,6 @@ static void ttm_transfered_destroy(struct ttm_buffer_object *bo) |
70 |
+ struct ttm_transfer_obj *fbo; |
71 |
+ |
72 |
+ fbo = container_of(bo, struct ttm_transfer_obj, base); |
73 |
+- dma_resv_fini(&fbo->base.base._resv); |
74 |
+ ttm_bo_put(fbo->bo); |
75 |
+ kfree(fbo); |
76 |
+ } |
77 |
+diff --git a/drivers/media/firewire/firedtv-avc.c b/drivers/media/firewire/firedtv-avc.c |
78 |
+index 2bf9467b917d1..71991f8638e6b 100644 |
79 |
+--- a/drivers/media/firewire/firedtv-avc.c |
80 |
++++ b/drivers/media/firewire/firedtv-avc.c |
81 |
+@@ -1165,7 +1165,11 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) |
82 |
+ read_pos += program_info_length; |
83 |
+ write_pos += program_info_length; |
84 |
+ } |
85 |
+- while (read_pos < length) { |
86 |
++ while (read_pos + 4 < length) { |
87 |
++ if (write_pos + 4 >= sizeof(c->operand) - 4) { |
88 |
++ ret = -EINVAL; |
89 |
++ goto out; |
90 |
++ } |
91 |
+ c->operand[write_pos++] = msg[read_pos++]; |
92 |
+ c->operand[write_pos++] = msg[read_pos++]; |
93 |
+ c->operand[write_pos++] = msg[read_pos++]; |
94 |
+@@ -1177,13 +1181,17 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int length) |
95 |
+ c->operand[write_pos++] = es_info_length >> 8; |
96 |
+ c->operand[write_pos++] = es_info_length & 0xff; |
97 |
+ if (es_info_length > 0) { |
98 |
++ if (read_pos >= length) { |
99 |
++ ret = -EINVAL; |
100 |
++ goto out; |
101 |
++ } |
102 |
+ pmt_cmd_id = msg[read_pos++]; |
103 |
+ if (pmt_cmd_id != 1 && pmt_cmd_id != 4) |
104 |
+ dev_err(fdtv->device, "invalid pmt_cmd_id %d at stream level\n", |
105 |
+ pmt_cmd_id); |
106 |
+ |
107 |
+- if (es_info_length > sizeof(c->operand) - 4 - |
108 |
+- write_pos) { |
109 |
++ if (es_info_length > sizeof(c->operand) - 4 - write_pos || |
110 |
++ es_info_length > length - read_pos) { |
111 |
+ ret = -EINVAL; |
112 |
+ goto out; |
113 |
+ } |
114 |
+diff --git a/drivers/media/firewire/firedtv-ci.c b/drivers/media/firewire/firedtv-ci.c |
115 |
+index 9363d005e2b61..e0d57e09dab0c 100644 |
116 |
+--- a/drivers/media/firewire/firedtv-ci.c |
117 |
++++ b/drivers/media/firewire/firedtv-ci.c |
118 |
+@@ -134,6 +134,8 @@ static int fdtv_ca_pmt(struct firedtv *fdtv, void *arg) |
119 |
+ } else { |
120 |
+ data_length = msg->msg[3]; |
121 |
+ } |
122 |
++ if (data_length > sizeof(msg->msg) - data_pos) |
123 |
++ return -EINVAL; |
124 |
+ |
125 |
+ return avc_ca_pmt(fdtv, &msg->msg[data_pos], data_length); |
126 |
+ } |
127 |
+diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c |
128 |
+index a109120da0e7c..22beeb5be9c41 100644 |
129 |
+--- a/drivers/net/ethernet/microchip/lan743x_main.c |
130 |
++++ b/drivers/net/ethernet/microchip/lan743x_main.c |
131 |
+@@ -1898,13 +1898,13 @@ static int lan743x_rx_next_index(struct lan743x_rx *rx, int index) |
132 |
+ return ((++index) % rx->ring_size); |
133 |
+ } |
134 |
+ |
135 |
+-static struct sk_buff *lan743x_rx_allocate_skb(struct lan743x_rx *rx) |
136 |
++static struct sk_buff *lan743x_rx_allocate_skb(struct lan743x_rx *rx, gfp_t gfp) |
137 |
+ { |
138 |
+ int length = 0; |
139 |
+ |
140 |
+ length = (LAN743X_MAX_FRAME_SIZE + ETH_HLEN + 4 + RX_HEAD_PADDING); |
141 |
+ return __netdev_alloc_skb(rx->adapter->netdev, |
142 |
+- length, GFP_ATOMIC | GFP_DMA); |
143 |
++ length, gfp); |
144 |
+ } |
145 |
+ |
146 |
+ static void lan743x_rx_update_tail(struct lan743x_rx *rx, int index) |
147 |
+@@ -2077,7 +2077,8 @@ static int lan743x_rx_process_packet(struct lan743x_rx *rx) |
148 |
+ struct sk_buff *new_skb = NULL; |
149 |
+ int packet_length; |
150 |
+ |
151 |
+- new_skb = lan743x_rx_allocate_skb(rx); |
152 |
++ new_skb = lan743x_rx_allocate_skb(rx, |
153 |
++ GFP_ATOMIC | GFP_DMA); |
154 |
+ if (!new_skb) { |
155 |
+ /* failed to allocate next skb. |
156 |
+ * Memory is very low. |
157 |
+@@ -2314,7 +2315,8 @@ static int lan743x_rx_ring_init(struct lan743x_rx *rx) |
158 |
+ |
159 |
+ rx->last_head = 0; |
160 |
+ for (index = 0; index < rx->ring_size; index++) { |
161 |
+- struct sk_buff *new_skb = lan743x_rx_allocate_skb(rx); |
162 |
++ struct sk_buff *new_skb = lan743x_rx_allocate_skb(rx, |
163 |
++ GFP_KERNEL); |
164 |
+ |
165 |
+ ret = lan743x_rx_init_ring_element(rx, index, new_skb); |
166 |
+ if (ret) |
167 |
+diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c |
168 |
+index 86b965875540d..d53e945dd08fc 100644 |
169 |
+--- a/drivers/net/ethernet/sfc/ethtool.c |
170 |
++++ b/drivers/net/ethernet/sfc/ethtool.c |
171 |
+@@ -128,20 +128,14 @@ efx_ethtool_get_link_ksettings(struct net_device *net_dev, |
172 |
+ { |
173 |
+ struct efx_nic *efx = netdev_priv(net_dev); |
174 |
+ struct efx_link_state *link_state = &efx->link_state; |
175 |
+- u32 supported; |
176 |
+ |
177 |
+ mutex_lock(&efx->mac_lock); |
178 |
+ efx->phy_op->get_link_ksettings(efx, cmd); |
179 |
+ mutex_unlock(&efx->mac_lock); |
180 |
+ |
181 |
+ /* Both MACs support pause frames (bidirectional and respond-only) */ |
182 |
+- ethtool_convert_link_mode_to_legacy_u32(&supported, |
183 |
+- cmd->link_modes.supported); |
184 |
+- |
185 |
+- supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; |
186 |
+- |
187 |
+- ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported, |
188 |
+- supported); |
189 |
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Pause); |
190 |
++ ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause); |
191 |
+ |
192 |
+ if (LOOPBACK_INTERNAL(efx)) { |
193 |
+ cmd->base.speed = link_state->speed; |
194 |
+diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c |
195 |
+index 9b626c169554f..f08ed52d51f3f 100644 |
196 |
+--- a/drivers/net/vrf.c |
197 |
++++ b/drivers/net/vrf.c |
198 |
+@@ -1036,8 +1036,6 @@ static struct sk_buff *vrf_ip6_rcv(struct net_device *vrf_dev, |
199 |
+ bool need_strict = rt6_need_strict(&ipv6_hdr(skb)->daddr); |
200 |
+ bool is_ndisc = ipv6_ndisc_frame(skb); |
201 |
+ |
202 |
+- nf_reset_ct(skb); |
203 |
+- |
204 |
+ /* loopback, multicast & non-ND link-local traffic; do not push through |
205 |
+ * packet taps again. Reset pkt_type for upper layers to process skb. |
206 |
+ * For strict packets with a source LLA, determine the dst using the |
207 |
+@@ -1094,8 +1092,6 @@ static struct sk_buff *vrf_ip_rcv(struct net_device *vrf_dev, |
208 |
+ skb->skb_iif = vrf_dev->ifindex; |
209 |
+ IPCB(skb)->flags |= IPSKB_L3SLAVE; |
210 |
+ |
211 |
+- nf_reset_ct(skb); |
212 |
+- |
213 |
+ if (ipv4_is_multicast(ip_hdr(skb)->daddr)) |
214 |
+ goto out; |
215 |
+ |
216 |
+diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c |
217 |
+index 1f5b5c8a7f726..1ce3f90f782fd 100644 |
218 |
+--- a/drivers/scsi/scsi.c |
219 |
++++ b/drivers/scsi/scsi.c |
220 |
+@@ -555,8 +555,10 @@ EXPORT_SYMBOL(scsi_device_get); |
221 |
+ */ |
222 |
+ void scsi_device_put(struct scsi_device *sdev) |
223 |
+ { |
224 |
+- module_put(sdev->host->hostt->module); |
225 |
++ struct module *mod = sdev->host->hostt->module; |
226 |
++ |
227 |
+ put_device(&sdev->sdev_gendev); |
228 |
++ module_put(mod); |
229 |
+ } |
230 |
+ EXPORT_SYMBOL(scsi_device_put); |
231 |
+ |
232 |
+diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c |
233 |
+index 6aeb79e744e0b..12064ce76777d 100644 |
234 |
+--- a/drivers/scsi/scsi_sysfs.c |
235 |
++++ b/drivers/scsi/scsi_sysfs.c |
236 |
+@@ -438,9 +438,12 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work) |
237 |
+ struct list_head *this, *tmp; |
238 |
+ struct scsi_vpd *vpd_pg80 = NULL, *vpd_pg83 = NULL; |
239 |
+ unsigned long flags; |
240 |
++ struct module *mod; |
241 |
+ |
242 |
+ sdev = container_of(work, struct scsi_device, ew.work); |
243 |
+ |
244 |
++ mod = sdev->host->hostt->module; |
245 |
++ |
246 |
+ scsi_dh_release_device(sdev); |
247 |
+ |
248 |
+ parent = sdev->sdev_gendev.parent; |
249 |
+@@ -481,11 +484,17 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work) |
250 |
+ |
251 |
+ if (parent) |
252 |
+ put_device(parent); |
253 |
++ module_put(mod); |
254 |
+ } |
255 |
+ |
256 |
+ static void scsi_device_dev_release(struct device *dev) |
257 |
+ { |
258 |
+ struct scsi_device *sdp = to_scsi_device(dev); |
259 |
++ |
260 |
++ /* Set module pointer as NULL in case of module unloading */ |
261 |
++ if (!try_module_get(sdp->host->hostt->module)) |
262 |
++ sdp->host->hostt->module = NULL; |
263 |
++ |
264 |
+ execute_in_process_context(scsi_device_dev_release_usercontext, |
265 |
+ &sdp->ew); |
266 |
+ } |
267 |
+diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c |
268 |
+index 48ff9c66ae46d..d0f45600b6698 100644 |
269 |
+--- a/drivers/usb/core/hcd.c |
270 |
++++ b/drivers/usb/core/hcd.c |
271 |
+@@ -2636,7 +2636,6 @@ int usb_add_hcd(struct usb_hcd *hcd, |
272 |
+ { |
273 |
+ int retval; |
274 |
+ struct usb_device *rhdev; |
275 |
+- struct usb_hcd *shared_hcd; |
276 |
+ |
277 |
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) { |
278 |
+ hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev); |
279 |
+@@ -2793,26 +2792,13 @@ int usb_add_hcd(struct usb_hcd *hcd, |
280 |
+ goto err_hcd_driver_start; |
281 |
+ } |
282 |
+ |
283 |
+- /* starting here, usbcore will pay attention to the shared HCD roothub */ |
284 |
+- shared_hcd = hcd->shared_hcd; |
285 |
+- if (!usb_hcd_is_primary_hcd(hcd) && shared_hcd && HCD_DEFER_RH_REGISTER(shared_hcd)) { |
286 |
+- retval = register_root_hub(shared_hcd); |
287 |
+- if (retval != 0) |
288 |
+- goto err_register_root_hub; |
289 |
+- |
290 |
+- if (shared_hcd->uses_new_polling && HCD_POLL_RH(shared_hcd)) |
291 |
+- usb_hcd_poll_rh_status(shared_hcd); |
292 |
+- } |
293 |
+- |
294 |
+ /* starting here, usbcore will pay attention to this root hub */ |
295 |
+- if (!HCD_DEFER_RH_REGISTER(hcd)) { |
296 |
+- retval = register_root_hub(hcd); |
297 |
+- if (retval != 0) |
298 |
+- goto err_register_root_hub; |
299 |
++ retval = register_root_hub(hcd); |
300 |
++ if (retval != 0) |
301 |
++ goto err_register_root_hub; |
302 |
+ |
303 |
+- if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) |
304 |
+- usb_hcd_poll_rh_status(hcd); |
305 |
+- } |
306 |
++ if (hcd->uses_new_polling && HCD_POLL_RH(hcd)) |
307 |
++ usb_hcd_poll_rh_status(hcd); |
308 |
+ |
309 |
+ return retval; |
310 |
+ |
311 |
+@@ -2855,7 +2841,6 @@ EXPORT_SYMBOL_GPL(usb_add_hcd); |
312 |
+ void usb_remove_hcd(struct usb_hcd *hcd) |
313 |
+ { |
314 |
+ struct usb_device *rhdev = hcd->self.root_hub; |
315 |
+- bool rh_registered; |
316 |
+ |
317 |
+ dev_info(hcd->self.controller, "remove, state %x\n", hcd->state); |
318 |
+ |
319 |
+@@ -2866,7 +2851,6 @@ void usb_remove_hcd(struct usb_hcd *hcd) |
320 |
+ |
321 |
+ dev_dbg(hcd->self.controller, "roothub graceful disconnect\n"); |
322 |
+ spin_lock_irq (&hcd_root_hub_lock); |
323 |
+- rh_registered = hcd->rh_registered; |
324 |
+ hcd->rh_registered = 0; |
325 |
+ spin_unlock_irq (&hcd_root_hub_lock); |
326 |
+ |
327 |
+@@ -2876,8 +2860,7 @@ void usb_remove_hcd(struct usb_hcd *hcd) |
328 |
+ cancel_work_sync(&hcd->died_work); |
329 |
+ |
330 |
+ mutex_lock(&usb_bus_idr_lock); |
331 |
+- if (rh_registered) |
332 |
+- usb_disconnect(&rhdev); /* Sets rhdev to NULL */ |
333 |
++ usb_disconnect(&rhdev); /* Sets rhdev to NULL */ |
334 |
+ mutex_unlock(&usb_bus_idr_lock); |
335 |
+ |
336 |
+ /* |
337 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
338 |
+index 4ef7484dff8b2..4bb850370bb6b 100644 |
339 |
+--- a/drivers/usb/host/xhci.c |
340 |
++++ b/drivers/usb/host/xhci.c |
341 |
+@@ -693,7 +693,6 @@ int xhci_run(struct usb_hcd *hcd) |
342 |
+ if (ret) |
343 |
+ xhci_free_command(xhci, command); |
344 |
+ } |
345 |
+- set_bit(HCD_FLAG_DEFER_RH_REGISTER, &hcd->flags); |
346 |
+ xhci_dbg_trace(xhci, trace_xhci_dbg_init, |
347 |
+ "Finished xhci_run for USB2 roothub"); |
348 |
+ |
349 |
+diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h |
350 |
+index c0eb85b2981e0..712b2a603645f 100644 |
351 |
+--- a/include/linux/usb/hcd.h |
352 |
++++ b/include/linux/usb/hcd.h |
353 |
+@@ -124,7 +124,6 @@ struct usb_hcd { |
354 |
+ #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */ |
355 |
+ #define HCD_FLAG_DEAD 6 /* controller has died? */ |
356 |
+ #define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */ |
357 |
+-#define HCD_FLAG_DEFER_RH_REGISTER 8 /* Defer roothub registration */ |
358 |
+ |
359 |
+ /* The flags can be tested using these macros; they are likely to |
360 |
+ * be slightly faster than test_bit(). |
361 |
+@@ -135,7 +134,6 @@ struct usb_hcd { |
362 |
+ #define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING)) |
363 |
+ #define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING)) |
364 |
+ #define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD)) |
365 |
+-#define HCD_DEFER_RH_REGISTER(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEFER_RH_REGISTER)) |
366 |
+ |
367 |
+ /* |
368 |
+ * Specifies if interfaces are authorized by default |