Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Fri, 03 Mar 2023 12:31:12
Message-Id: 1677846647.c984fc41e1f1ba39d49d3f05f2d6aeed699bedd8.mpagano@gentoo
1 commit: c984fc41e1f1ba39d49d3f05f2d6aeed699bedd8
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Mar 3 12:30:47 2023 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Mar 3 12:30:47 2023 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=c984fc41
7
8 Linux patch 5.4.234
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1233_linux-5.4.234.patch | 327 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 331 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 7c529d2e..1b10c228 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -975,6 +975,10 @@ Patch: 1232_linux-5.4.233.patch
21 From: https://www.kernel.org
22 Desc: Linux 5.4.233
23
24 +Patch: 1233_linux-5.4.234.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 5.4.234
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/1233_linux-5.4.234.patch b/1233_linux-5.4.234.patch
33 new file mode 100644
34 index 00000000..cbadd690
35 --- /dev/null
36 +++ b/1233_linux-5.4.234.patch
37 @@ -0,0 +1,327 @@
38 +diff --git a/Makefile b/Makefile
39 +index 900a2864bfb76..7688832a51d28 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 4
46 +-SUBLEVEL = 233
47 ++SUBLEVEL = 234
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
52 +index 7dcafd0833ba8..3a7d375389d0e 100644
53 +--- a/arch/arm/boot/dts/rk3288.dtsi
54 ++++ b/arch/arm/boot/dts/rk3288.dtsi
55 +@@ -1188,6 +1188,7 @@
56 + clock-names = "dp", "pclk";
57 + phys = <&edp_phy>;
58 + phy-names = "dp";
59 ++ power-domains = <&power RK3288_PD_VIO>;
60 + resets = <&cru SRST_EDP>;
61 + reset-names = "dp";
62 + rockchip,grf = <&grf>;
63 +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
64 +index 6c3368f795ca3..fbd942b46c542 100644
65 +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
66 ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
67 +@@ -90,7 +90,6 @@
68 + linux,default-trigger = "heartbeat";
69 + gpios = <&rk805 1 GPIO_ACTIVE_LOW>;
70 + default-state = "on";
71 +- mode = <0x23>;
72 + };
73 +
74 + user {
75 +@@ -98,7 +97,6 @@
76 + linux,default-trigger = "mmc1";
77 + gpios = <&rk805 0 GPIO_ACTIVE_LOW>;
78 + default-state = "off";
79 +- mode = <0x05>;
80 + };
81 + };
82 + };
83 +diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
84 +index 0fe4f3ed72ca4..793b8d9d749a0 100644
85 +--- a/drivers/acpi/nfit/core.c
86 ++++ b/drivers/acpi/nfit/core.c
87 +@@ -3599,8 +3599,8 @@ void acpi_nfit_shutdown(void *data)
88 +
89 + mutex_lock(&acpi_desc->init_mutex);
90 + set_bit(ARS_CANCEL, &acpi_desc->scrub_flags);
91 +- cancel_delayed_work_sync(&acpi_desc->dwork);
92 + mutex_unlock(&acpi_desc->init_mutex);
93 ++ cancel_delayed_work_sync(&acpi_desc->dwork);
94 +
95 + /*
96 + * Bounce the nvdimm bus lock to make sure any in-flight
97 +diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
98 +index eba942441e382..10a8a6d4e8601 100644
99 +--- a/drivers/dma/sh/rcar-dmac.c
100 ++++ b/drivers/dma/sh/rcar-dmac.c
101 +@@ -1824,7 +1824,10 @@ static int rcar_dmac_probe(struct platform_device *pdev)
102 + dmac->dev = &pdev->dev;
103 + platform_set_drvdata(pdev, dmac);
104 + dmac->dev->dma_parms = &dmac->parms;
105 +- dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
106 ++ ret = dma_set_max_seg_size(dmac->dev, RCAR_DMATCR_MASK);
107 ++ if (ret)
108 ++ return ret;
109 ++
110 + ret = dma_set_mask_and_coherent(dmac->dev, DMA_BIT_MASK(40));
111 + if (ret)
112 + return ret;
113 +diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
114 +index 2888bd5502f3f..0c8075d9717cb 100644
115 +--- a/drivers/hid/hid-core.c
116 ++++ b/drivers/hid/hid-core.c
117 +@@ -1190,6 +1190,7 @@ int hid_open_report(struct hid_device *device)
118 + __u8 *end;
119 + __u8 *next;
120 + int ret;
121 ++ int i;
122 + static int (*dispatch_type[])(struct hid_parser *parser,
123 + struct hid_item *item) = {
124 + hid_parser_main,
125 +@@ -1240,6 +1241,8 @@ int hid_open_report(struct hid_device *device)
126 + goto err;
127 + }
128 + device->collection_size = HID_DEFAULT_NUM_COLLECTIONS;
129 ++ for (i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++)
130 ++ device->collection[i].parent_idx = -1;
131 +
132 + ret = -EINVAL;
133 + while ((next = fetch_item(start, end, &item)) != NULL) {
134 +diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
135 +index e7daa65589ab9..6c1d36b2e2a74 100644
136 +--- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c
137 ++++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c
138 +@@ -215,16 +215,11 @@ static void unpin_rcv_pages(struct hfi1_filedata *fd,
139 + static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
140 + {
141 + int pinned;
142 +- unsigned int npages;
143 ++ unsigned int npages = tidbuf->npages;
144 + unsigned long vaddr = tidbuf->vaddr;
145 + struct page **pages = NULL;
146 + struct hfi1_devdata *dd = fd->uctxt->dd;
147 +
148 +- /* Get the number of pages the user buffer spans */
149 +- npages = num_user_pages(vaddr, tidbuf->length);
150 +- if (!npages)
151 +- return -EINVAL;
152 +-
153 + if (npages > fd->uctxt->expected_count) {
154 + dd_dev_err(dd, "Expected buffer too big\n");
155 + return -EINVAL;
156 +@@ -258,7 +253,6 @@ static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf)
157 + return pinned;
158 + }
159 + tidbuf->pages = pages;
160 +- tidbuf->npages = npages;
161 + fd->tid_n_pinned += pinned;
162 + return pinned;
163 + }
164 +@@ -334,6 +328,7 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd,
165 +
166 + tidbuf->vaddr = tinfo->vaddr;
167 + tidbuf->length = tinfo->length;
168 ++ tidbuf->npages = num_user_pages(tidbuf->vaddr, tidbuf->length);
169 + tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets),
170 + GFP_KERNEL);
171 + if (!tidbuf->psets) {
172 +diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
173 +index e61fd04a0d8d0..eb7208f07345d 100644
174 +--- a/drivers/tty/vt/vc_screen.c
175 ++++ b/drivers/tty/vt/vc_screen.c
176 +@@ -284,10 +284,11 @@ vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
177 + ssize_t orig_count;
178 + long p = pos;
179 +
180 +- ret = -ENXIO;
181 + vc = vcs_vc(inode, &viewed);
182 +- if (!vc)
183 +- goto unlock_out;
184 ++ if (!vc) {
185 ++ ret = -ENXIO;
186 ++ break;
187 ++ }
188 +
189 + /* Check whether we are above size each round,
190 + * as copy_to_user at the end of this loop
191 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
192 +index 549bf04f29b27..f787e9771b1f4 100644
193 +--- a/drivers/usb/core/hub.c
194 ++++ b/drivers/usb/core/hub.c
195 +@@ -2379,9 +2379,8 @@ static int usb_enumerate_device_otg(struct usb_device *udev)
196 + * usb_enumerate_device - Read device configs/intfs/otg (usbcore-internal)
197 + * @udev: newly addressed device (in ADDRESS state)
198 + *
199 +- * This is only called by usb_new_device() and usb_authorize_device()
200 +- * and FIXME -- all comments that apply to them apply here wrt to
201 +- * environment.
202 ++ * This is only called by usb_new_device() -- all comments that apply there
203 ++ * apply here wrt to environment.
204 + *
205 + * If the device is WUSB and not authorized, we don't attempt to read
206 + * the string descriptors, as they will be errored out by the device
207 +diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c
208 +index 2f594c88d9058..f19694e69f5c3 100644
209 +--- a/drivers/usb/core/sysfs.c
210 ++++ b/drivers/usb/core/sysfs.c
211 +@@ -889,11 +889,7 @@ read_descriptors(struct file *filp, struct kobject *kobj,
212 + size_t srclen, n;
213 + int cfgno;
214 + void *src;
215 +- int retval;
216 +
217 +- retval = usb_lock_device_interruptible(udev);
218 +- if (retval < 0)
219 +- return -EINTR;
220 + /* The binary attribute begins with the device descriptor.
221 + * Following that are the raw descriptor entries for all the
222 + * configurations (config plus subsidiary descriptors).
223 +@@ -918,7 +914,6 @@ read_descriptors(struct file *filp, struct kobject *kobj,
224 + off -= srclen;
225 + }
226 + }
227 +- usb_unlock_device(udev);
228 + return count - nleft;
229 + }
230 +
231 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
232 +index 159b01b9e1727..c1839091edf5c 100644
233 +--- a/drivers/usb/serial/option.c
234 ++++ b/drivers/usb/serial/option.c
235 +@@ -402,6 +402,8 @@ static void option_instat_callback(struct urb *urb);
236 + #define LONGCHEER_VENDOR_ID 0x1c9e
237 +
238 + /* 4G Systems products */
239 ++/* This one was sold as the VW and Skoda "Carstick LTE" */
240 ++#define FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE 0x7605
241 + /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
242 + * It seems to contain a Qualcomm QSC6240/6290 chipset */
243 + #define FOUR_G_SYSTEMS_PRODUCT_W14 0x9603
244 +@@ -1976,6 +1978,8 @@ static const struct usb_device_id option_ids[] = {
245 + .driver_info = RSVD(2) },
246 + { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
247 + { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
248 ++ { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE),
249 ++ .driver_info = RSVD(0) },
250 + { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
251 + .driver_info = NCTRL(0) | NCTRL(1) },
252 + { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),
253 +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
254 +index fb1996980d265..97417b5569a98 100644
255 +--- a/fs/btrfs/send.c
256 ++++ b/fs/btrfs/send.c
257 +@@ -7347,10 +7347,10 @@ long btrfs_ioctl_send(struct file *mnt_file, struct btrfs_ioctl_send_args *arg)
258 + /*
259 + * Check that we don't overflow at later allocations, we request
260 + * clone_sources_count + 1 items, and compare to unsigned long inside
261 +- * access_ok.
262 ++ * access_ok. Also set an upper limit for allocation size so this can't
263 ++ * easily exhaust memory. Max number of clone sources is about 200K.
264 + */
265 +- if (arg->clone_sources_count >
266 +- ULONG_MAX / sizeof(struct clone_root) - 1) {
267 ++ if (arg->clone_sources_count > SZ_8M / sizeof(struct clone_root)) {
268 + ret = -EINVAL;
269 + goto out;
270 + }
271 +diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
272 +index 8fa98c62c4fcf..53f19ee5642f4 100644
273 +--- a/net/caif/caif_socket.c
274 ++++ b/net/caif/caif_socket.c
275 +@@ -1022,6 +1022,7 @@ static void caif_sock_destructor(struct sock *sk)
276 + return;
277 + }
278 + sk_stream_kill_queues(&cf_sk->sk);
279 ++ WARN_ON(sk->sk_forward_alloc);
280 + caif_free_client(&cf_sk->layer);
281 + }
282 +
283 +diff --git a/net/core/filter.c b/net/core/filter.c
284 +index 051b9710d7b5e..d866e1c5970cc 100644
285 +--- a/net/core/filter.c
286 ++++ b/net/core/filter.c
287 +@@ -4732,7 +4732,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
288 + neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
289 + }
290 +
291 +- if (!neigh)
292 ++ if (!neigh || !(neigh->nud_state & NUD_VALID))
293 + return BPF_FIB_LKUP_RET_NO_NEIGH;
294 +
295 + return bpf_fib_set_fwd_params(params, neigh, dev);
296 +@@ -4845,7 +4845,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params,
297 + * not needed here.
298 + */
299 + neigh = __ipv6_neigh_lookup_noref_stub(dev, dst);
300 +- if (!neigh)
301 ++ if (!neigh || !(neigh->nud_state & NUD_VALID))
302 + return BPF_FIB_LKUP_RET_NO_NEIGH;
303 +
304 + return bpf_fib_set_fwd_params(params, neigh, dev);
305 +diff --git a/net/core/neighbour.c b/net/core/neighbour.c
306 +index 67820219e3b60..ed754217cd1cc 100644
307 +--- a/net/core/neighbour.c
308 ++++ b/net/core/neighbour.c
309 +@@ -242,7 +242,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
310 + (n->nud_state == NUD_NOARP) ||
311 + (tbl->is_multicast &&
312 + tbl->is_multicast(n->primary_key)) ||
313 +- time_after(tref, n->updated))
314 ++ !time_in_range(n->updated, tref, jiffies))
315 + remove = true;
316 + write_unlock(&n->lock);
317 +
318 +@@ -262,7 +262,17 @@ static int neigh_forced_gc(struct neigh_table *tbl)
319 +
320 + static void neigh_add_timer(struct neighbour *n, unsigned long when)
321 + {
322 ++ /* Use safe distance from the jiffies - LONG_MAX point while timer
323 ++ * is running in DELAY/PROBE state but still show to user space
324 ++ * large times in the past.
325 ++ */
326 ++ unsigned long mint = jiffies - (LONG_MAX - 86400 * HZ);
327 ++
328 + neigh_hold(n);
329 ++ if (!time_in_range(n->confirmed, mint, jiffies))
330 ++ n->confirmed = mint;
331 ++ if (time_before(n->used, n->confirmed))
332 ++ n->used = n->confirmed;
333 + if (unlikely(mod_timer(&n->timer, when))) {
334 + printk("NEIGH: BUG, double timer add, state is %x\n",
335 + n->nud_state);
336 +@@ -948,12 +958,14 @@ static void neigh_periodic_work(struct work_struct *work)
337 + goto next_elt;
338 + }
339 +
340 +- if (time_before(n->used, n->confirmed))
341 ++ if (time_before(n->used, n->confirmed) &&
342 ++ time_is_before_eq_jiffies(n->confirmed))
343 + n->used = n->confirmed;
344 +
345 + if (refcount_read(&n->refcnt) == 1 &&
346 + (state == NUD_FAILED ||
347 +- time_after(jiffies, n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
348 ++ !time_in_range_open(jiffies, n->used,
349 ++ n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) {
350 + *np = n->next;
351 + neigh_mark_dead(n);
352 + write_unlock(&n->lock);
353 +diff --git a/net/core/stream.c b/net/core/stream.c
354 +index d7c5413d16d57..cd60746877b1e 100644
355 +--- a/net/core/stream.c
356 ++++ b/net/core/stream.c
357 +@@ -209,7 +209,6 @@ void sk_stream_kill_queues(struct sock *sk)
358 + sk_mem_reclaim(sk);
359 +
360 + WARN_ON(sk->sk_wmem_queued);
361 +- WARN_ON(sk->sk_forward_alloc);
362 +
363 + /* It is _impossible_ for the backlog to contain anything
364 + * when we get here. All user references to this socket