Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.4 commit in: /
Date: Thu, 07 Sep 2017 22:42:05
Message-Id: 1504824107.6ccb304d9415004ac7a86a17614c9258510cff2b.mpagano@gentoo
1 commit: 6ccb304d9415004ac7a86a17614c9258510cff2b
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Sep 7 22:41:47 2017 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 7 22:41:47 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6ccb304d
7
8 Linux patch 4.4.87
9
10 0000_README | 4 +
11 1086_linux-4.4.87.patch | 408 ++++++++++++++++++++++++++++++++++++++++++++++++
12 2 files changed, 412 insertions(+)
13
14 diff --git a/0000_README b/0000_README
15 index 9eb8ca5..99f6582 100644
16 --- a/0000_README
17 +++ b/0000_README
18 @@ -387,6 +387,10 @@ Patch: 1085_linux-4.4.86.patch
19 From: http://www.kernel.org
20 Desc: Linux 4.4.86
21
22 +Patch: 1086_linux-4.4.87.patch
23 +From: http://www.kernel.org
24 +Desc: Linux 4.4.87
25 +
26 Patch: 1500_XATTR_USER_PREFIX.patch
27 From: https://bugs.gentoo.org/show_bug.cgi?id=470644
28 Desc: Support for namespace user.pax.* on tmpfs.
29
30 diff --git a/1086_linux-4.4.87.patch b/1086_linux-4.4.87.patch
31 new file mode 100644
32 index 0000000..5292853
33 --- /dev/null
34 +++ b/1086_linux-4.4.87.patch
35 @@ -0,0 +1,408 @@
36 +diff --git a/Makefile b/Makefile
37 +index 1207bf6a0e7a..f6838187b568 100644
38 +--- a/Makefile
39 ++++ b/Makefile
40 +@@ -1,6 +1,6 @@
41 + VERSION = 4
42 + PATCHLEVEL = 4
43 +-SUBLEVEL = 86
44 ++SUBLEVEL = 87
45 + EXTRAVERSION =
46 + NAME = Blurry Fish Butt
47 +
48 +diff --git a/arch/alpha/include/asm/types.h b/arch/alpha/include/asm/types.h
49 +index 4cb4b6d3452c..0bc66e1d3a7e 100644
50 +--- a/arch/alpha/include/asm/types.h
51 ++++ b/arch/alpha/include/asm/types.h
52 +@@ -1,6 +1,6 @@
53 + #ifndef _ALPHA_TYPES_H
54 + #define _ALPHA_TYPES_H
55 +
56 +-#include <asm-generic/int-ll64.h>
57 ++#include <uapi/asm/types.h>
58 +
59 + #endif /* _ALPHA_TYPES_H */
60 +diff --git a/arch/alpha/include/uapi/asm/types.h b/arch/alpha/include/uapi/asm/types.h
61 +index 9fd3cd459777..8d1024d7be05 100644
62 +--- a/arch/alpha/include/uapi/asm/types.h
63 ++++ b/arch/alpha/include/uapi/asm/types.h
64 +@@ -9,8 +9,18 @@
65 + * need to be careful to avoid a name clashes.
66 + */
67 +
68 +-#ifndef __KERNEL__
69 ++/*
70 ++ * This is here because we used to use l64 for alpha
71 ++ * and we don't want to impact user mode with our change to ll64
72 ++ * in the kernel.
73 ++ *
74 ++ * However, some user programs are fine with this. They can
75 ++ * flag __SANE_USERSPACE_TYPES__ to get int-ll64.h here.
76 ++ */
77 ++#if !defined(__SANE_USERSPACE_TYPES__) && !defined(__KERNEL__)
78 + #include <asm-generic/int-l64.h>
79 ++#else
80 ++#include <asm-generic/int-ll64.h>
81 + #endif
82 +
83 + #endif /* _UAPI_ALPHA_TYPES_H */
84 +diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
85 +index ba079e279b58..e8835d4e173c 100644
86 +--- a/arch/arm/kvm/mmu.c
87 ++++ b/arch/arm/kvm/mmu.c
88 +@@ -824,24 +824,25 @@ void stage2_unmap_vm(struct kvm *kvm)
89 + * Walks the level-1 page table pointed to by kvm->arch.pgd and frees all
90 + * underlying level-2 and level-3 tables before freeing the actual level-1 table
91 + * and setting the struct pointer to NULL.
92 +- *
93 +- * Note we don't need locking here as this is only called when the VM is
94 +- * destroyed, which can only be done once.
95 + */
96 + void kvm_free_stage2_pgd(struct kvm *kvm)
97 + {
98 +- if (kvm->arch.pgd == NULL)
99 +- return;
100 ++ void *pgd = NULL;
101 ++ void *hwpgd = NULL;
102 +
103 + spin_lock(&kvm->mmu_lock);
104 +- unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
105 ++ if (kvm->arch.pgd) {
106 ++ unmap_stage2_range(kvm, 0, KVM_PHYS_SIZE);
107 ++ pgd = READ_ONCE(kvm->arch.pgd);
108 ++ hwpgd = kvm_get_hwpgd(kvm);
109 ++ kvm->arch.pgd = NULL;
110 ++ }
111 + spin_unlock(&kvm->mmu_lock);
112 +
113 +- kvm_free_hwpgd(kvm_get_hwpgd(kvm));
114 +- if (KVM_PREALLOC_LEVEL > 0)
115 +- kfree(kvm->arch.pgd);
116 +-
117 +- kvm->arch.pgd = NULL;
118 ++ if (hwpgd)
119 ++ kvm_free_hwpgd(hwpgd);
120 ++ if (KVM_PREALLOC_LEVEL > 0 && pgd)
121 ++ kfree(pgd);
122 + }
123 +
124 + static pud_t *stage2_get_pud(struct kvm *kvm, struct kvm_mmu_memory_cache *cache,
125 +diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
126 +index f5e9f9310b48..b3b0004ea8ac 100644
127 +--- a/crypto/algif_skcipher.c
128 ++++ b/crypto/algif_skcipher.c
129 +@@ -86,8 +86,13 @@ static void skcipher_free_async_sgls(struct skcipher_async_req *sreq)
130 + }
131 + sgl = sreq->tsg;
132 + n = sg_nents(sgl);
133 +- for_each_sg(sgl, sg, n, i)
134 +- put_page(sg_page(sg));
135 ++ for_each_sg(sgl, sg, n, i) {
136 ++ struct page *page = sg_page(sg);
137 ++
138 ++ /* some SGs may not have a page mapped */
139 ++ if (page && atomic_read(&page->_count))
140 ++ put_page(page);
141 ++ }
142 +
143 + kfree(sreq->tsg);
144 + }
145 +diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
146 +index 025c429050c0..5d8dfe027b30 100644
147 +--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
148 ++++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
149 +@@ -612,7 +612,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
150 + } else {
151 + pr_err("Failed to fill pool (%p)\n", pool);
152 + /* If we have any pages left put them to the pool. */
153 +- list_for_each_entry(p, &pool->list, lru) {
154 ++ list_for_each_entry(p, &new_pages, lru) {
155 + ++cpages;
156 + }
157 + list_splice(&new_pages, &pool->list);
158 +diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
159 +index 7ba795b24e75..639d1a9c8793 100644
160 +--- a/drivers/i2c/busses/i2c-ismt.c
161 ++++ b/drivers/i2c/busses/i2c-ismt.c
162 +@@ -339,8 +339,10 @@ static int ismt_process_desc(const struct ismt_desc *desc,
163 + break;
164 + case I2C_SMBUS_BLOCK_DATA:
165 + case I2C_SMBUS_I2C_BLOCK_DATA:
166 +- memcpy(&data->block[1], dma_buffer, desc->rxbytes);
167 +- data->block[0] = desc->rxbytes;
168 ++ if (desc->rxbytes != dma_buffer[0] + 1)
169 ++ return -EMSGSIZE;
170 ++
171 ++ memcpy(data->block, dma_buffer, desc->rxbytes);
172 + break;
173 + }
174 + return 0;
175 +diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
176 +index 9e17ef27a183..6f1dbd52ec91 100644
177 +--- a/drivers/irqchip/irq-mips-gic.c
178 ++++ b/drivers/irqchip/irq-mips-gic.c
179 +@@ -915,8 +915,11 @@ static int __init gic_of_init(struct device_node *node,
180 + gic_len = resource_size(&res);
181 + }
182 +
183 +- if (mips_cm_present())
184 ++ if (mips_cm_present()) {
185 + write_gcr_gic_base(gic_base | CM_GCR_GIC_BASE_GICEN_MSK);
186 ++ /* Ensure GIC region is enabled before trying to access it */
187 ++ __sync();
188 ++ }
189 + gic_present = true;
190 +
191 + __gic_init(gic_base, gic_len, cpu_vec, 0, node);
192 +diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
193 +index cd4777954f87..9bee3f11898a 100644
194 +--- a/drivers/net/wireless/ti/wl1251/main.c
195 ++++ b/drivers/net/wireless/ti/wl1251/main.c
196 +@@ -1567,6 +1567,7 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
197 +
198 + wl->state = WL1251_STATE_OFF;
199 + mutex_init(&wl->mutex);
200 ++ spin_lock_init(&wl->wl_lock);
201 +
202 + wl->tx_mgmt_frm_rate = DEFAULT_HW_GEN_TX_RATE;
203 + wl->tx_mgmt_frm_mod = DEFAULT_HW_GEN_MODULATION_TYPE;
204 +diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
205 +index c6a1ec110c01..22bae2b434e2 100644
206 +--- a/fs/ceph/addr.c
207 ++++ b/fs/ceph/addr.c
208 +@@ -189,7 +189,7 @@ static int ceph_releasepage(struct page *page, gfp_t g)
209 + /*
210 + * read a single page, without unlocking it.
211 + */
212 +-static int readpage_nounlock(struct file *filp, struct page *page)
213 ++static int ceph_do_readpage(struct file *filp, struct page *page)
214 + {
215 + struct inode *inode = file_inode(filp);
216 + struct ceph_inode_info *ci = ceph_inode(inode);
217 +@@ -219,7 +219,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
218 +
219 + err = ceph_readpage_from_fscache(inode, page);
220 + if (err == 0)
221 +- goto out;
222 ++ return -EINPROGRESS;
223 +
224 + dout("readpage inode %p file %p page %p index %lu\n",
225 + inode, filp, page, page->index);
226 +@@ -249,8 +249,11 @@ out:
227 +
228 + static int ceph_readpage(struct file *filp, struct page *page)
229 + {
230 +- int r = readpage_nounlock(filp, page);
231 +- unlock_page(page);
232 ++ int r = ceph_do_readpage(filp, page);
233 ++ if (r != -EINPROGRESS)
234 ++ unlock_page(page);
235 ++ else
236 ++ r = 0;
237 + return r;
238 + }
239 +
240 +@@ -1094,7 +1097,7 @@ retry_locked:
241 + goto retry_locked;
242 + r = writepage_nounlock(page, NULL);
243 + if (r < 0)
244 +- goto fail_nosnap;
245 ++ goto fail_unlock;
246 + goto retry_locked;
247 + }
248 +
249 +@@ -1122,11 +1125,14 @@ retry_locked:
250 + }
251 +
252 + /* we need to read it. */
253 +- r = readpage_nounlock(file, page);
254 +- if (r < 0)
255 +- goto fail_nosnap;
256 ++ r = ceph_do_readpage(file, page);
257 ++ if (r < 0) {
258 ++ if (r == -EINPROGRESS)
259 ++ return -EAGAIN;
260 ++ goto fail_unlock;
261 ++ }
262 + goto retry_locked;
263 +-fail_nosnap:
264 ++fail_unlock:
265 + unlock_page(page);
266 + return r;
267 + }
268 +diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c
269 +index a4766ded1ba7..ff1cfd7b1083 100644
270 +--- a/fs/ceph/cache.c
271 ++++ b/fs/ceph/cache.c
272 +@@ -224,13 +224,7 @@ void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci)
273 + fscache_relinquish_cookie(cookie, 0);
274 + }
275 +
276 +-static void ceph_vfs_readpage_complete(struct page *page, void *data, int error)
277 +-{
278 +- if (!error)
279 +- SetPageUptodate(page);
280 +-}
281 +-
282 +-static void ceph_vfs_readpage_complete_unlock(struct page *page, void *data, int error)
283 ++static void ceph_readpage_from_fscache_complete(struct page *page, void *data, int error)
284 + {
285 + if (!error)
286 + SetPageUptodate(page);
287 +@@ -259,7 +253,7 @@ int ceph_readpage_from_fscache(struct inode *inode, struct page *page)
288 + return -ENOBUFS;
289 +
290 + ret = fscache_read_or_alloc_page(ci->fscache, page,
291 +- ceph_vfs_readpage_complete, NULL,
292 ++ ceph_readpage_from_fscache_complete, NULL,
293 + GFP_KERNEL);
294 +
295 + switch (ret) {
296 +@@ -288,7 +282,7 @@ int ceph_readpages_from_fscache(struct inode *inode,
297 + return -ENOBUFS;
298 +
299 + ret = fscache_read_or_alloc_pages(ci->fscache, mapping, pages, nr_pages,
300 +- ceph_vfs_readpage_complete_unlock,
301 ++ ceph_readpage_from_fscache_complete,
302 + NULL, mapping_gfp_mask(mapping));
303 +
304 + switch (ret) {
305 +diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
306 +index fa8df3fef6fc..297e05c9e2b0 100644
307 +--- a/fs/cifs/dir.c
308 ++++ b/fs/cifs/dir.c
309 +@@ -194,7 +194,7 @@ check_name(struct dentry *direntry, struct cifs_tcon *tcon)
310 + int i;
311 +
312 + if (unlikely(direntry->d_name.len >
313 +- tcon->fsAttrInfo.MaxPathNameComponentLength))
314 ++ le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength)))
315 + return -ENAMETOOLONG;
316 +
317 + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
318 +diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
319 +index b8f553b32dda..aacb15bd56fe 100644
320 +--- a/fs/cifs/smb2pdu.h
321 ++++ b/fs/cifs/smb2pdu.h
322 +@@ -82,8 +82,8 @@
323 +
324 + #define NUMBER_OF_SMB2_COMMANDS 0x0013
325 +
326 +-/* BB FIXME - analyze following length BB */
327 +-#define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */
328 ++/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
329 ++#define MAX_SMB2_HDR_SIZE 0x00b0
330 +
331 + #define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe)
332 +
333 +diff --git a/fs/eventpoll.c b/fs/eventpoll.c
334 +index 1e009cad8d5c..1b08556776ce 100644
335 +--- a/fs/eventpoll.c
336 ++++ b/fs/eventpoll.c
337 +@@ -518,8 +518,13 @@ static void ep_remove_wait_queue(struct eppoll_entry *pwq)
338 + wait_queue_head_t *whead;
339 +
340 + rcu_read_lock();
341 +- /* If it is cleared by POLLFREE, it should be rcu-safe */
342 +- whead = rcu_dereference(pwq->whead);
343 ++ /*
344 ++ * If it is cleared by POLLFREE, it should be rcu-safe.
345 ++ * If we read NULL we need a barrier paired with
346 ++ * smp_store_release() in ep_poll_callback(), otherwise
347 ++ * we rely on whead->lock.
348 ++ */
349 ++ whead = smp_load_acquire(&pwq->whead);
350 + if (whead)
351 + remove_wait_queue(whead, &pwq->wait);
352 + rcu_read_unlock();
353 +@@ -1003,17 +1008,6 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
354 + struct epitem *epi = ep_item_from_wait(wait);
355 + struct eventpoll *ep = epi->ep;
356 +
357 +- if ((unsigned long)key & POLLFREE) {
358 +- ep_pwq_from_wait(wait)->whead = NULL;
359 +- /*
360 +- * whead = NULL above can race with ep_remove_wait_queue()
361 +- * which can do another remove_wait_queue() after us, so we
362 +- * can't use __remove_wait_queue(). whead->lock is held by
363 +- * the caller.
364 +- */
365 +- list_del_init(&wait->task_list);
366 +- }
367 +-
368 + spin_lock_irqsave(&ep->lock, flags);
369 +
370 + /*
371 +@@ -1078,6 +1072,23 @@ out_unlock:
372 + if (pwake)
373 + ep_poll_safewake(&ep->poll_wait);
374 +
375 ++
376 ++ if ((unsigned long)key & POLLFREE) {
377 ++ /*
378 ++ * If we race with ep_remove_wait_queue() it can miss
379 ++ * ->whead = NULL and do another remove_wait_queue() after
380 ++ * us, so we can't use __remove_wait_queue().
381 ++ */
382 ++ list_del_init(&wait->task_list);
383 ++ /*
384 ++ * ->whead != NULL protects us from the race with ep_free()
385 ++ * or ep_remove(), ep_remove_wait_queue() takes whead->lock
386 ++ * held by the caller. Once we nullify it, nothing protects
387 ++ * ep/epi or even wait.
388 ++ */
389 ++ smp_store_release(&ep_pwq_from_wait(wait)->whead, NULL);
390 ++ }
391 ++
392 + return 1;
393 + }
394 +
395 +diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
396 +index fc824e2828f3..5d2add1a6c96 100644
397 +--- a/include/asm-generic/topology.h
398 ++++ b/include/asm-generic/topology.h
399 +@@ -48,7 +48,11 @@
400 + #define parent_node(node) ((void)(node),0)
401 + #endif
402 + #ifndef cpumask_of_node
403 +-#define cpumask_of_node(node) ((void)node, cpu_online_mask)
404 ++ #ifdef CONFIG_NEED_MULTIPLE_NODES
405 ++ #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)
406 ++ #else
407 ++ #define cpumask_of_node(node) ((void)node, cpu_online_mask)
408 ++ #endif
409 + #endif
410 + #ifndef pcibus_to_node
411 + #define pcibus_to_node(bus) ((void)(bus), -1)
412 +diff --git a/kernel/cpuset.c b/kernel/cpuset.c
413 +index 8ccd66a97c8b..2924b6faa469 100644
414 +--- a/kernel/cpuset.c
415 ++++ b/kernel/cpuset.c
416 +@@ -1910,6 +1910,7 @@ static struct cftype files[] = {
417 + {
418 + .name = "memory_pressure",
419 + .read_u64 = cpuset_read_u64,
420 ++ .private = FILE_MEMORY_PRESSURE,
421 + },
422 +
423 + {
424 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
425 +index 77055a362041..0e01250f2072 100644
426 +--- a/net/xfrm/xfrm_policy.c
427 ++++ b/net/xfrm/xfrm_policy.c
428 +@@ -3275,9 +3275,15 @@ int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
429 + struct xfrm_state *x_new[XFRM_MAX_DEPTH];
430 + struct xfrm_migrate *mp;
431 +
432 ++ /* Stage 0 - sanity checks */
433 + if ((err = xfrm_migrate_check(m, num_migrate)) < 0)
434 + goto out;
435 +
436 ++ if (dir >= XFRM_POLICY_MAX) {
437 ++ err = -EINVAL;
438 ++ goto out;
439 ++ }
440 ++
441 + /* Stage 1 - find policy */
442 + if ((pol = xfrm_migrate_policy_find(sel, dir, type, net)) == NULL) {
443 + err = -ENOENT;