Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.9 commit in: /
Date: Sun, 26 Sep 2021 14:15:44
Message-Id: 1632665729.5eb31205911054a7ae7164c69c15ae3d55887cc1.mpagano@gentoo
1 commit: 5eb31205911054a7ae7164c69c15ae3d55887cc1
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 26 14:15:29 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 26 14:15:29 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=5eb31205
7
8 Linux patch 4.9.284
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1283_linux-4.9.284.patch | 734 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 738 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 046d9e8..9577890 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1175,6 +1175,10 @@ Patch: 1282_linux-4.9.283.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.9.283
23
24 +Patch: 1283_linux-4.9.284.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 4.9.284
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/1283_linux-4.9.284.patch b/1283_linux-4.9.284.patch
33 new file mode 100644
34 index 0000000..6c75e45
35 --- /dev/null
36 +++ b/1283_linux-4.9.284.patch
37 @@ -0,0 +1,734 @@
38 +diff --git a/Makefile b/Makefile
39 +index ef029a28bb53c..9605f840f94b8 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 9
45 +-SUBLEVEL = 283
46 ++SUBLEVEL = 284
47 + EXTRAVERSION =
48 + NAME = Roaring Lionus
49 +
50 +diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
51 +index 53bb9700cf411..3d88c56d30f91 100644
52 +--- a/arch/s390/net/bpf_jit_comp.c
53 ++++ b/arch/s390/net/bpf_jit_comp.c
54 +@@ -591,10 +591,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
55 + EMIT4(0xb9080000, dst_reg, src_reg);
56 + break;
57 + case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */
58 +- if (!imm)
59 +- break;
60 +- /* alfi %dst,imm */
61 +- EMIT6_IMM(0xc20b0000, dst_reg, imm);
62 ++ if (imm != 0) {
63 ++ /* alfi %dst,imm */
64 ++ EMIT6_IMM(0xc20b0000, dst_reg, imm);
65 ++ }
66 + EMIT_ZERO(dst_reg);
67 + break;
68 + case BPF_ALU64 | BPF_ADD | BPF_K: /* dst = dst + imm */
69 +@@ -616,10 +616,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
70 + EMIT4(0xb9090000, dst_reg, src_reg);
71 + break;
72 + case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */
73 +- if (!imm)
74 +- break;
75 +- /* alfi %dst,-imm */
76 +- EMIT6_IMM(0xc20b0000, dst_reg, -imm);
77 ++ if (imm != 0) {
78 ++ /* alfi %dst,-imm */
79 ++ EMIT6_IMM(0xc20b0000, dst_reg, -imm);
80 ++ }
81 + EMIT_ZERO(dst_reg);
82 + break;
83 + case BPF_ALU64 | BPF_SUB | BPF_K: /* dst = dst - imm */
84 +@@ -646,10 +646,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
85 + EMIT4(0xb90c0000, dst_reg, src_reg);
86 + break;
87 + case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */
88 +- if (imm == 1)
89 +- break;
90 +- /* msfi %r5,imm */
91 +- EMIT6_IMM(0xc2010000, dst_reg, imm);
92 ++ if (imm != 1) {
93 ++ /* msfi %r5,imm */
94 ++ EMIT6_IMM(0xc2010000, dst_reg, imm);
95 ++ }
96 + EMIT_ZERO(dst_reg);
97 + break;
98 + case BPF_ALU64 | BPF_MUL | BPF_K: /* dst = dst * imm */
99 +@@ -710,6 +710,8 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
100 + if (BPF_OP(insn->code) == BPF_MOD)
101 + /* lhgi %dst,0 */
102 + EMIT4_IMM(0xa7090000, dst_reg, 0);
103 ++ else
104 ++ EMIT_ZERO(dst_reg);
105 + break;
106 + }
107 + /* lhi %w0,0 */
108 +@@ -802,10 +804,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
109 + EMIT4(0xb9820000, dst_reg, src_reg);
110 + break;
111 + case BPF_ALU | BPF_XOR | BPF_K: /* dst = (u32) dst ^ (u32) imm */
112 +- if (!imm)
113 +- break;
114 +- /* xilf %dst,imm */
115 +- EMIT6_IMM(0xc0070000, dst_reg, imm);
116 ++ if (imm != 0) {
117 ++ /* xilf %dst,imm */
118 ++ EMIT6_IMM(0xc0070000, dst_reg, imm);
119 ++ }
120 + EMIT_ZERO(dst_reg);
121 + break;
122 + case BPF_ALU64 | BPF_XOR | BPF_K: /* dst = dst ^ imm */
123 +@@ -826,10 +828,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
124 + EMIT6_DISP_LH(0xeb000000, 0x000d, dst_reg, dst_reg, src_reg, 0);
125 + break;
126 + case BPF_ALU | BPF_LSH | BPF_K: /* dst = (u32) dst << (u32) imm */
127 +- if (imm == 0)
128 +- break;
129 +- /* sll %dst,imm(%r0) */
130 +- EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
131 ++ if (imm != 0) {
132 ++ /* sll %dst,imm(%r0) */
133 ++ EMIT4_DISP(0x89000000, dst_reg, REG_0, imm);
134 ++ }
135 + EMIT_ZERO(dst_reg);
136 + break;
137 + case BPF_ALU64 | BPF_LSH | BPF_K: /* dst = dst << imm */
138 +@@ -851,10 +853,10 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, struct bpf_prog *fp, int i
139 + EMIT6_DISP_LH(0xeb000000, 0x000c, dst_reg, dst_reg, src_reg, 0);
140 + break;
141 + case BPF_ALU | BPF_RSH | BPF_K: /* dst = (u32) dst >> (u32) imm */
142 +- if (imm == 0)
143 +- break;
144 +- /* srl %dst,imm(%r0) */
145 +- EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
146 ++ if (imm != 0) {
147 ++ /* srl %dst,imm(%r0) */
148 ++ EMIT4_DISP(0x88000000, dst_reg, REG_0, imm);
149 ++ }
150 + EMIT_ZERO(dst_reg);
151 + break;
152 + case BPF_ALU64 | BPF_RSH | BPF_K: /* dst = dst >> imm */
153 +diff --git a/block/blk-throttle.c b/block/blk-throttle.c
154 +index 3a4c9a3c1427f..6435dc25be0aa 100644
155 +--- a/block/blk-throttle.c
156 ++++ b/block/blk-throttle.c
157 +@@ -1584,6 +1584,7 @@ int blk_throtl_init(struct request_queue *q)
158 + void blk_throtl_exit(struct request_queue *q)
159 + {
160 + BUG_ON(!q->td);
161 ++ del_timer_sync(&q->td->service_queue.pending_timer);
162 + throtl_shutdown_wq(q);
163 + blkcg_deactivate_policy(q, &blkcg_policy_throtl);
164 + kfree(q->td);
165 +diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c
166 +index ee63ccaea8d57..8c05e7a5e777b 100644
167 +--- a/drivers/base/power/wakeirq.c
168 ++++ b/drivers/base/power/wakeirq.c
169 +@@ -320,7 +320,8 @@ void dev_pm_arm_wake_irq(struct wake_irq *wirq)
170 + return;
171 +
172 + if (device_may_wakeup(wirq->dev)) {
173 +- if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
174 ++ if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
175 ++ !pm_runtime_status_suspended(wirq->dev))
176 + enable_irq(wirq->irq);
177 +
178 + enable_irq_wake(wirq->irq);
179 +@@ -342,7 +343,8 @@ void dev_pm_disarm_wake_irq(struct wake_irq *wirq)
180 + if (device_may_wakeup(wirq->dev)) {
181 + disable_irq_wake(wirq->irq);
182 +
183 +- if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED)
184 ++ if (wirq->status & WAKE_IRQ_DEDICATED_ALLOCATED &&
185 ++ !pm_runtime_status_suspended(wirq->dev))
186 + disable_irq_nosync(wirq->irq);
187 + }
188 + }
189 +diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
190 +index 15eb1501915ca..ef9515e9f213f 100644
191 +--- a/drivers/crypto/talitos.c
192 ++++ b/drivers/crypto/talitos.c
193 +@@ -816,7 +816,7 @@ static void talitos_unregister_rng(struct device *dev)
194 + * HMAC_SNOOP_NO_AFEA (HSNA) instead of type IPSEC_ESP
195 + */
196 + #define TALITOS_CRA_PRIORITY_AEAD_HSNA (TALITOS_CRA_PRIORITY - 1)
197 +-#ifdef CONFIG_CRYPTO_DEV_TALITOS_SEC2
198 ++#ifdef CONFIG_CRYPTO_DEV_TALITOS2
199 + #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)
200 + #else
201 + #define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA256_BLOCK_SIZE)
202 +diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
203 +index b0f798244a897..9a6da9b2dad35 100644
204 +--- a/drivers/dma/Kconfig
205 ++++ b/drivers/dma/Kconfig
206 +@@ -238,7 +238,7 @@ config INTEL_IDMA64
207 +
208 + config INTEL_IOATDMA
209 + tristate "Intel I/OAT DMA support"
210 +- depends on PCI && X86_64
211 ++ depends on PCI && X86_64 && !UML
212 + select DMA_ENGINE
213 + select DMA_ENGINE_RAID
214 + select DCA
215 +diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
216 +index 4a748c3435d7d..02149742b334c 100644
217 +--- a/drivers/dma/acpi-dma.c
218 ++++ b/drivers/dma/acpi-dma.c
219 +@@ -72,10 +72,14 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
220 +
221 + si = (const struct acpi_csrt_shared_info *)&grp[1];
222 +
223 +- /* Match device by MMIO and IRQ */
224 ++ /* Match device by MMIO */
225 + if (si->mmio_base_low != lower_32_bits(mem) ||
226 +- si->mmio_base_high != upper_32_bits(mem) ||
227 +- si->gsi_interrupt != irq)
228 ++ si->mmio_base_high != upper_32_bits(mem))
229 ++ return 0;
230 ++
231 ++ /* Match device by Linux vIRQ */
232 ++ ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
233 ++ if (ret != irq)
234 + return 0;
235 +
236 + dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",
237 +diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
238 +index f00652585ee31..d88c53ff7bb69 100644
239 +--- a/drivers/dma/xilinx/xilinx_dma.c
240 ++++ b/drivers/dma/xilinx/xilinx_dma.c
241 +@@ -2578,7 +2578,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
242 + xdev->ext_addr = false;
243 +
244 + /* Set the dma mask bits */
245 +- dma_set_mask(xdev->dev, DMA_BIT_MASK(addr_width));
246 ++ dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width));
247 +
248 + /* Initialize the DMA engine */
249 + xdev->common.dev = &pdev->dev;
250 +diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
251 +index b0ece71aefdee..ce774579c89d1 100644
252 +--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
253 ++++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c
254 +@@ -57,7 +57,7 @@ nvkm_control_mthd_pstate_info(struct nvkm_control *ctrl, void *data, u32 size)
255 + args->v0.count = 0;
256 + args->v0.ustate_ac = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
257 + args->v0.ustate_dc = NVIF_CONTROL_PSTATE_INFO_V0_USTATE_DISABLE;
258 +- args->v0.pwrsrc = -ENOSYS;
259 ++ args->v0.pwrsrc = -ENODEV;
260 + args->v0.pstate = NVIF_CONTROL_PSTATE_INFO_V0_PSTATE_UNKNOWN;
261 + }
262 +
263 +diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
264 +index d842ae5310f71..bbcff6ae61d66 100644
265 +--- a/drivers/parisc/dino.c
266 ++++ b/drivers/parisc/dino.c
267 +@@ -160,15 +160,6 @@ struct dino_device
268 + (struct dino_device *)__pdata; })
269 +
270 +
271 +-/* Check if PCI device is behind a Card-mode Dino. */
272 +-static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
273 +-{
274 +- struct dino_device *dino_dev;
275 +-
276 +- dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
277 +- return is_card_dino(&dino_dev->hba.dev->id);
278 +-}
279 +-
280 + /*
281 + * Dino Configuration Space Accessor Functions
282 + */
283 +@@ -452,6 +443,15 @@ static void quirk_cirrus_cardbus(struct pci_dev *dev)
284 + DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_6832, quirk_cirrus_cardbus );
285 +
286 + #ifdef CONFIG_TULIP
287 ++/* Check if PCI device is behind a Card-mode Dino. */
288 ++static int pci_dev_is_behind_card_dino(struct pci_dev *dev)
289 ++{
290 ++ struct dino_device *dino_dev;
291 ++
292 ++ dino_dev = DINO_DEV(parisc_walk_tree(dev->bus->bridge));
293 ++ return is_card_dino(&dino_dev->hba.dev->id);
294 ++}
295 ++
296 + static void pci_fixup_tulip(struct pci_dev *dev)
297 + {
298 + if (!pci_dev_is_behind_card_dino(dev))
299 +diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c
300 +index a9b3cff96aaca..ed8e9406b4af2 100644
301 +--- a/drivers/pwm/pwm-lpc32xx.c
302 ++++ b/drivers/pwm/pwm-lpc32xx.c
303 +@@ -124,17 +124,17 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev)
304 + lpc32xx->chip.npwm = 1;
305 + lpc32xx->chip.base = -1;
306 +
307 ++ /* If PWM is disabled, configure the output to the default value */
308 ++ val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
309 ++ val &= ~PWM_PIN_LEVEL;
310 ++ writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
311 ++
312 + ret = pwmchip_add(&lpc32xx->chip);
313 + if (ret < 0) {
314 + dev_err(&pdev->dev, "failed to add PWM chip, error %d\n", ret);
315 + return ret;
316 + }
317 +
318 +- /* When PWM is disable, configure the output to the default value */
319 +- val = readl(lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
320 +- val &= ~PWM_PIN_LEVEL;
321 +- writel(val, lpc32xx->base + (lpc32xx->chip.pwms[0].hwpwm << 2));
322 +-
323 + platform_set_drvdata(pdev, lpc32xx);
324 +
325 + return 0;
326 +diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
327 +index 22c481f2ae4f1..2a35b99cf628e 100644
328 +--- a/drivers/staging/android/ion/ion_system_heap.c
329 ++++ b/drivers/staging/android/ion/ion_system_heap.c
330 +@@ -75,7 +75,7 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap,
331 +
332 + page = ion_page_pool_alloc(pool);
333 +
334 +- if (cached)
335 ++ if (page && cached)
336 + ion_pages_sync_for_device(NULL, page, PAGE_SIZE << order,
337 + DMA_BIDIRECTIONAL);
338 + return page;
339 +diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
340 +index c974cb5fb9580..02510c191c7db 100644
341 +--- a/drivers/thermal/samsung/exynos_tmu.c
342 ++++ b/drivers/thermal/samsung/exynos_tmu.c
343 +@@ -1372,6 +1372,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
344 + data->sclk = devm_clk_get(&pdev->dev, "tmu_sclk");
345 + if (IS_ERR(data->sclk)) {
346 + dev_err(&pdev->dev, "Failed to get sclk\n");
347 ++ ret = PTR_ERR(data->sclk);
348 + goto err_clk;
349 + } else {
350 + ret = clk_prepare_enable(data->sclk);
351 +diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
352 +index 0eb2ada032c74..839bccbcc9d65 100644
353 +--- a/fs/ceph/caps.c
354 ++++ b/fs/ceph/caps.c
355 +@@ -1572,6 +1572,8 @@ static int __mark_caps_flushing(struct inode *inode,
356 + * try to invalidate mapping pages without blocking.
357 + */
358 + static int try_nonblocking_invalidate(struct inode *inode)
359 ++ __releases(ci->i_ceph_lock)
360 ++ __acquires(ci->i_ceph_lock)
361 + {
362 + struct ceph_inode_info *ci = ceph_inode(inode);
363 + u32 invalidating_gen = ci->i_rdcache_gen;
364 +diff --git a/fs/nilfs2/sysfs.c b/fs/nilfs2/sysfs.c
365 +index e9903bceb2bf1..33fba75aa9f38 100644
366 +--- a/fs/nilfs2/sysfs.c
367 ++++ b/fs/nilfs2/sysfs.c
368 +@@ -73,11 +73,9 @@ static const struct sysfs_ops nilfs_##name##_attr_ops = { \
369 + #define NILFS_DEV_INT_GROUP_TYPE(name, parent_name) \
370 + static void nilfs_##name##_attr_release(struct kobject *kobj) \
371 + { \
372 +- struct nilfs_sysfs_##parent_name##_subgroups *subgroups; \
373 +- struct the_nilfs *nilfs = container_of(kobj->parent, \
374 +- struct the_nilfs, \
375 +- ns_##parent_name##_kobj); \
376 +- subgroups = nilfs->ns_##parent_name##_subgroups; \
377 ++ struct nilfs_sysfs_##parent_name##_subgroups *subgroups = container_of(kobj, \
378 ++ struct nilfs_sysfs_##parent_name##_subgroups, \
379 ++ sg_##name##_kobj); \
380 + complete(&subgroups->sg_##name##_kobj_unregister); \
381 + } \
382 + static struct kobj_type nilfs_##name##_ktype = { \
383 +@@ -103,12 +101,12 @@ static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
384 + err = kobject_init_and_add(kobj, &nilfs_##name##_ktype, parent, \
385 + #name); \
386 + if (err) \
387 +- return err; \
388 +- return 0; \
389 ++ kobject_put(kobj); \
390 ++ return err; \
391 + } \
392 + static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
393 + { \
394 +- kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
395 ++ kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
396 + }
397 +
398 + /************************************************************************
399 +@@ -219,14 +217,14 @@ int nilfs_sysfs_create_snapshot_group(struct nilfs_root *root)
400 + }
401 +
402 + if (err)
403 +- return err;
404 ++ kobject_put(&root->snapshot_kobj);
405 +
406 +- return 0;
407 ++ return err;
408 + }
409 +
410 + void nilfs_sysfs_delete_snapshot_group(struct nilfs_root *root)
411 + {
412 +- kobject_del(&root->snapshot_kobj);
413 ++ kobject_put(&root->snapshot_kobj);
414 + }
415 +
416 + /************************************************************************
417 +@@ -1010,7 +1008,7 @@ int nilfs_sysfs_create_device_group(struct super_block *sb)
418 + err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL,
419 + "%s", sb->s_id);
420 + if (err)
421 +- goto free_dev_subgroups;
422 ++ goto cleanup_dev_kobject;
423 +
424 + err = nilfs_sysfs_create_mounted_snapshots_group(nilfs);
425 + if (err)
426 +@@ -1047,9 +1045,7 @@ delete_mounted_snapshots_group:
427 + nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
428 +
429 + cleanup_dev_kobject:
430 +- kobject_del(&nilfs->ns_dev_kobj);
431 +-
432 +-free_dev_subgroups:
433 ++ kobject_put(&nilfs->ns_dev_kobj);
434 + kfree(nilfs->ns_dev_subgroups);
435 +
436 + failed_create_device_group:
437 +diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
438 +index b46133a41f55e..c0707e9bd9186 100644
439 +--- a/include/net/sctp/structs.h
440 ++++ b/include/net/sctp/structs.h
441 +@@ -470,7 +470,7 @@ struct sctp_af {
442 + int saddr);
443 + void (*from_sk) (union sctp_addr *,
444 + struct sock *sk);
445 +- void (*from_addr_param) (union sctp_addr *,
446 ++ bool (*from_addr_param) (union sctp_addr *,
447 + union sctp_addr_param *,
448 + __be16 port, int iif);
449 + int (*to_addr_param) (const union sctp_addr *,
450 +diff --git a/kernel/profile.c b/kernel/profile.c
451 +index 2dbccf2d806c6..9c78e3ab4b420 100644
452 +--- a/kernel/profile.c
453 ++++ b/kernel/profile.c
454 +@@ -38,7 +38,8 @@ struct profile_hit {
455 + #define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
456 +
457 + static atomic_t *prof_buffer;
458 +-static unsigned long prof_len, prof_shift;
459 ++static unsigned long prof_len;
460 ++static unsigned short int prof_shift;
461 +
462 + int prof_on __read_mostly;
463 + EXPORT_SYMBOL_GPL(prof_on);
464 +@@ -64,8 +65,8 @@ int profile_setup(char *str)
465 + if (str[strlen(sleepstr)] == ',')
466 + str += strlen(sleepstr) + 1;
467 + if (get_option(&str, &par))
468 +- prof_shift = par;
469 +- pr_info("kernel sleep profiling enabled (shift: %ld)\n",
470 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
471 ++ pr_info("kernel sleep profiling enabled (shift: %u)\n",
472 + prof_shift);
473 + #else
474 + pr_warn("kernel sleep profiling requires CONFIG_SCHEDSTATS\n");
475 +@@ -75,21 +76,21 @@ int profile_setup(char *str)
476 + if (str[strlen(schedstr)] == ',')
477 + str += strlen(schedstr) + 1;
478 + if (get_option(&str, &par))
479 +- prof_shift = par;
480 +- pr_info("kernel schedule profiling enabled (shift: %ld)\n",
481 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
482 ++ pr_info("kernel schedule profiling enabled (shift: %u)\n",
483 + prof_shift);
484 + } else if (!strncmp(str, kvmstr, strlen(kvmstr))) {
485 + prof_on = KVM_PROFILING;
486 + if (str[strlen(kvmstr)] == ',')
487 + str += strlen(kvmstr) + 1;
488 + if (get_option(&str, &par))
489 +- prof_shift = par;
490 +- pr_info("kernel KVM profiling enabled (shift: %ld)\n",
491 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
492 ++ pr_info("kernel KVM profiling enabled (shift: %u)\n",
493 + prof_shift);
494 + } else if (get_option(&str, &par)) {
495 +- prof_shift = par;
496 ++ prof_shift = clamp(par, 0, BITS_PER_LONG - 1);
497 + prof_on = CPU_PROFILING;
498 +- pr_info("kernel profiling enabled (shift: %ld)\n",
499 ++ pr_info("kernel profiling enabled (shift: %u)\n",
500 + prof_shift);
501 + }
502 + return 1;
503 +@@ -465,7 +466,7 @@ read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)
504 + unsigned long p = *ppos;
505 + ssize_t read;
506 + char *pnt;
507 +- unsigned int sample_step = 1 << prof_shift;
508 ++ unsigned long sample_step = 1UL << prof_shift;
509 +
510 + profile_flip_buffers();
511 + if (p >= (prof_len+1)*sizeof(unsigned int))
512 +diff --git a/kernel/sys.c b/kernel/sys.c
513 +index 546cdc911dad4..2e1def48ed73b 100644
514 +--- a/kernel/sys.c
515 ++++ b/kernel/sys.c
516 +@@ -1774,13 +1774,6 @@ static int validate_prctl_map(struct prctl_mm_map *prctl_map)
517 +
518 + error = -EINVAL;
519 +
520 +- /*
521 +- * @brk should be after @end_data in traditional maps.
522 +- */
523 +- if (prctl_map->start_brk <= prctl_map->end_data ||
524 +- prctl_map->brk <= prctl_map->end_data)
525 +- goto out;
526 +-
527 + /*
528 + * Neither we should allow to override limits if they set.
529 + */
530 +diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
531 +index f88911cffa1ad..c6a46e8e9eda5 100644
532 +--- a/net/9p/trans_virtio.c
533 ++++ b/net/9p/trans_virtio.c
534 +@@ -602,7 +602,7 @@ static int p9_virtio_probe(struct virtio_device *vdev)
535 + chan->vc_wq = kmalloc(sizeof(wait_queue_head_t), GFP_KERNEL);
536 + if (!chan->vc_wq) {
537 + err = -ENOMEM;
538 +- goto out_free_tag;
539 ++ goto out_remove_file;
540 + }
541 + init_waitqueue_head(chan->vc_wq);
542 + chan->ring_bufs_avail = 1;
543 +@@ -620,6 +620,8 @@ static int p9_virtio_probe(struct virtio_device *vdev)
544 +
545 + return 0;
546 +
547 ++out_remove_file:
548 ++ sysfs_remove_file(&vdev->dev.kobj, &dev_attr_mount_tag.attr);
549 + out_free_tag:
550 + kfree(tag);
551 + out_free_vq:
552 +diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
553 +index dc4335d817d80..dd9532c5c19dd 100644
554 +--- a/net/sctp/bind_addr.c
555 ++++ b/net/sctp/bind_addr.c
556 +@@ -285,20 +285,16 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
557 + rawaddr = (union sctp_addr_param *)raw_addr_list;
558 +
559 + af = sctp_get_af_specific(param_type2af(param->type));
560 +- if (unlikely(!af)) {
561 ++ if (unlikely(!af) ||
562 ++ !af->from_addr_param(&addr, rawaddr, htons(port), 0)) {
563 + retval = -EINVAL;
564 +- sctp_bind_addr_clean(bp);
565 +- break;
566 ++ goto out_err;
567 + }
568 +
569 +- af->from_addr_param(&addr, rawaddr, htons(port), 0);
570 + retval = sctp_add_bind_addr(bp, &addr, sizeof(addr),
571 + SCTP_ADDR_SRC, gfp);
572 +- if (retval) {
573 +- /* Can't finish building the list, clean up. */
574 +- sctp_bind_addr_clean(bp);
575 +- break;
576 +- }
577 ++ if (retval)
578 ++ goto out_err;
579 +
580 + len = ntohs(param->length);
581 + addrs_len -= len;
582 +@@ -306,6 +302,12 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
583 + }
584 +
585 + return retval;
586 ++
587 ++out_err:
588 ++ if (retval)
589 ++ sctp_bind_addr_clean(bp);
590 ++
591 ++ return retval;
592 + }
593 +
594 + /********************************************************************
595 +diff --git a/net/sctp/input.c b/net/sctp/input.c
596 +index 8f4574c4aa6ca..9c1670b4a687d 100644
597 +--- a/net/sctp/input.c
598 ++++ b/net/sctp/input.c
599 +@@ -1051,7 +1051,8 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct net *net,
600 + if (!af)
601 + continue;
602 +
603 +- af->from_addr_param(paddr, params.addr, sh->source, 0);
604 ++ if (!af->from_addr_param(paddr, params.addr, sh->source, 0))
605 ++ continue;
606 +
607 + asoc = __sctp_lookup_association(net, laddr, paddr, transportp);
608 + if (asoc)
609 +@@ -1087,6 +1088,9 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
610 + union sctp_addr_param *param;
611 + union sctp_addr paddr;
612 +
613 ++ if (ntohs(ch->length) < sizeof(*asconf) + sizeof(struct sctp_paramhdr))
614 ++ return NULL;
615 ++
616 + /* Skip over the ADDIP header and find the Address parameter */
617 + param = (union sctp_addr_param *)(asconf + 1);
618 +
619 +@@ -1094,7 +1098,8 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
620 + if (unlikely(!af))
621 + return NULL;
622 +
623 +- af->from_addr_param(&paddr, param, peer_port, 0);
624 ++ if (af->from_addr_param(&paddr, param, peer_port, 0))
625 ++ return NULL;
626 +
627 + return __sctp_lookup_association(net, laddr, &paddr, transportp);
628 + }
629 +diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
630 +index 50bc8c4ca9068..01337204d2b6f 100644
631 +--- a/net/sctp/ipv6.c
632 ++++ b/net/sctp/ipv6.c
633 +@@ -490,15 +490,20 @@ static void sctp_v6_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
634 + }
635 +
636 + /* Initialize a sctp_addr from an address parameter. */
637 +-static void sctp_v6_from_addr_param(union sctp_addr *addr,
638 ++static bool sctp_v6_from_addr_param(union sctp_addr *addr,
639 + union sctp_addr_param *param,
640 + __be16 port, int iif)
641 + {
642 ++ if (ntohs(param->v6.param_hdr.length) < sizeof(struct sctp_ipv6addr_param))
643 ++ return false;
644 ++
645 + addr->v6.sin6_family = AF_INET6;
646 + addr->v6.sin6_port = port;
647 + addr->v6.sin6_flowinfo = 0; /* BUG */
648 + addr->v6.sin6_addr = param->v6.addr;
649 + addr->v6.sin6_scope_id = iif;
650 ++
651 ++ return true;
652 + }
653 +
654 + /* Initialize an address parameter from a sctp_addr and return the length
655 +diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
656 +index b1932fd125dad..02afbe5710083 100644
657 +--- a/net/sctp/protocol.c
658 ++++ b/net/sctp/protocol.c
659 +@@ -274,14 +274,19 @@ static void sctp_v4_to_sk_daddr(union sctp_addr *addr, struct sock *sk)
660 + }
661 +
662 + /* Initialize a sctp_addr from an address parameter. */
663 +-static void sctp_v4_from_addr_param(union sctp_addr *addr,
664 ++static bool sctp_v4_from_addr_param(union sctp_addr *addr,
665 + union sctp_addr_param *param,
666 + __be16 port, int iif)
667 + {
668 ++ if (ntohs(param->v4.param_hdr.length) < sizeof(struct sctp_ipv4addr_param))
669 ++ return false;
670 ++
671 + addr->v4.sin_family = AF_INET;
672 + addr->v4.sin_port = port;
673 + addr->v4.sin_addr.s_addr = param->v4.addr.s_addr;
674 + memset(addr->v4.sin_zero, 0, sizeof(addr->v4.sin_zero));
675 ++
676 ++ return true;
677 + }
678 +
679 + /* Initialize an address parameter from a sctp_addr and return the length
680 +diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
681 +index 0c5aff3bb5391..2e2802f047005 100644
682 +--- a/net/sctp/sm_make_chunk.c
683 ++++ b/net/sctp/sm_make_chunk.c
684 +@@ -2155,9 +2155,16 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
685 + break;
686 +
687 + case SCTP_PARAM_SET_PRIMARY:
688 +- if (net->sctp.addip_enable)
689 +- break;
690 +- goto fallthrough;
691 ++ if (!net->sctp.addip_enable)
692 ++ goto fallthrough;
693 ++
694 ++ if (ntohs(param.p->length) < sizeof(struct sctp_addip_param) +
695 ++ sizeof(struct sctp_paramhdr)) {
696 ++ sctp_process_inv_paramlength(asoc, param.p,
697 ++ chunk, err_chunk);
698 ++ retval = SCTP_IERROR_ABORT;
699 ++ }
700 ++ break;
701 +
702 + case SCTP_PARAM_HOST_NAME_ADDRESS:
703 + /* Tell the peer, we won't support this param. */
704 +@@ -2335,11 +2342,13 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
705 +
706 + /* Process the initialization parameters. */
707 + sctp_walk_params(param, peer_init, init_hdr.params) {
708 +- if (!src_match && (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
709 +- param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
710 ++ if (!src_match &&
711 ++ (param.p->type == SCTP_PARAM_IPV4_ADDRESS ||
712 ++ param.p->type == SCTP_PARAM_IPV6_ADDRESS)) {
713 + af = sctp_get_af_specific(param_type2af(param.p->type));
714 +- af->from_addr_param(&addr, param.addr,
715 +- chunk->sctp_hdr->source, 0);
716 ++ if (!af->from_addr_param(&addr, param.addr,
717 ++ chunk->sctp_hdr->source, 0))
718 ++ continue;
719 + if (sctp_cmp_addr_exact(sctp_source(chunk), &addr))
720 + src_match = 1;
721 + }
722 +@@ -2533,7 +2542,8 @@ static int sctp_process_param(struct sctp_association *asoc,
723 + break;
724 + do_addr_param:
725 + af = sctp_get_af_specific(param_type2af(param.p->type));
726 +- af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0);
727 ++ if (!af->from_addr_param(&addr, param.addr, htons(asoc->peer.port), 0))
728 ++ break;
729 + scope = sctp_scope(peer_addr);
730 + if (sctp_in_scope(net, &addr, scope))
731 + if (!sctp_assoc_add_peer(asoc, &addr, gfp, SCTP_UNCONFIRMED))
732 +@@ -2626,15 +2636,13 @@ do_addr_param:
733 + addr_param = param.v + sizeof(sctp_addip_param_t);
734 +
735 + af = sctp_get_af_specific(param_type2af(addr_param->p.type));
736 +- if (af == NULL)
737 ++ if (!af)
738 + break;
739 +
740 +- af->from_addr_param(&addr, addr_param,
741 +- htons(asoc->peer.port), 0);
742 ++ if (!af->from_addr_param(&addr, addr_param,
743 ++ htons(asoc->peer.port), 0))
744 ++ break;
745 +
746 +- /* if the address is invalid, we can't process it.
747 +- * XXX: see spec for what to do.
748 +- */
749 + if (!af->addr_valid(&addr, NULL, NULL))
750 + break;
751 +
752 +@@ -3046,7 +3054,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
753 + if (unlikely(!af))
754 + return SCTP_ERROR_DNS_FAILED;
755 +
756 +- af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0);
757 ++ if (!af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0))
758 ++ return SCTP_ERROR_DNS_FAILED;
759 +
760 + /* ADDIP 4.2.1 This parameter MUST NOT contain a broadcast
761 + * or multicast address.
762 +@@ -3311,7 +3320,8 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
763 +
764 + /* We have checked the packet before, so we do not check again. */
765 + af = sctp_get_af_specific(param_type2af(addr_param->p.type));
766 +- af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
767 ++ if (!af->from_addr_param(&addr, addr_param, htons(bp->port), 0))
768 ++ return;
769 +
770 + switch (asconf_param->param_hdr.type) {
771 + case SCTP_PARAM_ADD_IP: