1 |
commit: ddd5e25b41ab9b8766115387ed0d8631cab0752e |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 6 11:07:25 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jun 6 11:07:25 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=ddd5e25b |
7 |
|
8 |
Linux patch 4.9.317 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1316_linux-4.9.317.patch | 324 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 328 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 81ae8c32..19d0cefc 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1307,6 +1307,10 @@ Patch: 1315_linux-4.9.316.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.9.316 |
23 |
|
24 |
+Patch: 1316_linux-4.9.317.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.9.317 |
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/1316_linux-4.9.317.patch b/1316_linux-4.9.317.patch |
33 |
new file mode 100644 |
34 |
index 00000000..3c05645a |
35 |
--- /dev/null |
36 |
+++ b/1316_linux-4.9.317.patch |
37 |
@@ -0,0 +1,324 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 24a0bb5416ff5..cc1a47220975b 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 9 |
45 |
+-SUBLEVEL = 316 |
46 |
++SUBLEVEL = 317 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Roaring Lionus |
49 |
+ |
50 |
+diff --git a/block/bio.c b/block/bio.c |
51 |
+index 4c18a68913deb..db3723675f5a0 100644 |
52 |
+--- a/block/bio.c |
53 |
++++ b/block/bio.c |
54 |
+@@ -1538,7 +1538,7 @@ struct bio *bio_copy_kern(struct request_queue *q, void *data, unsigned int len, |
55 |
+ if (bytes > len) |
56 |
+ bytes = len; |
57 |
+ |
58 |
+- page = alloc_page(q->bounce_gfp | gfp_mask); |
59 |
++ page = alloc_page(q->bounce_gfp | __GFP_ZERO | gfp_mask); |
60 |
+ if (!page) |
61 |
+ goto cleanup; |
62 |
+ |
63 |
+diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c |
64 |
+index 0fad6cf37bab4..b0f546f4b15ca 100644 |
65 |
+--- a/drivers/char/tpm/tpm_ibmvtpm.c |
66 |
++++ b/drivers/char/tpm/tpm_ibmvtpm.c |
67 |
+@@ -653,6 +653,7 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev, |
68 |
+ if (!wait_event_timeout(ibmvtpm->crq_queue.wq, |
69 |
+ ibmvtpm->rtce_buf != NULL, |
70 |
+ HZ)) { |
71 |
++ rc = -ENODEV; |
72 |
+ dev_err(dev, "CRQ response timed out\n"); |
73 |
+ goto init_irq_cleanup; |
74 |
+ } |
75 |
+diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c |
76 |
+index 202c00b17df2d..dcae0ec973a91 100644 |
77 |
+--- a/drivers/gpu/drm/i915/intel_pm.c |
78 |
++++ b/drivers/gpu/drm/i915/intel_pm.c |
79 |
+@@ -2083,7 +2083,7 @@ hsw_compute_linetime_wm(const struct intel_crtc_state *cstate) |
80 |
+ PIPE_WM_LINETIME_TIME(linetime); |
81 |
+ } |
82 |
+ |
83 |
+-static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[8]) |
84 |
++static void intel_read_wm_latency(struct drm_device *dev, uint16_t wm[]) |
85 |
+ { |
86 |
+ struct drm_i915_private *dev_priv = to_i915(dev); |
87 |
+ |
88 |
+diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c |
89 |
+index bba5b429f69c9..3298483bb9b41 100644 |
90 |
+--- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c |
91 |
++++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c |
92 |
+@@ -208,6 +208,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev, |
93 |
+ i2c->adap.bus_recovery_info = &octeon_i2c_recovery_info; |
94 |
+ i2c->adap.dev.parent = dev; |
95 |
+ i2c->adap.dev.of_node = pdev->dev.of_node; |
96 |
++ i2c->adap.dev.fwnode = dev->fwnode; |
97 |
+ snprintf(i2c->adap.name, sizeof(i2c->adap.name), |
98 |
+ "Cavium ThunderX i2c adapter at %s", dev_name(dev)); |
99 |
+ i2c_set_adapdata(&i2c->adap, i2c); |
100 |
+diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c |
101 |
+index 0aedd0ebccec1..13a5fcca28330 100644 |
102 |
+--- a/drivers/md/dm-crypt.c |
103 |
++++ b/drivers/md/dm-crypt.c |
104 |
+@@ -1943,6 +1943,11 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) |
105 |
+ return DM_MAPIO_SUBMITTED; |
106 |
+ } |
107 |
+ |
108 |
++static char hex2asc(unsigned char c) |
109 |
++{ |
110 |
++ return c + '0' + ((unsigned)(9 - c) >> 4 & 0x27); |
111 |
++} |
112 |
++ |
113 |
+ static void crypt_status(struct dm_target *ti, status_type_t type, |
114 |
+ unsigned status_flags, char *result, unsigned maxlen) |
115 |
+ { |
116 |
+@@ -1958,10 +1963,12 @@ static void crypt_status(struct dm_target *ti, status_type_t type, |
117 |
+ case STATUSTYPE_TABLE: |
118 |
+ DMEMIT("%s ", cc->cipher_string); |
119 |
+ |
120 |
+- if (cc->key_size > 0) |
121 |
+- for (i = 0; i < cc->key_size; i++) |
122 |
+- DMEMIT("%02x", cc->key[i]); |
123 |
+- else |
124 |
++ if (cc->key_size > 0) { |
125 |
++ for (i = 0; i < cc->key_size; i++) { |
126 |
++ DMEMIT("%c%c", hex2asc(cc->key[i] >> 4), |
127 |
++ hex2asc(cc->key[i] & 0xf)); |
128 |
++ } |
129 |
++ } else |
130 |
+ DMEMIT("-"); |
131 |
+ |
132 |
+ DMEMIT(" %llu %s %llu", (unsigned long long)cc->iv_offset, |
133 |
+diff --git a/drivers/md/dm-stats.c b/drivers/md/dm-stats.c |
134 |
+index 0250e7e521abc..fdd4a840b30fa 100644 |
135 |
+--- a/drivers/md/dm-stats.c |
136 |
++++ b/drivers/md/dm-stats.c |
137 |
+@@ -228,6 +228,7 @@ void dm_stats_cleanup(struct dm_stats *stats) |
138 |
+ atomic_read(&shared->in_flight[READ]), |
139 |
+ atomic_read(&shared->in_flight[WRITE])); |
140 |
+ } |
141 |
++ cond_resched(); |
142 |
+ } |
143 |
+ dm_stat_free(&s->rcu_head); |
144 |
+ } |
145 |
+@@ -316,6 +317,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end, |
146 |
+ for (ni = 0; ni < n_entries; ni++) { |
147 |
+ atomic_set(&s->stat_shared[ni].in_flight[READ], 0); |
148 |
+ atomic_set(&s->stat_shared[ni].in_flight[WRITE], 0); |
149 |
++ cond_resched(); |
150 |
+ } |
151 |
+ |
152 |
+ if (s->n_histogram_entries) { |
153 |
+@@ -328,6 +330,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end, |
154 |
+ for (ni = 0; ni < n_entries; ni++) { |
155 |
+ s->stat_shared[ni].tmp.histogram = hi; |
156 |
+ hi += s->n_histogram_entries + 1; |
157 |
++ cond_resched(); |
158 |
+ } |
159 |
+ } |
160 |
+ |
161 |
+@@ -348,6 +351,7 @@ static int dm_stats_create(struct dm_stats *stats, sector_t start, sector_t end, |
162 |
+ for (ni = 0; ni < n_entries; ni++) { |
163 |
+ p[ni].histogram = hi; |
164 |
+ hi += s->n_histogram_entries + 1; |
165 |
++ cond_resched(); |
166 |
+ } |
167 |
+ } |
168 |
+ } |
169 |
+@@ -477,6 +481,7 @@ static int dm_stats_list(struct dm_stats *stats, const char *program, |
170 |
+ } |
171 |
+ DMEMIT("\n"); |
172 |
+ } |
173 |
++ cond_resched(); |
174 |
+ } |
175 |
+ mutex_unlock(&stats->mutex); |
176 |
+ |
177 |
+@@ -753,6 +758,7 @@ static void __dm_stat_clear(struct dm_stat *s, size_t idx_start, size_t idx_end, |
178 |
+ local_irq_enable(); |
179 |
+ } |
180 |
+ } |
181 |
++ cond_resched(); |
182 |
+ } |
183 |
+ } |
184 |
+ |
185 |
+@@ -868,6 +874,8 @@ static int dm_stats_print(struct dm_stats *stats, int id, |
186 |
+ |
187 |
+ if (unlikely(sz + 1 >= maxlen)) |
188 |
+ goto buffer_overflow; |
189 |
++ |
190 |
++ cond_resched(); |
191 |
+ } |
192 |
+ |
193 |
+ if (clear) |
194 |
+diff --git a/drivers/md/dm-verity-target.c b/drivers/md/dm-verity-target.c |
195 |
+index 727f9e5719555..bd9d9f183e4b9 100644 |
196 |
+--- a/drivers/md/dm-verity-target.c |
197 |
++++ b/drivers/md/dm-verity-target.c |
198 |
+@@ -1056,6 +1056,7 @@ bad: |
199 |
+ |
200 |
+ static struct target_type verity_target = { |
201 |
+ .name = "verity", |
202 |
++ .features = DM_TARGET_IMMUTABLE, |
203 |
+ .version = {1, 3, 0}, |
204 |
+ .module = THIS_MODULE, |
205 |
+ .ctr = verity_ctr, |
206 |
+diff --git a/fs/exec.c b/fs/exec.c |
207 |
+index 482a8b4f41a5b..19f8b075d3b6b 100644 |
208 |
+--- a/fs/exec.c |
209 |
++++ b/fs/exec.c |
210 |
+@@ -1758,6 +1758,9 @@ static int do_execveat_common(int fd, struct filename *filename, |
211 |
+ goto out_unmark; |
212 |
+ |
213 |
+ bprm->argc = count(argv, MAX_ARG_STRINGS); |
214 |
++ if (bprm->argc == 0) |
215 |
++ pr_warn_once("process '%s' launched '%s' with NULL argv: empty string added\n", |
216 |
++ current->comm, bprm->filename); |
217 |
+ if ((retval = bprm->argc) < 0) |
218 |
+ goto out; |
219 |
+ |
220 |
+@@ -1782,6 +1785,20 @@ static int do_execveat_common(int fd, struct filename *filename, |
221 |
+ if (retval < 0) |
222 |
+ goto out; |
223 |
+ |
224 |
++ /* |
225 |
++ * When argv is empty, add an empty string ("") as argv[0] to |
226 |
++ * ensure confused userspace programs that start processing |
227 |
++ * from argv[1] won't end up walking envp. See also |
228 |
++ * bprm_stack_limits(). |
229 |
++ */ |
230 |
++ if (bprm->argc == 0) { |
231 |
++ const char *argv[] = { "", NULL }; |
232 |
++ retval = copy_strings_kernel(1, argv, bprm); |
233 |
++ if (retval < 0) |
234 |
++ goto out; |
235 |
++ bprm->argc = 1; |
236 |
++ } |
237 |
++ |
238 |
+ retval = exec_binprm(bprm); |
239 |
+ if (retval < 0) |
240 |
+ goto out; |
241 |
+diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c |
242 |
+index d9381ca0ac479..b13649c63653f 100644 |
243 |
+--- a/fs/nfsd/nfs4state.c |
244 |
++++ b/fs/nfsd/nfs4state.c |
245 |
+@@ -6342,16 +6342,12 @@ nfsd4_release_lockowner(struct svc_rqst *rqstp, |
246 |
+ if (sop->so_is_open_owner || !same_owner_str(sop, owner)) |
247 |
+ continue; |
248 |
+ |
249 |
+- /* see if there are still any locks associated with it */ |
250 |
+- lo = lockowner(sop); |
251 |
+- list_for_each_entry(stp, &sop->so_stateids, st_perstateowner) { |
252 |
+- if (check_for_locks(stp->st_stid.sc_file, lo)) { |
253 |
+- status = nfserr_locks_held; |
254 |
+- spin_unlock(&clp->cl_lock); |
255 |
+- return status; |
256 |
+- } |
257 |
++ if (atomic_read(&sop->so_count) != 1) { |
258 |
++ spin_unlock(&clp->cl_lock); |
259 |
++ return nfserr_locks_held; |
260 |
+ } |
261 |
+ |
262 |
++ lo = lockowner(sop); |
263 |
+ nfs4_get_stateowner(sop); |
264 |
+ break; |
265 |
+ } |
266 |
+diff --git a/lib/assoc_array.c b/lib/assoc_array.c |
267 |
+index 3b46c5433b7ac..70ef5fdd11c79 100644 |
268 |
+--- a/lib/assoc_array.c |
269 |
++++ b/lib/assoc_array.c |
270 |
+@@ -1478,6 +1478,7 @@ int assoc_array_gc(struct assoc_array *array, |
271 |
+ struct assoc_array_ptr *cursor, *ptr; |
272 |
+ struct assoc_array_ptr *new_root, *new_parent, **new_ptr_pp; |
273 |
+ unsigned long nr_leaves_on_tree; |
274 |
++ bool retained; |
275 |
+ int keylen, slot, nr_free, next_slot, i; |
276 |
+ |
277 |
+ pr_devel("-->%s()\n", __func__); |
278 |
+@@ -1554,6 +1555,7 @@ continue_node: |
279 |
+ goto descend; |
280 |
+ } |
281 |
+ |
282 |
++retry_compress: |
283 |
+ pr_devel("-- compress node %p --\n", new_n); |
284 |
+ |
285 |
+ /* Count up the number of empty slots in this node and work out the |
286 |
+@@ -1571,6 +1573,7 @@ continue_node: |
287 |
+ pr_devel("free=%d, leaves=%lu\n", nr_free, new_n->nr_leaves_on_branch); |
288 |
+ |
289 |
+ /* See what we can fold in */ |
290 |
++ retained = false; |
291 |
+ next_slot = 0; |
292 |
+ for (slot = 0; slot < ASSOC_ARRAY_FAN_OUT; slot++) { |
293 |
+ struct assoc_array_shortcut *s; |
294 |
+@@ -1620,9 +1623,14 @@ continue_node: |
295 |
+ pr_devel("[%d] retain node %lu/%d [nx %d]\n", |
296 |
+ slot, child->nr_leaves_on_branch, nr_free + 1, |
297 |
+ next_slot); |
298 |
++ retained = true; |
299 |
+ } |
300 |
+ } |
301 |
+ |
302 |
++ if (retained && new_n->nr_leaves_on_branch <= ASSOC_ARRAY_FAN_OUT) { |
303 |
++ pr_devel("internal nodes remain despite enough space, retrying\n"); |
304 |
++ goto retry_compress; |
305 |
++ } |
306 |
+ pr_devel("after: %lu\n", new_n->nr_leaves_on_branch); |
307 |
+ |
308 |
+ nr_leaves_on_tree = new_n->nr_leaves_on_branch; |
309 |
+diff --git a/net/core/filter.c b/net/core/filter.c |
310 |
+index 94bf897485db0..799ac1fb46f2d 100644 |
311 |
+--- a/net/core/filter.c |
312 |
++++ b/net/core/filter.c |
313 |
+@@ -1388,7 +1388,7 @@ BPF_CALL_5(bpf_skb_store_bytes, struct sk_buff *, skb, u32, offset, |
314 |
+ |
315 |
+ if (unlikely(flags & ~(BPF_F_RECOMPUTE_CSUM | BPF_F_INVALIDATE_HASH))) |
316 |
+ return -EINVAL; |
317 |
+- if (unlikely(offset > 0xffff)) |
318 |
++ if (unlikely(offset > INT_MAX)) |
319 |
+ return -EFAULT; |
320 |
+ if (unlikely(bpf_try_make_writable(skb, offset + len))) |
321 |
+ return -EFAULT; |
322 |
+@@ -1423,7 +1423,7 @@ BPF_CALL_4(bpf_skb_load_bytes, const struct sk_buff *, skb, u32, offset, |
323 |
+ { |
324 |
+ void *ptr; |
325 |
+ |
326 |
+- if (unlikely(offset > 0xffff)) |
327 |
++ if (unlikely(offset > INT_MAX)) |
328 |
+ goto err_clear; |
329 |
+ |
330 |
+ ptr = skb_header_pointer(skb, offset, len, to); |
331 |
+diff --git a/net/key/af_key.c b/net/key/af_key.c |
332 |
+index 776f94ecbfe6d..d5dc614af2f91 100644 |
333 |
+--- a/net/key/af_key.c |
334 |
++++ b/net/key/af_key.c |
335 |
+@@ -2935,7 +2935,7 @@ static int count_ah_combs(const struct xfrm_tmpl *t) |
336 |
+ break; |
337 |
+ if (!aalg->pfkey_supported) |
338 |
+ continue; |
339 |
+- if (aalg_tmpl_set(t, aalg)) |
340 |
++ if (aalg_tmpl_set(t, aalg) && aalg->available) |
341 |
+ sz += sizeof(struct sadb_comb); |
342 |
+ } |
343 |
+ return sz + sizeof(struct sadb_prop); |
344 |
+@@ -2953,7 +2953,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t) |
345 |
+ if (!ealg->pfkey_supported) |
346 |
+ continue; |
347 |
+ |
348 |
+- if (!(ealg_tmpl_set(t, ealg))) |
349 |
++ if (!(ealg_tmpl_set(t, ealg) && ealg->available)) |
350 |
+ continue; |
351 |
+ |
352 |
+ for (k = 1; ; k++) { |
353 |
+@@ -2964,7 +2964,7 @@ static int count_esp_combs(const struct xfrm_tmpl *t) |
354 |
+ if (!aalg->pfkey_supported) |
355 |
+ continue; |
356 |
+ |
357 |
+- if (aalg_tmpl_set(t, aalg)) |
358 |
++ if (aalg_tmpl_set(t, aalg) && aalg->available) |
359 |
+ sz += sizeof(struct sadb_comb); |
360 |
+ } |
361 |
+ } |