Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Fri, 17 Mar 2023 10:47:51
Message-Id: 1679050056.eee8ee968c0f9b983f0d06e260700dab76fae1d3.mpagano@gentoo
1 commit: eee8ee968c0f9b983f0d06e260700dab76fae1d3
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 17 10:47:36 2023 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 17 10:47:36 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=eee8ee96
7
8 Linux patch 4.14.310
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1309_linux-4.14.310.patch | 345 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 349 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index f28f3da3..67b8935b 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1279,6 +1279,10 @@ Patch: 1308_linux-4.14.309.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.309
23
24 +Patch: 1309_linux-4.14.310.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.310
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/1309_linux-4.14.310.patch b/1309_linux-4.14.310.patch
33 new file mode 100644
34 index 00000000..6ff91e87
35 --- /dev/null
36 +++ b/1309_linux-4.14.310.patch
37 @@ -0,0 +1,345 @@
38 +diff --git a/Makefile b/Makefile
39 +index 608adcd3f0634..edd89ca6f9566 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 309
47 ++SUBLEVEL = 310
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c
52 +index 47632fa8c24e0..b169dc9a9ac17 100644
53 +--- a/arch/alpha/kernel/module.c
54 ++++ b/arch/alpha/kernel/module.c
55 +@@ -158,10 +158,8 @@ apply_relocate_add(Elf64_Shdr *sechdrs, const char *strtab,
56 + base = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr;
57 + symtab = (Elf64_Sym *)sechdrs[symindex].sh_addr;
58 +
59 +- /* The small sections were sorted to the end of the segment.
60 +- The following should definitely cover them. */
61 +- gp = (u64)me->core_layout.base + me->core_layout.size - 0x8000;
62 + got = sechdrs[me->arch.gotsecindex].sh_addr;
63 ++ gp = got + 0x8000;
64 +
65 + for (i = 0; i < n; i++) {
66 + unsigned long r_sym = ELF64_R_SYM (rela[i].r_info);
67 +diff --git a/arch/mips/include/asm/mach-rc32434/pci.h b/arch/mips/include/asm/mach-rc32434/pci.h
68 +index 6f40d1515580b..1ff8a987025c8 100644
69 +--- a/arch/mips/include/asm/mach-rc32434/pci.h
70 ++++ b/arch/mips/include/asm/mach-rc32434/pci.h
71 +@@ -377,7 +377,7 @@ struct pci_msu {
72 + PCI_CFG04_STAT_SSE | \
73 + PCI_CFG04_STAT_PE)
74 +
75 +-#define KORINA_CNFG1 ((KORINA_STAT<<16)|KORINA_CMD)
76 ++#define KORINA_CNFG1 (KORINA_STAT | KORINA_CMD)
77 +
78 + #define KORINA_REVID 0
79 + #define KORINA_CLASS_CODE 0
80 +diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
81 +index ee5d0f943ec8c..e0c9ede0196a6 100644
82 +--- a/arch/x86/kernel/cpu/amd.c
83 ++++ b/arch/x86/kernel/cpu/amd.c
84 +@@ -197,6 +197,15 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
85 + return;
86 + }
87 + #endif
88 ++ /*
89 ++ * Work around Erratum 1386. The XSAVES instruction malfunctions in
90 ++ * certain circumstances on Zen1/2 uarch, and not all parts have had
91 ++ * updated microcode at the time of writing (March 2023).
92 ++ *
93 ++ * Affected parts all have no supervisor XSAVE states, meaning that
94 ++ * the XSAVEC instruction (which works fine) is equivalent.
95 ++ */
96 ++ clear_cpu_cap(c, X86_FEATURE_XSAVES);
97 + }
98 +
99 + static void init_amd_k7(struct cpuinfo_x86 *c)
100 +@@ -941,7 +950,7 @@ static void init_amd(struct cpuinfo_x86 *c)
101 + * serializing.
102 + */
103 + ret = rdmsrl_safe(MSR_AMD64_DE_CFG, &val);
104 +- if (!ret && (val & MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT)) {
105 ++ if (!ret && (val & MSR_AMD64_DE_CFG_LFENCE_SERIALIZE)) {
106 + /* A serializing LFENCE stops RDTSC speculation */
107 + set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC);
108 + } else {
109 +diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
110 +index 63667a5c2c871..6c7563c1ab5f9 100644
111 +--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
112 ++++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
113 +@@ -1314,7 +1314,7 @@ int intel_ring_pin(struct intel_ring *ring,
114 + if (unlikely(ret))
115 + return ret;
116 +
117 +- if (i915_vma_is_map_and_fenceable(vma))
118 ++ if (i915_vma_is_map_and_fenceable(vma) && !HAS_LLC(vma->vm->i915))
119 + addr = (void __force *)i915_vma_pin_iomap(vma);
120 + else
121 + addr = i915_gem_object_pin_map(vma->obj, map);
122 +@@ -1346,7 +1346,7 @@ void intel_ring_unpin(struct intel_ring *ring)
123 + /* Discard any unused bytes beyond that submitted to hw. */
124 + intel_ring_reset(ring, ring->tail);
125 +
126 +- if (i915_vma_is_map_and_fenceable(ring->vma))
127 ++ if (i915_vma_is_map_and_fenceable(ring->vma) && !HAS_LLC(ring->vma->vm->i915))
128 + i915_vma_unpin_iomap(ring->vma);
129 + else
130 + i915_gem_object_unpin_map(ring->vma->obj);
131 +diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c
132 +index 6cdfe714901d5..1332fc789056a 100644
133 +--- a/drivers/macintosh/windfarm_lm75_sensor.c
134 ++++ b/drivers/macintosh/windfarm_lm75_sensor.c
135 +@@ -34,8 +34,8 @@
136 + #endif
137 +
138 + struct wf_lm75_sensor {
139 +- int ds1775 : 1;
140 +- int inited : 1;
141 ++ unsigned int ds1775 : 1;
142 ++ unsigned int inited : 1;
143 + struct i2c_client *i2c;
144 + struct wf_sensor sens;
145 + };
146 +diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c
147 +index 172fd267dcf60..0f4017a8189e5 100644
148 +--- a/drivers/macintosh/windfarm_smu_sensors.c
149 ++++ b/drivers/macintosh/windfarm_smu_sensors.c
150 +@@ -275,8 +275,8 @@ struct smu_cpu_power_sensor {
151 + struct list_head link;
152 + struct wf_sensor *volts;
153 + struct wf_sensor *amps;
154 +- int fake_volts : 1;
155 +- int quadratic : 1;
156 ++ unsigned int fake_volts : 1;
157 ++ unsigned int quadratic : 1;
158 + struct wf_sensor sens;
159 + };
160 + #define to_smu_cpu_power(c) container_of(c, struct smu_cpu_power_sensor, sens)
161 +diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
162 +index eb0331b8a5833..b78e35425d14f 100644
163 +--- a/drivers/media/i2c/ov5640.c
164 ++++ b/drivers/media/i2c/ov5640.c
165 +@@ -2002,7 +2002,7 @@ static int ov5640_init_controls(struct ov5640_dev *sensor)
166 + /* Auto/manual gain */
167 + ctrls->auto_gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_AUTOGAIN,
168 + 0, 1, 1, 1);
169 +- ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAIN,
170 ++ ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_ANALOGUE_GAIN,
171 + 0, 1023, 1, 0);
172 +
173 + ctrls->saturation = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_SATURATION,
174 +diff --git a/drivers/nfc/fdp/i2c.c b/drivers/nfc/fdp/i2c.c
175 +index 4020c11a9415b..3c543981ea180 100644
176 +--- a/drivers/nfc/fdp/i2c.c
177 ++++ b/drivers/nfc/fdp/i2c.c
178 +@@ -263,6 +263,9 @@ static void fdp_nci_i2c_read_device_properties(struct device *dev,
179 + len * sizeof(**fw_vsc_cfg),
180 + GFP_KERNEL);
181 +
182 ++ if (!*fw_vsc_cfg)
183 ++ goto alloc_err;
184 ++
185 + r = device_property_read_u8_array(dev, FDP_DP_FW_VSC_CFG_NAME,
186 + *fw_vsc_cfg, len);
187 +
188 +@@ -276,6 +279,7 @@ vsc_read_err:
189 + *fw_vsc_cfg = NULL;
190 + }
191 +
192 ++alloc_err:
193 + dev_dbg(dev, "Clock type: %d, clock frequency: %d, VSC: %s",
194 + *clock_type, *clock_freq, *fw_vsc_cfg != NULL ? "yes" : "no");
195 + }
196 +diff --git a/fs/ext4/fsmap.c b/fs/ext4/fsmap.c
197 +index 1a4d42a1b161d..f1ad06e688efc 100644
198 +--- a/fs/ext4/fsmap.c
199 ++++ b/fs/ext4/fsmap.c
200 +@@ -499,6 +499,8 @@ static int ext4_getfsmap_datadev(struct super_block *sb,
201 + keys[0].fmr_physical = bofs;
202 + if (keys[1].fmr_physical >= eofs)
203 + keys[1].fmr_physical = eofs - 1;
204 ++ if (keys[1].fmr_physical < keys[0].fmr_physical)
205 ++ return 0;
206 + start_fsb = keys[0].fmr_physical;
207 + end_fsb = keys[1].fmr_physical;
208 +
209 +diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
210 +index d2ee281723cfa..1569fce143210 100644
211 +--- a/fs/ext4/inline.c
212 ++++ b/fs/ext4/inline.c
213 +@@ -163,7 +163,6 @@ int ext4_find_inline_data_nolock(struct inode *inode)
214 + (void *)ext4_raw_inode(&is.iloc));
215 + EXT4_I(inode)->i_inline_size = EXT4_MIN_INLINE_DATA_SIZE +
216 + le32_to_cpu(is.s.here->e_value_size);
217 +- ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
218 + }
219 + out:
220 + brelse(is.iloc.bh);
221 +diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
222 +index f1eea54eb83cc..9d6d3cb515140 100644
223 +--- a/fs/ext4/inode.c
224 ++++ b/fs/ext4/inode.c
225 +@@ -4752,8 +4752,13 @@ static inline int ext4_iget_extra_inode(struct inode *inode,
226 +
227 + if (EXT4_INODE_HAS_XATTR_SPACE(inode) &&
228 + *magic == cpu_to_le32(EXT4_XATTR_MAGIC)) {
229 ++ int err;
230 ++
231 + ext4_set_inode_state(inode, EXT4_STATE_XATTR);
232 +- return ext4_find_inline_data_nolock(inode);
233 ++ err = ext4_find_inline_data_nolock(inode);
234 ++ if (!err && ext4_has_inline_data(inode))
235 ++ ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
236 ++ return err;
237 + } else
238 + EXT4_I(inode)->i_inline_off = 0;
239 + return 0;
240 +diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
241 +index fb49413e77343..105756d6d6e3b 100644
242 +--- a/fs/ext4/ioctl.c
243 ++++ b/fs/ext4/ioctl.c
244 +@@ -150,6 +150,7 @@ static long swap_inode_boot_loader(struct super_block *sb,
245 + ei_bl->i_flags = 0;
246 + inode_bl->i_version = 1;
247 + i_size_write(inode_bl, 0);
248 ++ EXT4_I(inode_bl)->i_disksize = inode_bl->i_size;
249 + inode_bl->i_mode = S_IFREG;
250 + if (ext4_has_feature_extents(sb)) {
251 + ext4_set_inode_flag(inode_bl, EXT4_INODE_EXTENTS);
252 +diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
253 +index 461c080181d66..57c78a7a74256 100644
254 +--- a/fs/ext4/namei.c
255 ++++ b/fs/ext4/namei.c
256 +@@ -1425,11 +1425,10 @@ static struct buffer_head * ext4_find_entry (struct inode *dir,
257 + int has_inline_data = 1;
258 + ret = ext4_find_inline_entry(dir, &fname, res_dir,
259 + &has_inline_data);
260 +- if (has_inline_data) {
261 +- if (inlined)
262 +- *inlined = 1;
263 ++ if (inlined)
264 ++ *inlined = has_inline_data;
265 ++ if (has_inline_data)
266 + goto cleanup_and_exit;
267 +- }
268 + }
269 +
270 + if ((namelen <= 2) && (name[0] == '.') &&
271 +@@ -3520,7 +3519,8 @@ static void ext4_resetent(handle_t *handle, struct ext4_renament *ent,
272 + * so the old->de may no longer valid and need to find it again
273 + * before reset old inode info.
274 + */
275 +- old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL);
276 ++ old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de,
277 ++ &old.inlined);
278 + if (IS_ERR(old.bh))
279 + retval = PTR_ERR(old.bh);
280 + if (!old.bh)
281 +@@ -3688,7 +3688,8 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry,
282 + return retval;
283 + }
284 +
285 +- old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL);
286 ++ old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de,
287 ++ &old.inlined);
288 + if (IS_ERR(old.bh))
289 + return PTR_ERR(old.bh);
290 + /*
291 +diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
292 +index d189016903191..e1b40bd2f4cf2 100644
293 +--- a/fs/ext4/xattr.c
294 ++++ b/fs/ext4/xattr.c
295 +@@ -2809,6 +2809,9 @@ shift:
296 + (void *)header, total_ino);
297 + EXT4_I(inode)->i_extra_isize = new_extra_isize;
298 +
299 ++ if (ext4_has_inline_data(inode))
300 ++ error = ext4_find_inline_data_nolock(inode);
301 ++
302 + cleanup:
303 + if (error && (mnt_count != le16_to_cpu(sbi->s_es->s_mnt_count))) {
304 + ext4_warning(inode->i_sb, "Unable to expand inode %lu. Delete some EAs or run e2fsck.",
305 +diff --git a/fs/file.c b/fs/file.c
306 +index 5e79aa9f5d73b..eac95f11003a1 100644
307 +--- a/fs/file.c
308 ++++ b/fs/file.c
309 +@@ -629,6 +629,7 @@ int __close_fd(struct files_struct *files, unsigned fd)
310 + fdt = files_fdtable(files);
311 + if (fd >= fdt->max_fds)
312 + goto out_unlock;
313 ++ fd = array_index_nospec(fd, fdt->max_fds);
314 + file = fdt->fd[fd];
315 + if (!file)
316 + goto out_unlock;
317 +diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
318 +index d4eae72202fab..0122286beda53 100644
319 +--- a/include/linux/pci_ids.h
320 ++++ b/include/linux/pci_ids.h
321 +@@ -3045,6 +3045,8 @@
322 +
323 + #define PCI_VENDOR_ID_3COM_2 0xa727
324 +
325 ++#define PCI_VENDOR_ID_SOLIDRUN 0xd063
326 ++
327 + #define PCI_VENDOR_ID_DIGIUM 0xd161
328 + #define PCI_DEVICE_ID_DIGIUM_HFC4S 0xb410
329 +
330 +diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c
331 +index 485dde566c1a9..98c0548c6f947 100644
332 +--- a/net/caif/caif_usb.c
333 ++++ b/net/caif/caif_usb.c
334 +@@ -135,6 +135,9 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
335 + struct usb_device *usbdev;
336 + int res;
337 +
338 ++ if (what == NETDEV_UNREGISTER && dev->reg_state >= NETREG_UNREGISTERED)
339 ++ return 0;
340 ++
341 + /* Check whether we have a NCM device, and find its VID/PID. */
342 + if (!(dev->dev.parent && dev->dev.parent->driver &&
343 + strcmp(dev->dev.parent->driver->name, "cdc_ncm") == 0))
344 +diff --git a/net/ipv6/ila/ila_xlat.c b/net/ipv6/ila/ila_xlat.c
345 +index 3123b9de91b5e..9dd76af884f1d 100644
346 +--- a/net/ipv6/ila/ila_xlat.c
347 ++++ b/net/ipv6/ila/ila_xlat.c
348 +@@ -442,6 +442,7 @@ static int ila_nl_cmd_get_mapping(struct sk_buff *skb, struct genl_info *info)
349 +
350 + rcu_read_lock();
351 +
352 ++ ret = -ESRCH;
353 + ila = ila_lookup_by_params(&xp, ilan);
354 + if (ila) {
355 + ret = ila_dump_info(ila,
356 +diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
357 +index 9898b6a27fefc..64b866ed601bf 100644
358 +--- a/net/nfc/netlink.c
359 ++++ b/net/nfc/netlink.c
360 +@@ -1454,8 +1454,8 @@ static int nfc_se_io(struct nfc_dev *dev, u32 se_idx,
361 + return rc;
362 +
363 + error:
364 +- kfree(cb_context);
365 + device_unlock(&dev->dev);
366 ++ kfree(cb_context);
367 + return rc;
368 + }
369 +
370 +diff --git a/net/tipc/socket.c b/net/tipc/socket.c
371 +index 40002d2afb8aa..5d9d9d693da04 100644
372 +--- a/net/tipc/socket.c
373 ++++ b/net/tipc/socket.c
374 +@@ -373,7 +373,7 @@ static int tipc_sk_sock_err(struct socket *sock, long *timeout)
375 + rc_ = tipc_sk_sock_err((sock_), timeo_); \
376 + if (rc_) \
377 + break; \
378 +- prepare_to_wait(sk_sleep(sk_), &wait_, TASK_INTERRUPTIBLE); \
379 ++ add_wait_queue(sk_sleep(sk_), &wait_); \
380 + release_sock(sk_); \
381 + *(timeo_) = wait_woken(&wait_, TASK_INTERRUPTIBLE, *(timeo_)); \
382 + sched_annotate_sleep(); \