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: Tue, 02 Nov 2021 17:07:35
Message-Id: 1635872842.a3822e316b9a2030c299ea36a383d7d9ae6eaa74.mpagano@gentoo
1 commit: a3822e316b9a2030c299ea36a383d7d9ae6eaa74
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 2 17:07:22 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 2 17:07:22 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=a3822e31
7
8 Linux patch 4.4.291
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1290_linux-4.4.291.patch | 365 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 369 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 82a840c..98c2306 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1203,6 +1203,10 @@ Patch: 1289_linux-4.4.290.patch
21 From: http://www.kernel.org
22 Desc: Linux 4.4.290
23
24 +Patch: 1290_linux-4.4.291.patc
25 +From: http://www.kernel.org
26 +Desc: Linux 4.4.291
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/1290_linux-4.4.291.patch b/1290_linux-4.4.291.patch
33 new file mode 100644
34 index 0000000..3794e70
35 --- /dev/null
36 +++ b/1290_linux-4.4.291.patch
37 @@ -0,0 +1,365 @@
38 +diff --git a/Makefile b/Makefile
39 +index c9dace8cb59d9..62b5a3cfaf4e4 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,6 +1,6 @@
43 + VERSION = 4
44 + PATCHLEVEL = 4
45 +-SUBLEVEL = 290
46 ++SUBLEVEL = 291
47 + EXTRAVERSION =
48 + NAME = Blurry Fish Butt
49 +
50 +diff --git a/arch/arm/Makefile b/arch/arm/Makefile
51 +index 2c2b28ee48119..3a4774dfc1f78 100644
52 +--- a/arch/arm/Makefile
53 ++++ b/arch/arm/Makefile
54 +@@ -13,7 +13,7 @@
55 + # Ensure linker flags are correct
56 + LDFLAGS :=
57 +
58 +-LDFLAGS_vmlinux :=-p --no-undefined -X --pic-veneer
59 ++LDFLAGS_vmlinux := --no-undefined -X --pic-veneer
60 + ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
61 + LDFLAGS_vmlinux += --be8
62 + LDFLAGS_MODULE += --be8
63 +diff --git a/arch/arm/boot/bootp/Makefile b/arch/arm/boot/bootp/Makefile
64 +index 5761f0039133f..9ee49d50842fe 100644
65 +--- a/arch/arm/boot/bootp/Makefile
66 ++++ b/arch/arm/boot/bootp/Makefile
67 +@@ -7,7 +7,7 @@
68 +
69 + GCOV_PROFILE := n
70 +
71 +-LDFLAGS_bootp :=-p --no-undefined -X \
72 ++LDFLAGS_bootp := --no-undefined -X \
73 + --defsym initrd_phys=$(INITRD_PHYS) \
74 + --defsym params_phys=$(PARAMS_PHYS) -T
75 + AFLAGS_initrd.o :=-DINITRD=\"$(INITRD)\"
76 +diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
77 +index 7f167276d4c5a..b4631e07b3b6d 100644
78 +--- a/arch/arm/boot/compressed/Makefile
79 ++++ b/arch/arm/boot/compressed/Makefile
80 +@@ -122,8 +122,6 @@ endif
81 + ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
82 + LDFLAGS_vmlinux += --be8
83 + endif
84 +-# ?
85 +-LDFLAGS_vmlinux += -p
86 + # Report unresolved symbol references
87 + LDFLAGS_vmlinux += --no-undefined
88 + # Delete all temporary local symbols
89 +diff --git a/arch/arm/boot/compressed/decompress.c b/arch/arm/boot/compressed/decompress.c
90 +index a0765e7ed6c7d..b0255cbf3b766 100644
91 +--- a/arch/arm/boot/compressed/decompress.c
92 ++++ b/arch/arm/boot/compressed/decompress.c
93 +@@ -46,7 +46,10 @@ extern char * strstr(const char * s1, const char *s2);
94 + #endif
95 +
96 + #ifdef CONFIG_KERNEL_XZ
97 ++/* Prevent KASAN override of string helpers in decompressor */
98 ++#undef memmove
99 + #define memmove memmove
100 ++#undef memcpy
101 + #define memcpy memcpy
102 + #include "../../../../lib/decompress_unxz.c"
103 + #endif
104 +diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
105 +index 1da55d34f4d65..f1239c52e35d0 100644
106 +--- a/arch/arm/mm/proc-macros.S
107 ++++ b/arch/arm/mm/proc-macros.S
108 +@@ -327,6 +327,7 @@ ENTRY(\name\()_cache_fns)
109 +
110 + .macro define_tlb_functions name:req, flags_up:req, flags_smp
111 + .type \name\()_tlb_fns, #object
112 ++ .align 2
113 + ENTRY(\name\()_tlb_fns)
114 + .long \name\()_flush_user_tlb_range
115 + .long \name\()_flush_kern_tlb_range
116 +diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c
117 +index c3362ddd6c4cb..bc7a5dbaf423f 100644
118 +--- a/arch/arm/probes/kprobes/core.c
119 ++++ b/arch/arm/probes/kprobes/core.c
120 +@@ -666,7 +666,7 @@ static struct undef_hook kprobes_arm_break_hook = {
121 +
122 + #endif /* !CONFIG_THUMB2_KERNEL */
123 +
124 +-int __init arch_init_kprobes()
125 ++int __init arch_init_kprobes(void)
126 + {
127 + arm_probes_decode_init();
128 + #ifdef CONFIG_THUMB2_KERNEL
129 +diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform
130 +index d3e5df9fb36bd..78ffc0bf4ebed 100644
131 +--- a/arch/nios2/platform/Kconfig.platform
132 ++++ b/arch/nios2/platform/Kconfig.platform
133 +@@ -37,6 +37,7 @@ config NIOS2_DTB_PHYS_ADDR
134 +
135 + config NIOS2_DTB_SOURCE_BOOL
136 + bool "Compile and link device tree into kernel image"
137 ++ depends on !COMPILE_TEST
138 + default n
139 + help
140 + This allows you to specify a dts (device tree source) file
141 +diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
142 +index 601ea2e9fcf94..509f63891fb07 100644
143 +--- a/drivers/ata/sata_mv.c
144 ++++ b/drivers/ata/sata_mv.c
145 +@@ -3909,8 +3909,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
146 + break;
147 +
148 + default:
149 +- dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
150 +- return 1;
151 ++ dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
152 ++ return -EINVAL;
153 + }
154 +
155 + hpriv->hp_flags = hp_flags;
156 +diff --git a/drivers/base/regmap/regcache-rbtree.c b/drivers/base/regmap/regcache-rbtree.c
157 +index 56486d92c4e72..f868dda30da05 100644
158 +--- a/drivers/base/regmap/regcache-rbtree.c
159 ++++ b/drivers/base/regmap/regcache-rbtree.c
160 +@@ -296,14 +296,14 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
161 + if (!blk)
162 + return -ENOMEM;
163 +
164 ++ rbnode->block = blk;
165 ++
166 + if (BITS_TO_LONGS(blklen) > BITS_TO_LONGS(rbnode->blklen)) {
167 + present = krealloc(rbnode->cache_present,
168 + BITS_TO_LONGS(blklen) * sizeof(*present),
169 + GFP_KERNEL);
170 +- if (!present) {
171 +- kfree(blk);
172 ++ if (!present)
173 + return -ENOMEM;
174 +- }
175 +
176 + memset(present + BITS_TO_LONGS(rbnode->blklen), 0,
177 + (BITS_TO_LONGS(blklen) - BITS_TO_LONGS(rbnode->blklen))
178 +@@ -320,7 +320,6 @@ static int regcache_rbtree_insert_to_block(struct regmap *map,
179 + }
180 +
181 + /* update the rbnode block, its size and the base register */
182 +- rbnode->block = blk;
183 + rbnode->blklen = blklen;
184 + rbnode->base_reg = base_reg;
185 + rbnode->cache_present = present;
186 +diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
187 +index 3a7e835a00339..4ebd9c8e5a47c 100644
188 +--- a/drivers/mmc/host/dw_mmc-exynos.c
189 ++++ b/drivers/mmc/host/dw_mmc-exynos.c
190 +@@ -442,6 +442,18 @@ static s8 dw_mci_exynos_get_best_clksmpl(u8 candiates)
191 + }
192 + }
193 +
194 ++ /*
195 ++ * If there is no cadiates value, then it needs to return -EIO.
196 ++ * If there are candiates values and don't find bset clk sample value,
197 ++ * then use a first candiates clock sample value.
198 ++ */
199 ++ for (i = 0; i < iter; i++) {
200 ++ __c = ror8(candiates, i);
201 ++ if ((__c & 0x1) == 0x1) {
202 ++ loc = i;
203 ++ goto out;
204 ++ }
205 ++ }
206 + out:
207 + return loc;
208 + }
209 +@@ -472,6 +484,8 @@ static int dw_mci_exynos_execute_tuning(struct dw_mci_slot *slot, u32 opcode)
210 + priv->tuned_sample = found;
211 + } else {
212 + ret = -EIO;
213 ++ dev_warn(&mmc->class_dev,
214 ++ "There is no candiates value about clksmpl!\n");
215 + }
216 +
217 + return ret;
218 +diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
219 +index 42a9720b1a957..e88cca10a983c 100644
220 +--- a/drivers/mmc/host/sdhci.c
221 ++++ b/drivers/mmc/host/sdhci.c
222 +@@ -1319,6 +1319,12 @@ void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
223 + break;
224 + case MMC_VDD_32_33:
225 + case MMC_VDD_33_34:
226 ++ /*
227 ++ * 3.4 ~ 3.6V are valid only for those platforms where it's
228 ++ * known that the voltage range is supported by hardware.
229 ++ */
230 ++ case MMC_VDD_34_35:
231 ++ case MMC_VDD_35_36:
232 + pwr = SDHCI_POWER_330;
233 + break;
234 + default:
235 +diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
236 +index c9ea34e344155..69987b9066f6c 100644
237 +--- a/drivers/mmc/host/vub300.c
238 ++++ b/drivers/mmc/host/vub300.c
239 +@@ -579,7 +579,7 @@ static void check_vub300_port_status(struct vub300_mmc_host *vub300)
240 + GET_SYSTEM_PORT_STATUS,
241 + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
242 + 0x0000, 0x0000, &vub300->system_port_status,
243 +- sizeof(vub300->system_port_status), HZ);
244 ++ sizeof(vub300->system_port_status), 1000);
245 + if (sizeof(vub300->system_port_status) == retval)
246 + new_system_port_status(vub300);
247 + }
248 +@@ -1245,7 +1245,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
249 + SET_INTERRUPT_PSEUDOCODE,
250 + USB_DIR_OUT | USB_TYPE_VENDOR |
251 + USB_RECIP_DEVICE, 0x0000, 0x0000,
252 +- xfer_buffer, xfer_length, HZ);
253 ++ xfer_buffer, xfer_length, 1000);
254 + kfree(xfer_buffer);
255 + if (retval < 0) {
256 + strncpy(vub300->vub_name,
257 +@@ -1292,7 +1292,7 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
258 + SET_TRANSFER_PSEUDOCODE,
259 + USB_DIR_OUT | USB_TYPE_VENDOR |
260 + USB_RECIP_DEVICE, 0x0000, 0x0000,
261 +- xfer_buffer, xfer_length, HZ);
262 ++ xfer_buffer, xfer_length, 1000);
263 + kfree(xfer_buffer);
264 + if (retval < 0) {
265 + strncpy(vub300->vub_name,
266 +@@ -1998,7 +1998,7 @@ static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8],
267 + usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
268 + SET_CLOCK_SPEED,
269 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
270 +- 0x00, 0x00, buf, buf_array_size, HZ);
271 ++ 0x00, 0x00, buf, buf_array_size, 1000);
272 + if (retval != 8) {
273 + dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED"
274 + " %dkHz failed with retval=%d\n", kHzClock, retval);
275 +@@ -2020,14 +2020,14 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
276 + usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
277 + SET_SD_POWER,
278 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
279 +- 0x0000, 0x0000, NULL, 0, HZ);
280 ++ 0x0000, 0x0000, NULL, 0, 1000);
281 + /* must wait for the VUB300 u-proc to boot up */
282 + msleep(600);
283 + } else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) {
284 + usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
285 + SET_SD_POWER,
286 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
287 +- 0x0001, 0x0000, NULL, 0, HZ);
288 ++ 0x0001, 0x0000, NULL, 0, 1000);
289 + msleep(600);
290 + vub300->card_powered = 1;
291 + } else if (ios->power_mode == MMC_POWER_ON) {
292 +@@ -2290,14 +2290,14 @@ static int vub300_probe(struct usb_interface *interface,
293 + GET_HC_INF0,
294 + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
295 + 0x0000, 0x0000, &vub300->hc_info,
296 +- sizeof(vub300->hc_info), HZ);
297 ++ sizeof(vub300->hc_info), 1000);
298 + if (retval < 0)
299 + goto error5;
300 + retval =
301 + usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
302 + SET_ROM_WAIT_STATES,
303 + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
304 +- firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
305 ++ firmware_rom_wait_states, 0x0000, NULL, 0, 1000);
306 + if (retval < 0)
307 + goto error5;
308 + dev_info(&vub300->udev->dev,
309 +@@ -2312,7 +2312,7 @@ static int vub300_probe(struct usb_interface *interface,
310 + GET_SYSTEM_PORT_STATUS,
311 + USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
312 + 0x0000, 0x0000, &vub300->system_port_status,
313 +- sizeof(vub300->system_port_status), HZ);
314 ++ sizeof(vub300->system_port_status), 1000);
315 + if (retval < 0) {
316 + goto error4;
317 + } else if (sizeof(vub300->system_port_status) == retval) {
318 +diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
319 +index d621cf07f3e07..4066fb5a935a7 100644
320 +--- a/drivers/net/phy/mdio_bus.c
321 ++++ b/drivers/net/phy/mdio_bus.c
322 +@@ -274,7 +274,6 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner)
323 + err = device_register(&bus->dev);
324 + if (err) {
325 + pr_err("mii_bus %s failed to register\n", bus->id);
326 +- put_device(&bus->dev);
327 + return -EINVAL;
328 + }
329 +
330 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
331 +index 1439863e9061d..324e2e15092f3 100644
332 +--- a/drivers/net/usb/lan78xx.c
333 ++++ b/drivers/net/usb/lan78xx.c
334 +@@ -2956,6 +2956,12 @@ static int lan78xx_probe(struct usb_interface *intf,
335 +
336 + dev->maxpacket = usb_maxpacket(dev->udev, dev->pipe_out, 1);
337 +
338 ++ /* Reject broken descriptors. */
339 ++ if (dev->maxpacket == 0) {
340 ++ ret = -ENODEV;
341 ++ goto out3;
342 ++ }
343 ++
344 + /* driver requires remote-wakeup capability during autosuspend. */
345 + intf->needs_remote_wakeup = 1;
346 +
347 +diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
348 +index 5a09aff4155ab..d98d50c895b8a 100644
349 +--- a/drivers/net/usb/usbnet.c
350 ++++ b/drivers/net/usb/usbnet.c
351 +@@ -1730,6 +1730,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
352 + if (!dev->rx_urb_size)
353 + dev->rx_urb_size = dev->hard_mtu;
354 + dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
355 ++ if (dev->maxpacket == 0) {
356 ++ /* that is a broken device */
357 ++ status = -ENODEV;
358 ++ goto out4;
359 ++ }
360 +
361 + /* let userspace know we have a random address */
362 + if (ether_addr_equal(net->dev_addr, node_id))
363 +diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c
364 +index 3ffbed72adf75..3ded31873d114 100644
365 +--- a/drivers/nfc/port100.c
366 ++++ b/drivers/nfc/port100.c
367 +@@ -936,11 +936,11 @@ static u64 port100_get_command_type_mask(struct port100 *dev)
368 +
369 + skb = port100_alloc_skb(dev, 0);
370 + if (!skb)
371 +- return -ENOMEM;
372 ++ return 0;
373 +
374 + resp = port100_send_cmd_sync(dev, PORT100_CMD_GET_COMMAND_TYPE, skb);
375 + if (IS_ERR(resp))
376 +- return PTR_ERR(resp);
377 ++ return 0;
378 +
379 + if (resp->len < 8)
380 + mask = 0;
381 +diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
382 +index a9ba6f2bb8c80..53bb631ec4907 100644
383 +--- a/net/sctp/sm_statefuns.c
384 ++++ b/net/sctp/sm_statefuns.c
385 +@@ -4337,6 +4337,9 @@ sctp_disposition_t sctp_sf_violation(struct net *net,
386 + {
387 + struct sctp_chunk *chunk = arg;
388 +
389 ++ if (!sctp_vtag_verify(chunk, asoc))
390 ++ return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
391 ++
392 + /* Make sure that the chunk has a valid length. */
393 + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
394 + return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
395 +@@ -6027,6 +6030,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
396 + * yet.
397 + */
398 + switch (chunk->chunk_hdr->type) {
399 ++ case SCTP_CID_INIT:
400 + case SCTP_CID_INIT_ACK:
401 + {
402 + sctp_initack_chunk_t *initack;