Contents of /trunk/kernel-alx-legacy/patches-4.9/0407-4.9.308-all-fixes.patch
Parent Directory | Revision Log
Revision 3709 -
(show annotations)
(download)
Mon Oct 24 14:08:22 2022 UTC (18 months, 1 week ago) by niro
File size: 10450 byte(s)
Mon Oct 24 14:08:22 2022 UTC (18 months, 1 week ago) by niro
File size: 10450 byte(s)
-linux-4.9.308
1 | diff --git a/Makefile b/Makefile |
2 | index 19363e65ef226..ecf06e17c3c88 100644 |
3 | --- a/Makefile |
4 | +++ b/Makefile |
5 | @@ -1,6 +1,6 @@ |
6 | VERSION = 4 |
7 | PATCHLEVEL = 9 |
8 | -SUBLEVEL = 307 |
9 | +SUBLEVEL = 308 |
10 | EXTRAVERSION = |
11 | NAME = Roaring Lionus |
12 | |
13 | diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi |
14 | index 7b727d738b69d..4702aa980ef8d 100644 |
15 | --- a/arch/arm/boot/dts/rk3288.dtsi |
16 | +++ b/arch/arm/boot/dts/rk3288.dtsi |
17 | @@ -918,7 +918,7 @@ |
18 | status = "disabled"; |
19 | }; |
20 | |
21 | - crypto: cypto-controller@ff8a0000 { |
22 | + crypto: crypto@ff8a0000 { |
23 | compatible = "rockchip,rk3288-crypto"; |
24 | reg = <0xff8a0000 0x4000>; |
25 | interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; |
26 | diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c |
27 | index 95ba4271af6a8..01aa8d6da4b95 100644 |
28 | --- a/arch/mips/kernel/smp.c |
29 | +++ b/arch/mips/kernel/smp.c |
30 | @@ -369,6 +369,9 @@ asmlinkage void start_secondary(void) |
31 | cpu = smp_processor_id(); |
32 | cpu_data[cpu].udelay_val = loops_per_jiffy; |
33 | |
34 | + set_cpu_sibling_map(cpu); |
35 | + set_cpu_core_map(cpu); |
36 | + |
37 | cpumask_set_cpu(cpu, &cpu_coherent_mask); |
38 | notify_cpu_starting(cpu); |
39 | |
40 | @@ -380,9 +383,6 @@ asmlinkage void start_secondary(void) |
41 | /* The CPU is running and counters synchronised, now mark it online */ |
42 | set_cpu_online(cpu, true); |
43 | |
44 | - set_cpu_sibling_map(cpu); |
45 | - set_cpu_core_map(cpu); |
46 | - |
47 | calculate_cpu_foreign_map(); |
48 | |
49 | /* |
50 | diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c |
51 | index 2b7786cd548f8..0ec52fb2b7fcf 100644 |
52 | --- a/drivers/atm/eni.c |
53 | +++ b/drivers/atm/eni.c |
54 | @@ -1114,6 +1114,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags); |
55 | } |
56 | paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len, |
57 | DMA_TO_DEVICE); |
58 | + if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr)) |
59 | + return enq_next; |
60 | ENI_PRV_PADDR(skb) = paddr; |
61 | /* prepare DMA queue entries */ |
62 | j = 0; |
63 | diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c |
64 | index 7cb2b863e653e..7d74b7e1a8370 100644 |
65 | --- a/drivers/atm/firestream.c |
66 | +++ b/drivers/atm/firestream.c |
67 | @@ -1692,6 +1692,8 @@ static int fs_init(struct fs_dev *dev) |
68 | dev->hw_base = pci_resource_start(pci_dev, 0); |
69 | |
70 | dev->base = ioremap(dev->hw_base, 0x1000); |
71 | + if (!dev->base) |
72 | + return 1; |
73 | |
74 | reset_chip (dev); |
75 | |
76 | diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c |
77 | index 5a7e5e073e526..58c0705470be6 100644 |
78 | --- a/drivers/input/tablet/aiptek.c |
79 | +++ b/drivers/input/tablet/aiptek.c |
80 | @@ -1821,15 +1821,13 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) |
81 | input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); |
82 | input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); |
83 | |
84 | - /* Verify that a device really has an endpoint */ |
85 | - if (intf->cur_altsetting->desc.bNumEndpoints < 1) { |
86 | + err = usb_find_common_endpoints(intf->cur_altsetting, |
87 | + NULL, NULL, &endpoint, NULL); |
88 | + if (err) { |
89 | dev_err(&intf->dev, |
90 | - "interface has %d endpoints, but must have minimum 1\n", |
91 | - intf->cur_altsetting->desc.bNumEndpoints); |
92 | - err = -EINVAL; |
93 | + "interface has no int in endpoints, but must have minimum 1\n"); |
94 | goto fail3; |
95 | } |
96 | - endpoint = &intf->cur_altsetting->endpoint[0].desc; |
97 | |
98 | /* Go set up our URB, which is called when the tablet receives |
99 | * input. |
100 | diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c |
101 | index 43cdd5544b0c4..a127c853a4e90 100644 |
102 | --- a/drivers/net/can/rcar/rcar_canfd.c |
103 | +++ b/drivers/net/can/rcar/rcar_canfd.c |
104 | @@ -1601,15 +1601,15 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, |
105 | |
106 | netif_napi_add(ndev, &priv->napi, rcar_canfd_rx_poll, |
107 | RCANFD_NAPI_WEIGHT); |
108 | + spin_lock_init(&priv->tx_lock); |
109 | + devm_can_led_init(ndev); |
110 | + gpriv->ch[priv->channel] = priv; |
111 | err = register_candev(ndev); |
112 | if (err) { |
113 | dev_err(&pdev->dev, |
114 | "register_candev() failed, error %d\n", err); |
115 | goto fail_candev; |
116 | } |
117 | - spin_lock_init(&priv->tx_lock); |
118 | - devm_can_led_init(ndev); |
119 | - gpriv->ch[priv->channel] = priv; |
120 | dev_info(&pdev->dev, "device registered (channel %u)\n", priv->channel); |
121 | return 0; |
122 | |
123 | diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c |
124 | index 241520943adae..221798499e24b 100644 |
125 | --- a/drivers/net/ethernet/sfc/mcdi.c |
126 | +++ b/drivers/net/ethernet/sfc/mcdi.c |
127 | @@ -162,9 +162,9 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd, |
128 | /* Serialise with efx_mcdi_ev_cpl() and efx_mcdi_ev_death() */ |
129 | spin_lock_bh(&mcdi->iface_lock); |
130 | ++mcdi->seqno; |
131 | + seqno = mcdi->seqno & SEQ_MASK; |
132 | spin_unlock_bh(&mcdi->iface_lock); |
133 | |
134 | - seqno = mcdi->seqno & SEQ_MASK; |
135 | xflags = 0; |
136 | if (mcdi->mode == MCDI_MODE_EVENTS) |
137 | xflags |= MCDI_HEADER_XFLAGS_EVREQ; |
138 | diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c |
139 | index 1e5c2cbe99947..30eeaf9bc8eca 100644 |
140 | --- a/drivers/usb/gadget/function/rndis.c |
141 | +++ b/drivers/usb/gadget/function/rndis.c |
142 | @@ -645,6 +645,7 @@ static int rndis_set_response(struct rndis_params *params, |
143 | BufLength = le32_to_cpu(buf->InformationBufferLength); |
144 | BufOffset = le32_to_cpu(buf->InformationBufferOffset); |
145 | if ((BufLength > RNDIS_MAX_TOTAL_SIZE) || |
146 | + (BufOffset > RNDIS_MAX_TOTAL_SIZE) || |
147 | (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE)) |
148 | return -EINVAL; |
149 | |
150 | diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c |
151 | index 34ad964d54d11..5d8c3fd2acc89 100644 |
152 | --- a/drivers/usb/gadget/udc/core.c |
153 | +++ b/drivers/usb/gadget/udc/core.c |
154 | @@ -1253,7 +1253,6 @@ static void usb_gadget_remove_driver(struct usb_udc *udc) |
155 | usb_gadget_udc_stop(udc); |
156 | |
157 | udc->driver = NULL; |
158 | - udc->dev.driver = NULL; |
159 | udc->gadget->dev.driver = NULL; |
160 | } |
161 | |
162 | @@ -1301,7 +1300,6 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri |
163 | driver->function); |
164 | |
165 | udc->driver = driver; |
166 | - udc->dev.driver = &driver->driver; |
167 | udc->gadget->dev.driver = &driver->driver; |
168 | |
169 | ret = driver->bind(udc->gadget, driver); |
170 | @@ -1321,7 +1319,6 @@ err1: |
171 | dev_err(&udc->dev, "failed to start %s: %d\n", |
172 | udc->driver->function, ret); |
173 | udc->driver = NULL; |
174 | - udc->dev.driver = NULL; |
175 | udc->gadget->dev.driver = NULL; |
176 | return ret; |
177 | } |
178 | diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c |
179 | index 300cdbdc8494e..c41e7f51150fc 100644 |
180 | --- a/fs/sysfs/file.c |
181 | +++ b/fs/sysfs/file.c |
182 | @@ -565,8 +565,7 @@ int sysfs_emit(char *buf, const char *fmt, ...) |
183 | va_list args; |
184 | int len; |
185 | |
186 | - if (WARN(!buf || offset_in_page(buf), |
187 | - "invalid sysfs_emit: buf:%p\n", buf)) |
188 | + if (WARN(!buf, "invalid sysfs_emit: buf:%p\n", buf)) |
189 | return 0; |
190 | |
191 | va_start(args, fmt); |
192 | diff --git a/lib/Kconfig b/lib/Kconfig |
193 | index 260a80e313b90..600759707ffe1 100644 |
194 | --- a/lib/Kconfig |
195 | +++ b/lib/Kconfig |
196 | @@ -16,7 +16,6 @@ config BITREVERSE |
197 | config HAVE_ARCH_BITREVERSE |
198 | bool |
199 | default n |
200 | - depends on BITREVERSE |
201 | help |
202 | This option enables the use of hardware bit-reversal instructions on |
203 | architectures which support such operations. |
204 | diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
205 | index aeda018e4c49e..6dfb964e1ad8f 100644 |
206 | --- a/net/ipv4/tcp.c |
207 | +++ b/net/ipv4/tcp.c |
208 | @@ -1561,11 +1561,13 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, |
209 | if (!copied) |
210 | copied = used; |
211 | break; |
212 | - } else if (used <= len) { |
213 | - seq += used; |
214 | - copied += used; |
215 | - offset += used; |
216 | } |
217 | + if (WARN_ON_ONCE(used > len)) |
218 | + used = len; |
219 | + seq += used; |
220 | + copied += used; |
221 | + offset += used; |
222 | + |
223 | /* If recv_actor drops the lock (e.g. TCP splice |
224 | * receive) the skb pointer might be invalid when |
225 | * getting here: tcp_collapse might have deleted it |
226 | diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c |
227 | index 8e62b05efe297..e79d6881a97eb 100644 |
228 | --- a/net/packet/af_packet.c |
229 | +++ b/net/packet/af_packet.c |
230 | @@ -2244,8 +2244,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, |
231 | copy_skb = skb_get(skb); |
232 | skb_head = skb->data; |
233 | } |
234 | - if (copy_skb) |
235 | + if (copy_skb) { |
236 | + memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0, |
237 | + sizeof(PACKET_SKB_CB(copy_skb)->sa.ll)); |
238 | skb_set_owner_r(copy_skb, sk); |
239 | + } |
240 | } |
241 | snaplen = po->rx_ring.frame_size - macoff; |
242 | if ((int)snaplen < 0) { |
243 | @@ -3422,6 +3425,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, |
244 | sock_recv_ts_and_drops(msg, sk, skb); |
245 | |
246 | if (msg->msg_name) { |
247 | + const size_t max_len = min(sizeof(skb->cb), |
248 | + sizeof(struct sockaddr_storage)); |
249 | int copy_len; |
250 | |
251 | /* If the address length field is there to be filled |
252 | @@ -3444,6 +3449,10 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, |
253 | msg->msg_namelen = sizeof(struct sockaddr_ll); |
254 | } |
255 | } |
256 | + if (WARN_ON_ONCE(copy_len > max_len)) { |
257 | + copy_len = max_len; |
258 | + msg->msg_namelen = copy_len; |
259 | + } |
260 | memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len); |
261 | } |
262 | |
263 | diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c |
264 | index ab8bca39afa3f..562e138deba28 100644 |
265 | --- a/net/wireless/nl80211.c |
266 | +++ b/net/wireless/nl80211.c |
267 | @@ -14068,7 +14068,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev, |
268 | wdev->chandef = *chandef; |
269 | wdev->preset_chandef = *chandef; |
270 | |
271 | - if (wdev->iftype == NL80211_IFTYPE_STATION && |
272 | + if ((wdev->iftype == NL80211_IFTYPE_STATION || |
273 | + wdev->iftype == NL80211_IFTYPE_P2P_CLIENT) && |
274 | !WARN_ON(!wdev->current_bss)) |
275 | wdev->current_bss->pub.channel = chandef->chan; |
276 | |
277 | diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c |
278 | index 4d19f2ff6e052..73b4e7c0d3368 100644 |
279 | --- a/net/xfrm/xfrm_state.c |
280 | +++ b/net/xfrm/xfrm_state.c |
281 | @@ -1238,9 +1238,6 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig) |
282 | |
283 | memcpy(&x->mark, &orig->mark, sizeof(x->mark)); |
284 | |
285 | - if (xfrm_init_state(x) < 0) |
286 | - goto error; |
287 | - |
288 | x->props.flags = orig->props.flags; |
289 | x->props.extra_flags = orig->props.extra_flags; |
290 | |
291 | @@ -1317,6 +1314,11 @@ struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, |
292 | if (!xc) |
293 | return NULL; |
294 | |
295 | + xc->props.family = m->new_family; |
296 | + |
297 | + if (xfrm_init_state(xc) < 0) |
298 | + goto error; |
299 | + |
300 | memcpy(&xc->id.daddr, &m->new_daddr, sizeof(xc->id.daddr)); |
301 | memcpy(&xc->props.saddr, &m->new_saddr, sizeof(xc->props.saddr)); |
302 | |
303 | diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c |
304 | index d77ed41b20941..1f89d3dd82953 100644 |
305 | --- a/tools/testing/selftests/vm/userfaultfd.c |
306 | +++ b/tools/testing/selftests/vm/userfaultfd.c |
307 | @@ -60,6 +60,7 @@ |
308 | #include <signal.h> |
309 | #include <poll.h> |
310 | #include <string.h> |
311 | +#include <linux/mman.h> |
312 | #include <sys/mman.h> |
313 | #include <sys/syscall.h> |
314 | #include <sys/ioctl.h> |