Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.8 commit in: /
Date: Thu, 27 Aug 2020 13:22:26
Message-Id: 1598534526.1d996290ed3f1ffdc4ea2d9b4c4d2cf19ccc77d3.mpagano@gentoo
1 commit: 1d996290ed3f1ffdc4ea2d9b4c4d2cf19ccc77d3
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 27 13:22:06 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 27 13:22:06 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=1d996290
7
8 Linux patch 5.8.5
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1004_linux-5.8.5.patch | 397 +++++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 401 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 17d6b16..4ed3bb4 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -59,6 +59,10 @@ Patch: 1003_linux-5.8.4.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.8.4
23
24 +Patch: 1004_linux-5.8.5.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.8.5
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/1004_linux-5.8.5.patch b/1004_linux-5.8.5.patch
33 new file mode 100644
34 index 0000000..68d90ad
35 --- /dev/null
36 +++ b/1004_linux-5.8.5.patch
37 @@ -0,0 +1,397 @@
38 +diff --git a/Makefile b/Makefile
39 +index 9a7a416f2d84e..f47073a3b4740 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 8
46 +-SUBLEVEL = 4
47 ++SUBLEVEL = 5
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
52 +index 000f57198352d..9f2c697ba0ac8 100644
53 +--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
54 ++++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
55 +@@ -3609,7 +3609,7 @@ static int check_missing_comp_in_tx_queue(struct ena_adapter *adapter,
56 + }
57 +
58 + u64_stats_update_begin(&tx_ring->syncp);
59 +- tx_ring->tx_stats.missed_tx = missed_tx;
60 ++ tx_ring->tx_stats.missed_tx += missed_tx;
61 + u64_stats_update_end(&tx_ring->syncp);
62 +
63 + return rc;
64 +@@ -4537,6 +4537,9 @@ static void ena_keep_alive_wd(void *adapter_data,
65 + tx_drops = ((u64)desc->tx_drops_high << 32) | desc->tx_drops_low;
66 +
67 + u64_stats_update_begin(&adapter->syncp);
68 ++ /* These stats are accumulated by the device, so the counters indicate
69 ++ * all drops since last reset.
70 ++ */
71 + adapter->dev_stats.rx_drops = rx_drops;
72 + adapter->dev_stats.tx_drops = tx_drops;
73 + u64_stats_update_end(&adapter->syncp);
74 +diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
75 +index f2f9086ebe983..b9c658e0548eb 100644
76 +--- a/fs/binfmt_flat.c
77 ++++ b/fs/binfmt_flat.c
78 +@@ -576,7 +576,7 @@ static int load_flat_file(struct linux_binprm *bprm,
79 + goto err;
80 + }
81 +
82 +- len = data_len + extra;
83 ++ len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long);
84 + len = PAGE_ALIGN(len);
85 + realdatastart = vm_mmap(NULL, 0, len,
86 + PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0);
87 +@@ -590,7 +590,9 @@ static int load_flat_file(struct linux_binprm *bprm,
88 + vm_munmap(textpos, text_len);
89 + goto err;
90 + }
91 +- datapos = ALIGN(realdatastart, FLAT_DATA_ALIGN);
92 ++ datapos = ALIGN(realdatastart +
93 ++ MAX_SHARED_LIBS * sizeof(unsigned long),
94 ++ FLAT_DATA_ALIGN);
95 +
96 + pr_debug("Allocated data+bss+stack (%u bytes): %lx\n",
97 + data_len + bss_len + stack_len, datapos);
98 +@@ -620,7 +622,7 @@ static int load_flat_file(struct linux_binprm *bprm,
99 + memp_size = len;
100 + } else {
101 +
102 +- len = text_len + data_len + extra;
103 ++ len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(u32);
104 + len = PAGE_ALIGN(len);
105 + textpos = vm_mmap(NULL, 0, len,
106 + PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0);
107 +@@ -635,7 +637,9 @@ static int load_flat_file(struct linux_binprm *bprm,
108 + }
109 +
110 + realdatastart = textpos + ntohl(hdr->data_start);
111 +- datapos = ALIGN(realdatastart, FLAT_DATA_ALIGN);
112 ++ datapos = ALIGN(realdatastart +
113 ++ MAX_SHARED_LIBS * sizeof(u32),
114 ++ FLAT_DATA_ALIGN);
115 +
116 + reloc = (__be32 __user *)
117 + (datapos + (ntohl(hdr->reloc_start) - text_len));
118 +@@ -652,9 +656,8 @@ static int load_flat_file(struct linux_binprm *bprm,
119 + (text_len + full_data
120 + - sizeof(struct flat_hdr)),
121 + 0);
122 +- if (datapos != realdatastart)
123 +- memmove((void *)datapos, (void *)realdatastart,
124 +- full_data);
125 ++ memmove((void *) datapos, (void *) realdatastart,
126 ++ full_data);
127 + #else
128 + /*
129 + * This is used on MMU systems mainly for testing.
130 +@@ -710,7 +713,8 @@ static int load_flat_file(struct linux_binprm *bprm,
131 + if (IS_ERR_VALUE(result)) {
132 + ret = result;
133 + pr_err("Unable to read code+data+bss, errno %d\n", ret);
134 +- vm_munmap(textpos, text_len + data_len + extra);
135 ++ vm_munmap(textpos, text_len + data_len + extra +
136 ++ MAX_SHARED_LIBS * sizeof(u32));
137 + goto err;
138 + }
139 + }
140 +diff --git a/fs/io_uring.c b/fs/io_uring.c
141 +index dd8ad87540ef7..26978630378e0 100644
142 +--- a/fs/io_uring.c
143 ++++ b/fs/io_uring.c
144 +@@ -4363,7 +4363,8 @@ static int io_sq_thread_acquire_mm(struct io_ring_ctx *ctx,
145 + struct io_kiocb *req)
146 + {
147 + if (io_op_defs[req->opcode].needs_mm && !current->mm) {
148 +- if (unlikely(!mmget_not_zero(ctx->sqo_mm)))
149 ++ if (unlikely(!(ctx->flags & IORING_SETUP_SQPOLL) ||
150 ++ !mmget_not_zero(ctx->sqo_mm)))
151 + return -EFAULT;
152 + kthread_use_mm(ctx->sqo_mm);
153 + }
154 +diff --git a/net/core/skbuff.c b/net/core/skbuff.c
155 +index b8afefe6f6b69..7afe52bd038ba 100644
156 +--- a/net/core/skbuff.c
157 ++++ b/net/core/skbuff.c
158 +@@ -5419,8 +5419,8 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb)
159 + skb = skb_share_check(skb, GFP_ATOMIC);
160 + if (unlikely(!skb))
161 + goto err_free;
162 +-
163 +- if (unlikely(!pskb_may_pull(skb, VLAN_HLEN)))
164 ++ /* We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). */
165 ++ if (unlikely(!pskb_may_pull(skb, VLAN_HLEN + sizeof(unsigned short))))
166 + goto err_free;
167 +
168 + vhdr = (struct vlan_hdr *)skb->data;
169 +diff --git a/net/ethtool/features.c b/net/ethtool/features.c
170 +index 4e632dc987d85..495635f152ba6 100644
171 +--- a/net/ethtool/features.c
172 ++++ b/net/ethtool/features.c
173 +@@ -224,7 +224,9 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
174 + DECLARE_BITMAP(wanted_diff_mask, NETDEV_FEATURE_COUNT);
175 + DECLARE_BITMAP(active_diff_mask, NETDEV_FEATURE_COUNT);
176 + DECLARE_BITMAP(old_active, NETDEV_FEATURE_COUNT);
177 ++ DECLARE_BITMAP(old_wanted, NETDEV_FEATURE_COUNT);
178 + DECLARE_BITMAP(new_active, NETDEV_FEATURE_COUNT);
179 ++ DECLARE_BITMAP(new_wanted, NETDEV_FEATURE_COUNT);
180 + DECLARE_BITMAP(req_wanted, NETDEV_FEATURE_COUNT);
181 + DECLARE_BITMAP(req_mask, NETDEV_FEATURE_COUNT);
182 + struct nlattr *tb[ETHTOOL_A_FEATURES_MAX + 1];
183 +@@ -250,6 +252,7 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
184 +
185 + rtnl_lock();
186 + ethnl_features_to_bitmap(old_active, dev->features);
187 ++ ethnl_features_to_bitmap(old_wanted, dev->wanted_features);
188 + ret = ethnl_parse_bitset(req_wanted, req_mask, NETDEV_FEATURE_COUNT,
189 + tb[ETHTOOL_A_FEATURES_WANTED],
190 + netdev_features_strings, info->extack);
191 +@@ -261,17 +264,15 @@ int ethnl_set_features(struct sk_buff *skb, struct genl_info *info)
192 + goto out_rtnl;
193 + }
194 +
195 +- /* set req_wanted bits not in req_mask from old_active */
196 ++ /* set req_wanted bits not in req_mask from old_wanted */
197 + bitmap_and(req_wanted, req_wanted, req_mask, NETDEV_FEATURE_COUNT);
198 +- bitmap_andnot(new_active, old_active, req_mask, NETDEV_FEATURE_COUNT);
199 +- bitmap_or(req_wanted, new_active, req_wanted, NETDEV_FEATURE_COUNT);
200 +- if (bitmap_equal(req_wanted, old_active, NETDEV_FEATURE_COUNT)) {
201 +- ret = 0;
202 +- goto out_rtnl;
203 ++ bitmap_andnot(new_wanted, old_wanted, req_mask, NETDEV_FEATURE_COUNT);
204 ++ bitmap_or(req_wanted, new_wanted, req_wanted, NETDEV_FEATURE_COUNT);
205 ++ if (!bitmap_equal(req_wanted, old_wanted, NETDEV_FEATURE_COUNT)) {
206 ++ dev->wanted_features &= ~dev->hw_features;
207 ++ dev->wanted_features |= ethnl_bitmap_to_features(req_wanted) & dev->hw_features;
208 ++ __netdev_update_features(dev);
209 + }
210 +-
211 +- dev->wanted_features = ethnl_bitmap_to_features(req_wanted);
212 +- __netdev_update_features(dev);
213 + ethnl_features_to_bitmap(new_active, dev->features);
214 + mod = !bitmap_equal(old_active, new_active, NETDEV_FEATURE_COUNT);
215 +
216 +diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
217 +index cc8049b100b24..134e923822750 100644
218 +--- a/net/ipv4/nexthop.c
219 ++++ b/net/ipv4/nexthop.c
220 +@@ -446,7 +446,7 @@ static int nh_check_attr_group(struct net *net, struct nlattr *tb[],
221 + unsigned int i, j;
222 + u8 nhg_fdb = 0;
223 +
224 +- if (len & (sizeof(struct nexthop_grp) - 1)) {
225 ++ if (!len || len & (sizeof(struct nexthop_grp) - 1)) {
226 + NL_SET_ERR_MSG(extack,
227 + "Invalid length for nexthop group attribute");
228 + return -EINVAL;
229 +@@ -1187,6 +1187,9 @@ static struct nexthop *nexthop_create_group(struct net *net,
230 + struct nexthop *nh;
231 + int i;
232 +
233 ++ if (WARN_ON(!num_nh))
234 ++ return ERR_PTR(-EINVAL);
235 ++
236 + nh = nexthop_alloc();
237 + if (!nh)
238 + return ERR_PTR(-ENOMEM);
239 +diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
240 +index a18c378ca5f46..d8f0102cec94a 100644
241 +--- a/net/ipv6/ip6_tunnel.c
242 ++++ b/net/ipv6/ip6_tunnel.c
243 +@@ -913,7 +913,15 @@ int ip6_tnl_rcv(struct ip6_tnl *t, struct sk_buff *skb,
244 + struct metadata_dst *tun_dst,
245 + bool log_ecn_err)
246 + {
247 +- return __ip6_tnl_rcv(t, skb, tpi, tun_dst, ip6ip6_dscp_ecn_decapsulate,
248 ++ int (*dscp_ecn_decapsulate)(const struct ip6_tnl *t,
249 ++ const struct ipv6hdr *ipv6h,
250 ++ struct sk_buff *skb);
251 ++
252 ++ dscp_ecn_decapsulate = ip6ip6_dscp_ecn_decapsulate;
253 ++ if (tpi->proto == htons(ETH_P_IP))
254 ++ dscp_ecn_decapsulate = ip4ip6_dscp_ecn_decapsulate;
255 ++
256 ++ return __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
257 + log_ecn_err);
258 + }
259 + EXPORT_SYMBOL(ip6_tnl_rcv);
260 +diff --git a/net/netlink/policy.c b/net/netlink/policy.c
261 +index f6491853c7971..2b3e26f7496f5 100644
262 +--- a/net/netlink/policy.c
263 ++++ b/net/netlink/policy.c
264 +@@ -51,6 +51,9 @@ static int add_policy(struct nl_policy_dump **statep,
265 + if (!state)
266 + return -ENOMEM;
267 +
268 ++ memset(&state->policies[state->n_alloc], 0,
269 ++ flex_array_size(state, policies, n_alloc - state->n_alloc));
270 ++
271 + state->policies[state->n_alloc].policy = policy;
272 + state->policies[state->n_alloc].maxtype = maxtype;
273 + state->n_alloc = n_alloc;
274 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
275 +index 300a104b9a0fb..85ab4559f0577 100644
276 +--- a/net/qrtr/qrtr.c
277 ++++ b/net/qrtr/qrtr.c
278 +@@ -692,23 +692,25 @@ static void qrtr_port_remove(struct qrtr_sock *ipc)
279 + */
280 + static int qrtr_port_assign(struct qrtr_sock *ipc, int *port)
281 + {
282 ++ u32 min_port;
283 + int rc;
284 +
285 + mutex_lock(&qrtr_port_lock);
286 + if (!*port) {
287 +- rc = idr_alloc(&qrtr_ports, ipc,
288 +- QRTR_MIN_EPH_SOCKET, QRTR_MAX_EPH_SOCKET + 1,
289 +- GFP_ATOMIC);
290 +- if (rc >= 0)
291 +- *port = rc;
292 ++ min_port = QRTR_MIN_EPH_SOCKET;
293 ++ rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, QRTR_MAX_EPH_SOCKET, GFP_ATOMIC);
294 ++ if (!rc)
295 ++ *port = min_port;
296 + } else if (*port < QRTR_MIN_EPH_SOCKET && !capable(CAP_NET_ADMIN)) {
297 + rc = -EACCES;
298 + } else if (*port == QRTR_PORT_CTRL) {
299 +- rc = idr_alloc(&qrtr_ports, ipc, 0, 1, GFP_ATOMIC);
300 ++ min_port = 0;
301 ++ rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, 0, GFP_ATOMIC);
302 + } else {
303 +- rc = idr_alloc(&qrtr_ports, ipc, *port, *port + 1, GFP_ATOMIC);
304 +- if (rc >= 0)
305 +- *port = rc;
306 ++ min_port = *port;
307 ++ rc = idr_alloc_u32(&qrtr_ports, ipc, &min_port, *port, GFP_ATOMIC);
308 ++ if (!rc)
309 ++ *port = min_port;
310 + }
311 + mutex_unlock(&qrtr_port_lock);
312 +
313 +diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
314 +index 6ed1652d1e265..41d8440deaf14 100644
315 +--- a/net/sched/act_ct.c
316 ++++ b/net/sched/act_ct.c
317 +@@ -704,7 +704,7 @@ static int tcf_ct_handle_fragments(struct net *net, struct sk_buff *skb,
318 + err = ip_defrag(net, skb, user);
319 + local_bh_enable();
320 + if (err && err != -EINPROGRESS)
321 +- goto out_free;
322 ++ return err;
323 +
324 + if (!err)
325 + *defrag = true;
326 +diff --git a/net/sctp/stream.c b/net/sctp/stream.c
327 +index bda2536dd740f..6dc95dcc0ff4f 100644
328 +--- a/net/sctp/stream.c
329 ++++ b/net/sctp/stream.c
330 +@@ -88,12 +88,13 @@ static int sctp_stream_alloc_out(struct sctp_stream *stream, __u16 outcnt,
331 + int ret;
332 +
333 + if (outcnt <= stream->outcnt)
334 +- return 0;
335 ++ goto out;
336 +
337 + ret = genradix_prealloc(&stream->out, outcnt, gfp);
338 + if (ret)
339 + return ret;
340 +
341 ++out:
342 + stream->outcnt = outcnt;
343 + return 0;
344 + }
345 +@@ -104,12 +105,13 @@ static int sctp_stream_alloc_in(struct sctp_stream *stream, __u16 incnt,
346 + int ret;
347 +
348 + if (incnt <= stream->incnt)
349 +- return 0;
350 ++ goto out;
351 +
352 + ret = genradix_prealloc(&stream->in, incnt, gfp);
353 + if (ret)
354 + return ret;
355 +
356 ++out:
357 + stream->incnt = incnt;
358 + return 0;
359 + }
360 +diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
361 +index e1f64f4ba2361..da9ba6d1679b7 100644
362 +--- a/net/smc/smc_diag.c
363 ++++ b/net/smc/smc_diag.c
364 +@@ -170,13 +170,15 @@ static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
365 + (req->diag_ext & (1 << (SMC_DIAG_DMBINFO - 1))) &&
366 + !list_empty(&smc->conn.lgr->list)) {
367 + struct smc_connection *conn = &smc->conn;
368 +- struct smcd_diag_dmbinfo dinfo = {
369 +- .linkid = *((u32 *)conn->lgr->id),
370 +- .peer_gid = conn->lgr->peer_gid,
371 +- .my_gid = conn->lgr->smcd->local_gid,
372 +- .token = conn->rmb_desc->token,
373 +- .peer_token = conn->peer_token
374 +- };
375 ++ struct smcd_diag_dmbinfo dinfo;
376 ++
377 ++ memset(&dinfo, 0, sizeof(dinfo));
378 ++
379 ++ dinfo.linkid = *((u32 *)conn->lgr->id);
380 ++ dinfo.peer_gid = conn->lgr->peer_gid;
381 ++ dinfo.my_gid = conn->lgr->smcd->local_gid;
382 ++ dinfo.token = conn->rmb_desc->token;
383 ++ dinfo.peer_token = conn->peer_token;
384 +
385 + if (nla_put(skb, SMC_DIAG_DMBINFO, sizeof(dinfo), &dinfo) < 0)
386 + goto errout;
387 +diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
388 +index c8c47fc726536..d6426b6cc9c5a 100644
389 +--- a/net/tipc/crypto.c
390 ++++ b/net/tipc/crypto.c
391 +@@ -757,10 +757,12 @@ static void tipc_aead_encrypt_done(struct crypto_async_request *base, int err)
392 + switch (err) {
393 + case 0:
394 + this_cpu_inc(tx->stats->stat[STAT_ASYNC_OK]);
395 ++ rcu_read_lock();
396 + if (likely(test_bit(0, &b->up)))
397 + b->media->send_msg(net, skb, b, &tx_ctx->dst);
398 + else
399 + kfree_skb(skb);
400 ++ rcu_read_unlock();
401 + break;
402 + case -EINPROGRESS:
403 + return;
404 +diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
405 +index 217516357ef26..90e3c70a91ad0 100644
406 +--- a/net/tipc/netlink_compat.c
407 ++++ b/net/tipc/netlink_compat.c
408 +@@ -275,8 +275,9 @@ err_out:
409 + static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
410 + struct tipc_nl_compat_msg *msg)
411 + {
412 +- int err;
413 ++ struct nlmsghdr *nlh;
414 + struct sk_buff *arg;
415 ++ int err;
416 +
417 + if (msg->req_type && (!msg->req_size ||
418 + !TLV_CHECK_TYPE(msg->req, msg->req_type)))
419 +@@ -305,6 +306,15 @@ static int tipc_nl_compat_dumpit(struct tipc_nl_compat_cmd_dump *cmd,
420 + return -ENOMEM;
421 + }
422 +
423 ++ nlh = nlmsg_put(arg, 0, 0, tipc_genl_family.id, 0, NLM_F_MULTI);
424 ++ if (!nlh) {
425 ++ kfree_skb(arg);
426 ++ kfree_skb(msg->rep);
427 ++ msg->rep = NULL;
428 ++ return -EMSGSIZE;
429 ++ }
430 ++ nlmsg_end(arg, nlh);
431 ++
432 + err = __tipc_nl_compat_dumpit(cmd, msg, arg);
433 + if (err) {
434 + kfree_skb(msg->rep);