Magellan Linux

Contents of /trunk/kernel-alx/patches-5.4/0164-5.4.65-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3630 - (show annotations) (download)
Mon Sep 14 09:51:57 2020 UTC (3 years, 7 months ago) by niro
File size: 10828 byte(s)
-linux-5.4.65
1 diff --git a/Makefile b/Makefile
2 index 7bdfb21bb9269..4cb68164b79ee 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,7 +1,7 @@
6 # SPDX-License-Identifier: GPL-2.0
7 VERSION = 5
8 PATCHLEVEL = 4
9 -SUBLEVEL = 64
10 +SUBLEVEL = 65
11 EXTRAVERSION =
12 NAME = Kleptomaniac Octopus
13
14 diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
15 index b91f92e4e5f22..915ac75b55fc7 100644
16 --- a/drivers/net/usb/dm9601.c
17 +++ b/drivers/net/usb/dm9601.c
18 @@ -625,6 +625,10 @@ static const struct usb_device_id products[] = {
19 USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */
20 .driver_info = (unsigned long)&dm9601_info,
21 },
22 + {
23 + USB_DEVICE(0x0586, 0x3427), /* ZyXEL Keenetic Plus DSL xDSL modem */
24 + .driver_info = (unsigned long)&dm9601_info,
25 + },
26 {}, // END
27 };
28
29 diff --git a/net/core/dev.c b/net/core/dev.c
30 index 56cd7b83a3829..cdc1c3a144e1f 100644
31 --- a/net/core/dev.c
32 +++ b/net/core/dev.c
33 @@ -6231,12 +6231,13 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
34 netdev_err_once(dev, "%s() called with weight %d\n", __func__,
35 weight);
36 napi->weight = weight;
37 - list_add(&napi->dev_list, &dev->napi_list);
38 napi->dev = dev;
39 #ifdef CONFIG_NETPOLL
40 napi->poll_owner = -1;
41 #endif
42 set_bit(NAPI_STATE_SCHED, &napi->state);
43 + set_bit(NAPI_STATE_NPSVC, &napi->state);
44 + list_add_rcu(&napi->dev_list, &dev->napi_list);
45 napi_hash_add(napi);
46 }
47 EXPORT_SYMBOL(netif_napi_add);
48 diff --git a/net/core/netpoll.c b/net/core/netpoll.c
49 index 849380a622ef9..cb67d36f3adb0 100644
50 --- a/net/core/netpoll.c
51 +++ b/net/core/netpoll.c
52 @@ -161,7 +161,7 @@ static void poll_napi(struct net_device *dev)
53 struct napi_struct *napi;
54 int cpu = smp_processor_id();
55
56 - list_for_each_entry(napi, &dev->napi_list, dev_list) {
57 + list_for_each_entry_rcu(napi, &dev->napi_list, dev_list) {
58 if (cmpxchg(&napi->poll_owner, -1, cpu) == -1) {
59 poll_one_napi(napi);
60 smp_store_release(&napi->poll_owner, -1);
61 diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
62 index 47b6d73d30e55..51673d00bbeac 100644
63 --- a/net/ipv4/fib_trie.c
64 +++ b/net/ipv4/fib_trie.c
65 @@ -2010,7 +2010,8 @@ void fib_info_notify_update(struct net *net, struct nl_info *info)
66 struct hlist_head *head = &net->ipv4.fib_table_hash[h];
67 struct fib_table *tb;
68
69 - hlist_for_each_entry_rcu(tb, head, tb_hlist)
70 + hlist_for_each_entry_rcu(tb, head, tb_hlist,
71 + lockdep_rtnl_is_held())
72 __fib_info_notify_update(net, tb, info);
73 }
74 }
75 diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
76 index ec8fcfc60a27b..73842054bfe68 100644
77 --- a/net/ipv6/sysctl_net_ipv6.c
78 +++ b/net/ipv6/sysctl_net_ipv6.c
79 @@ -21,6 +21,7 @@
80 #include <net/calipso.h>
81 #endif
82
83 +static int two = 2;
84 static int flowlabel_reflect_max = 0x7;
85 static int auto_flowlabels_min;
86 static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX;
87 @@ -151,7 +152,7 @@ static struct ctl_table ipv6_table_template[] = {
88 .mode = 0644,
89 .proc_handler = proc_rt6_multipath_hash_policy,
90 .extra1 = SYSCTL_ZERO,
91 - .extra2 = SYSCTL_ONE,
92 + .extra2 = &two,
93 },
94 {
95 .procname = "seg6_flowlabel",
96 diff --git a/net/netlabel/netlabel_domainhash.c b/net/netlabel/netlabel_domainhash.c
97 index f5d34da0646ed..12aa803b2f689 100644
98 --- a/net/netlabel/netlabel_domainhash.c
99 +++ b/net/netlabel/netlabel_domainhash.c
100 @@ -85,6 +85,7 @@ static void netlbl_domhsh_free_entry(struct rcu_head *entry)
101 kfree(netlbl_domhsh_addr6_entry(iter6));
102 }
103 #endif /* IPv6 */
104 + kfree(ptr->def.addrsel);
105 }
106 kfree(ptr->domain);
107 kfree(ptr);
108 @@ -536,6 +537,8 @@ int netlbl_domhsh_add(struct netlbl_dom_map *entry,
109 goto add_return;
110 }
111 #endif /* IPv6 */
112 + /* cleanup the new entry since we've moved everything over */
113 + netlbl_domhsh_free_entry(&entry->rcu);
114 } else
115 ret_val = -EINVAL;
116
117 @@ -579,6 +582,12 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
118 {
119 int ret_val = 0;
120 struct audit_buffer *audit_buf;
121 + struct netlbl_af4list *iter4;
122 + struct netlbl_domaddr4_map *map4;
123 +#if IS_ENABLED(CONFIG_IPV6)
124 + struct netlbl_af6list *iter6;
125 + struct netlbl_domaddr6_map *map6;
126 +#endif /* IPv6 */
127
128 if (entry == NULL)
129 return -ENOENT;
130 @@ -596,6 +605,9 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
131 ret_val = -ENOENT;
132 spin_unlock(&netlbl_domhsh_lock);
133
134 + if (ret_val)
135 + return ret_val;
136 +
137 audit_buf = netlbl_audit_start_common(AUDIT_MAC_MAP_DEL, audit_info);
138 if (audit_buf != NULL) {
139 audit_log_format(audit_buf,
140 @@ -605,40 +617,29 @@ int netlbl_domhsh_remove_entry(struct netlbl_dom_map *entry,
141 audit_log_end(audit_buf);
142 }
143
144 - if (ret_val == 0) {
145 - struct netlbl_af4list *iter4;
146 - struct netlbl_domaddr4_map *map4;
147 -#if IS_ENABLED(CONFIG_IPV6)
148 - struct netlbl_af6list *iter6;
149 - struct netlbl_domaddr6_map *map6;
150 -#endif /* IPv6 */
151 -
152 - switch (entry->def.type) {
153 - case NETLBL_NLTYPE_ADDRSELECT:
154 - netlbl_af4list_foreach_rcu(iter4,
155 - &entry->def.addrsel->list4) {
156 - map4 = netlbl_domhsh_addr4_entry(iter4);
157 - cipso_v4_doi_putdef(map4->def.cipso);
158 - }
159 + switch (entry->def.type) {
160 + case NETLBL_NLTYPE_ADDRSELECT:
161 + netlbl_af4list_foreach_rcu(iter4, &entry->def.addrsel->list4) {
162 + map4 = netlbl_domhsh_addr4_entry(iter4);
163 + cipso_v4_doi_putdef(map4->def.cipso);
164 + }
165 #if IS_ENABLED(CONFIG_IPV6)
166 - netlbl_af6list_foreach_rcu(iter6,
167 - &entry->def.addrsel->list6) {
168 - map6 = netlbl_domhsh_addr6_entry(iter6);
169 - calipso_doi_putdef(map6->def.calipso);
170 - }
171 + netlbl_af6list_foreach_rcu(iter6, &entry->def.addrsel->list6) {
172 + map6 = netlbl_domhsh_addr6_entry(iter6);
173 + calipso_doi_putdef(map6->def.calipso);
174 + }
175 #endif /* IPv6 */
176 - break;
177 - case NETLBL_NLTYPE_CIPSOV4:
178 - cipso_v4_doi_putdef(entry->def.cipso);
179 - break;
180 + break;
181 + case NETLBL_NLTYPE_CIPSOV4:
182 + cipso_v4_doi_putdef(entry->def.cipso);
183 + break;
184 #if IS_ENABLED(CONFIG_IPV6)
185 - case NETLBL_NLTYPE_CALIPSO:
186 - calipso_doi_putdef(entry->def.calipso);
187 - break;
188 + case NETLBL_NLTYPE_CALIPSO:
189 + calipso_doi_putdef(entry->def.calipso);
190 + break;
191 #endif /* IPv6 */
192 - }
193 - call_rcu(&entry->rcu, netlbl_domhsh_free_entry);
194 }
195 + call_rcu(&entry->rcu, netlbl_domhsh_free_entry);
196
197 return ret_val;
198 }
199 diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
200 index b1eb12d33b9a6..6a5086e586efb 100644
201 --- a/net/sched/sch_taprio.c
202 +++ b/net/sched/sch_taprio.c
203 @@ -1177,9 +1177,27 @@ static void taprio_offload_config_changed(struct taprio_sched *q)
204 spin_unlock(&q->current_entry_lock);
205 }
206
207 -static void taprio_sched_to_offload(struct taprio_sched *q,
208 +static u32 tc_map_to_queue_mask(struct net_device *dev, u32 tc_mask)
209 +{
210 + u32 i, queue_mask = 0;
211 +
212 + for (i = 0; i < dev->num_tc; i++) {
213 + u32 offset, count;
214 +
215 + if (!(tc_mask & BIT(i)))
216 + continue;
217 +
218 + offset = dev->tc_to_txq[i].offset;
219 + count = dev->tc_to_txq[i].count;
220 +
221 + queue_mask |= GENMASK(offset + count - 1, offset);
222 + }
223 +
224 + return queue_mask;
225 +}
226 +
227 +static void taprio_sched_to_offload(struct net_device *dev,
228 struct sched_gate_list *sched,
229 - const struct tc_mqprio_qopt *mqprio,
230 struct tc_taprio_qopt_offload *offload)
231 {
232 struct sched_entry *entry;
233 @@ -1194,7 +1212,8 @@ static void taprio_sched_to_offload(struct taprio_sched *q,
234
235 e->command = entry->command;
236 e->interval = entry->interval;
237 - e->gate_mask = entry->gate_mask;
238 + e->gate_mask = tc_map_to_queue_mask(dev, entry->gate_mask);
239 +
240 i++;
241 }
242
243 @@ -1202,7 +1221,6 @@ static void taprio_sched_to_offload(struct taprio_sched *q,
244 }
245
246 static int taprio_enable_offload(struct net_device *dev,
247 - struct tc_mqprio_qopt *mqprio,
248 struct taprio_sched *q,
249 struct sched_gate_list *sched,
250 struct netlink_ext_ack *extack)
251 @@ -1224,7 +1242,7 @@ static int taprio_enable_offload(struct net_device *dev,
252 return -ENOMEM;
253 }
254 offload->enable = 1;
255 - taprio_sched_to_offload(q, sched, mqprio, offload);
256 + taprio_sched_to_offload(dev, sched, offload);
257
258 err = ops->ndo_setup_tc(dev, TC_SETUP_QDISC_TAPRIO, offload);
259 if (err < 0) {
260 @@ -1486,7 +1504,7 @@ static int taprio_change(struct Qdisc *sch, struct nlattr *opt,
261 }
262
263 if (FULL_OFFLOAD_IS_ENABLED(q->flags))
264 - err = taprio_enable_offload(dev, mqprio, q, new_admin, extack);
265 + err = taprio_enable_offload(dev, q, new_admin, extack);
266 else
267 err = taprio_disable_offload(dev, q, extack);
268 if (err)
269 diff --git a/net/sctp/socket.c b/net/sctp/socket.c
270 index 58fe6556cdf5b..3a11212bb4c0e 100644
271 --- a/net/sctp/socket.c
272 +++ b/net/sctp/socket.c
273 @@ -8176,8 +8176,6 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
274
275 pr_debug("%s: begins, snum:%d\n", __func__, snum);
276
277 - local_bh_disable();
278 -
279 if (snum == 0) {
280 /* Search for an available port. */
281 int low, high, remaining, index;
282 @@ -8196,20 +8194,21 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
283 continue;
284 index = sctp_phashfn(sock_net(sk), rover);
285 head = &sctp_port_hashtable[index];
286 - spin_lock(&head->lock);
287 + spin_lock_bh(&head->lock);
288 sctp_for_each_hentry(pp, &head->chain)
289 if ((pp->port == rover) &&
290 net_eq(sock_net(sk), pp->net))
291 goto next;
292 break;
293 next:
294 - spin_unlock(&head->lock);
295 + spin_unlock_bh(&head->lock);
296 + cond_resched();
297 } while (--remaining > 0);
298
299 /* Exhausted local port range during search? */
300 ret = 1;
301 if (remaining <= 0)
302 - goto fail;
303 + return ret;
304
305 /* OK, here is the one we will use. HEAD (the port
306 * hash table list entry) is non-NULL and we hold it's
307 @@ -8224,7 +8223,7 @@ static int sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
308 * port iterator, pp being NULL.
309 */
310 head = &sctp_port_hashtable[sctp_phashfn(sock_net(sk), snum)];
311 - spin_lock(&head->lock);
312 + spin_lock_bh(&head->lock);
313 sctp_for_each_hentry(pp, &head->chain) {
314 if ((pp->port == snum) && net_eq(pp->net, sock_net(sk)))
315 goto pp_found;
316 @@ -8324,10 +8323,7 @@ success:
317 ret = 0;
318
319 fail_unlock:
320 - spin_unlock(&head->lock);
321 -
322 -fail:
323 - local_bh_enable();
324 + spin_unlock_bh(&head->lock);
325 return ret;
326 }
327
328 diff --git a/net/tipc/socket.c b/net/tipc/socket.c
329 index aea951a1f805b..5318bb6611abc 100644
330 --- a/net/tipc/socket.c
331 +++ b/net/tipc/socket.c
332 @@ -2616,18 +2616,21 @@ static int tipc_shutdown(struct socket *sock, int how)
333
334 trace_tipc_sk_shutdown(sk, NULL, TIPC_DUMP_ALL, " ");
335 __tipc_shutdown(sock, TIPC_CONN_SHUTDOWN);
336 - sk->sk_shutdown = SEND_SHUTDOWN;
337 + if (tipc_sk_type_connectionless(sk))
338 + sk->sk_shutdown = SHUTDOWN_MASK;
339 + else
340 + sk->sk_shutdown = SEND_SHUTDOWN;
341
342 if (sk->sk_state == TIPC_DISCONNECTING) {
343 /* Discard any unreceived messages */
344 __skb_queue_purge(&sk->sk_receive_queue);
345
346 - /* Wake up anyone sleeping in poll */
347 - sk->sk_state_change(sk);
348 res = 0;
349 } else {
350 res = -ENOTCONN;
351 }
352 + /* Wake up anyone sleeping in poll. */
353 + sk->sk_state_change(sk);
354
355 release_sock(sk);
356 return res;