Contents of /trunk/kernel-alx-legacy/patches-4.9/0423-4.9.324-all-fixes.patch
Parent Directory | Revision Log
Revision 3725 -
(show annotations)
(download)
Mon Oct 24 14:08:36 2022 UTC (18 months, 3 weeks ago) by niro
File size: 22972 byte(s)
Mon Oct 24 14:08:36 2022 UTC (18 months, 3 weeks ago) by niro
File size: 22972 byte(s)
-linux-4.9.324
1 | diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt |
2 | index a374412610ba3..dfac66c71cb5d 100644 |
3 | --- a/Documentation/networking/ip-sysctl.txt |
4 | +++ b/Documentation/networking/ip-sysctl.txt |
5 | @@ -781,7 +781,7 @@ cipso_cache_enable - BOOLEAN |
6 | cipso_cache_bucket_size - INTEGER |
7 | The CIPSO label cache consists of a fixed size hash table with each |
8 | hash bucket containing a number of cache entries. This variable limits |
9 | - the number of entries in each hash bucket; the larger the value the |
10 | + the number of entries in each hash bucket; the larger the value is, the |
11 | more CIPSO label mappings that can be cached. When the number of |
12 | entries in a given hash bucket reaches this limit adding new entries |
13 | causes the oldest entry in the bucket to be removed to make room. |
14 | @@ -849,7 +849,7 @@ ip_nonlocal_bind - BOOLEAN |
15 | which can be quite useful - but may break some applications. |
16 | Default: 0 |
17 | |
18 | -ip_dynaddr - BOOLEAN |
19 | +ip_dynaddr - INTEGER |
20 | If set non-zero, enables support for dynamic addresses. |
21 | If set to a non-zero value larger than 1, a kernel log |
22 | message will be printed when dynamic address rewriting |
23 | diff --git a/Makefile b/Makefile |
24 | index 44c3b223062a1..3168f1c122213 100644 |
25 | --- a/Makefile |
26 | +++ b/Makefile |
27 | @@ -1,6 +1,6 @@ |
28 | VERSION = 4 |
29 | PATCHLEVEL = 9 |
30 | -SUBLEVEL = 323 |
31 | +SUBLEVEL = 324 |
32 | EXTRAVERSION = |
33 | NAME = Roaring Lionus |
34 | |
35 | diff --git a/arch/arm/mm/proc-v7-bugs.c b/arch/arm/mm/proc-v7-bugs.c |
36 | index 8b78694d56b88..4af4195eed76b 100644 |
37 | --- a/arch/arm/mm/proc-v7-bugs.c |
38 | +++ b/arch/arm/mm/proc-v7-bugs.c |
39 | @@ -110,8 +110,7 @@ static unsigned int spectre_v2_install_workaround(unsigned int method) |
40 | #else |
41 | static unsigned int spectre_v2_install_workaround(unsigned int method) |
42 | { |
43 | - pr_info("CPU%u: Spectre V2: workarounds disabled by configuration\n", |
44 | - smp_processor_id()); |
45 | + pr_info_once("Spectre V2: workarounds disabled by configuration\n"); |
46 | |
47 | return SPECTRE_VULNERABLE; |
48 | } |
49 | @@ -218,10 +217,10 @@ static int spectre_bhb_install_workaround(int method) |
50 | return SPECTRE_VULNERABLE; |
51 | |
52 | spectre_bhb_method = method; |
53 | - } |
54 | |
55 | - pr_info("CPU%u: Spectre BHB: using %s workaround\n", |
56 | - smp_processor_id(), spectre_bhb_method_name(method)); |
57 | + pr_info("CPU%u: Spectre BHB: enabling %s workaround for all CPUs\n", |
58 | + smp_processor_id(), spectre_bhb_method_name(method)); |
59 | + } |
60 | |
61 | return SPECTRE_MITIGATED; |
62 | } |
63 | diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S |
64 | index 1f79abb1e5ddb..4551c0f35fc44 100644 |
65 | --- a/arch/arm64/kernel/entry.S |
66 | +++ b/arch/arm64/kernel/entry.S |
67 | @@ -964,6 +964,7 @@ __ni_sys_trace: |
68 | b . |
69 | 2: |
70 | tramp_map_kernel x30 |
71 | + isb |
72 | tramp_data_read_var x30, vectors |
73 | prfm plil1strm, [x30, #(1b - \vector_start)] |
74 | msr vbar_el1, x30 |
75 | diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c |
76 | index b5785c197e534..2b2060d842d1f 100644 |
77 | --- a/arch/x86/kernel/head64.c |
78 | +++ b/arch/x86/kernel/head64.c |
79 | @@ -106,6 +106,8 @@ static void __init clear_bss(void) |
80 | { |
81 | memset(__bss_start, 0, |
82 | (unsigned long) __bss_stop - (unsigned long) __bss_start); |
83 | + memset(__brk_base, 0, |
84 | + (unsigned long) __brk_limit - (unsigned long) __brk_base); |
85 | } |
86 | |
87 | static unsigned long get_cmd_line_ptr(void) |
88 | diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c |
89 | index 641f8021855a7..62e86f7ca04ab 100644 |
90 | --- a/drivers/cpufreq/pmac32-cpufreq.c |
91 | +++ b/drivers/cpufreq/pmac32-cpufreq.c |
92 | @@ -473,6 +473,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode) |
93 | if (slew_done_gpio_np) |
94 | slew_done_gpio = read_gpio(slew_done_gpio_np); |
95 | |
96 | + of_node_put(volt_gpio_np); |
97 | + of_node_put(freq_gpio_np); |
98 | + of_node_put(slew_done_gpio_np); |
99 | + |
100 | /* If we use the frequency GPIOs, calculate the min/max speeds based |
101 | * on the bus frequencies |
102 | */ |
103 | diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c |
104 | index 197c27d8f584b..85380b63533fd 100644 |
105 | --- a/drivers/net/can/m_can/m_can.c |
106 | +++ b/drivers/net/can/m_can/m_can.c |
107 | @@ -1068,8 +1068,6 @@ static netdev_tx_t m_can_start_xmit(struct sk_buff *skb, |
108 | m_can_fifo_write(priv, 0, M_CAN_FIFO_DATA(i / 4), |
109 | *(u32 *)(cf->data + i)); |
110 | |
111 | - can_put_echo_skb(skb, dev, 0); |
112 | - |
113 | if (priv->can.ctrlmode & CAN_CTRLMODE_FD) { |
114 | cccr = m_can_read(priv, M_CAN_CCCR); |
115 | cccr &= ~(CCCR_CMR_MASK << CCCR_CMR_SHIFT); |
116 | @@ -1086,6 +1084,9 @@ static netdev_tx_t m_can_start_xmit(struct sk_buff *skb, |
117 | |
118 | /* enable first TX buffer to start transfer */ |
119 | m_can_write(priv, M_CAN_TXBTIE, 0x1); |
120 | + |
121 | + can_put_echo_skb(skb, dev, 0); |
122 | + |
123 | m_can_write(priv, M_CAN_TXBAR, 0x1); |
124 | |
125 | return NETDEV_TX_OK; |
126 | diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c |
127 | index 40b3adf7ad998..f3d61f2bb0f72 100644 |
128 | --- a/drivers/net/dsa/bcm_sf2.c |
129 | +++ b/drivers/net/dsa/bcm_sf2.c |
130 | @@ -600,7 +600,9 @@ static void bcm_sf2_sw_adjust_link(struct dsa_switch *ds, int port, |
131 | struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds); |
132 | struct ethtool_eee *p = &priv->port_sts[port].eee; |
133 | u32 id_mode_dis = 0, port_mode; |
134 | + u16 lcl_adv = 0, rmt_adv = 0; |
135 | const char *str = NULL; |
136 | + u8 flowctrl = 0; |
137 | u32 reg; |
138 | |
139 | switch (phydev->interface) { |
140 | @@ -667,10 +669,27 @@ force_link: |
141 | break; |
142 | } |
143 | |
144 | + if (phydev->duplex == DUPLEX_FULL && |
145 | + phydev->autoneg == AUTONEG_ENABLE) { |
146 | + if (phydev->pause) |
147 | + rmt_adv = LPA_PAUSE_CAP; |
148 | + if (phydev->asym_pause) |
149 | + rmt_adv |= LPA_PAUSE_ASYM; |
150 | + if (phydev->advertising & ADVERTISED_Pause) |
151 | + lcl_adv = ADVERTISE_PAUSE_CAP; |
152 | + if (phydev->advertising & ADVERTISED_Asym_Pause) |
153 | + lcl_adv |= ADVERTISE_PAUSE_ASYM; |
154 | + flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv); |
155 | + } |
156 | + |
157 | if (phydev->link) |
158 | reg |= LINK_STS; |
159 | if (phydev->duplex == DUPLEX_FULL) |
160 | reg |= DUPLX_MODE; |
161 | + if (flowctrl & FLOW_CTRL_TX) |
162 | + reg |= TXFLOW_CNTL; |
163 | + if (flowctrl & FLOW_CTRL_RX) |
164 | + reg |= RXFLOW_CNTL; |
165 | |
166 | core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port)); |
167 | |
168 | diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c |
169 | index aa2cef8675f4e..7b8e0f624c98c 100644 |
170 | --- a/drivers/net/ethernet/sfc/ef10.c |
171 | +++ b/drivers/net/ethernet/sfc/ef10.c |
172 | @@ -1830,7 +1830,10 @@ static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx) |
173 | |
174 | efx_update_sw_stats(efx, stats); |
175 | out: |
176 | + /* releasing a DMA coherent buffer with BH disabled can panic */ |
177 | + spin_unlock_bh(&efx->stats_lock); |
178 | efx_nic_free_buffer(efx, &stats_buf); |
179 | + spin_lock_bh(&efx->stats_lock); |
180 | return rc; |
181 | } |
182 | |
183 | diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c |
184 | index bef23e19cbbd9..41a60f66646d7 100644 |
185 | --- a/drivers/net/ethernet/sfc/ef10_sriov.c |
186 | +++ b/drivers/net/ethernet/sfc/ef10_sriov.c |
187 | @@ -414,8 +414,9 @@ fail1: |
188 | static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force) |
189 | { |
190 | struct pci_dev *dev = efx->pci_dev; |
191 | + struct efx_ef10_nic_data *nic_data = efx->nic_data; |
192 | unsigned int vfs_assigned = pci_vfs_assigned(dev); |
193 | - int rc = 0; |
194 | + int i, rc = 0; |
195 | |
196 | if (vfs_assigned && !force) { |
197 | netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; " |
198 | @@ -423,10 +424,13 @@ static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force) |
199 | return -EBUSY; |
200 | } |
201 | |
202 | - if (!vfs_assigned) |
203 | + if (!vfs_assigned) { |
204 | + for (i = 0; i < efx->vf_count; i++) |
205 | + nic_data->vf[i].pci_dev = NULL; |
206 | pci_disable_sriov(dev); |
207 | - else |
208 | + } else { |
209 | rc = -EBUSY; |
210 | + } |
211 | |
212 | efx_ef10_sriov_free_vf_vswitching(efx); |
213 | efx->vf_count = 0; |
214 | diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c |
215 | index 29c7645f57805..2612810eadaf1 100644 |
216 | --- a/drivers/net/xen-netback/rx.c |
217 | +++ b/drivers/net/xen-netback/rx.c |
218 | @@ -482,6 +482,7 @@ void xenvif_rx_action(struct xenvif_queue *queue) |
219 | queue->rx_copy.completed = &completed_skbs; |
220 | |
221 | while (xenvif_rx_ring_slots_available(queue) && |
222 | + !skb_queue_empty(&queue->rx_queue) && |
223 | work_done < RX_BATCH_SIZE) { |
224 | xenvif_rx_skb(queue); |
225 | work_done++; |
226 | diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c |
227 | index a4f1a981e2dd1..a9c8bfb62ebe7 100644 |
228 | --- a/drivers/nfc/nxp-nci/i2c.c |
229 | +++ b/drivers/nfc/nxp-nci/i2c.c |
230 | @@ -139,7 +139,9 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy, |
231 | memcpy(skb_put(*skb, NXP_NCI_FW_HDR_LEN), &header, NXP_NCI_FW_HDR_LEN); |
232 | |
233 | r = i2c_master_recv(client, skb_put(*skb, frame_len), frame_len); |
234 | - if (r != frame_len) { |
235 | + if (r < 0) { |
236 | + goto fw_read_exit_free_skb; |
237 | + } else if (r != frame_len) { |
238 | nfc_err(&client->dev, |
239 | "Invalid frame length: %u (expected %zu)\n", |
240 | r, frame_len); |
241 | @@ -184,7 +186,9 @@ static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy, |
242 | return 0; |
243 | |
244 | r = i2c_master_recv(client, skb_put(*skb, header.plen), header.plen); |
245 | - if (r != header.plen) { |
246 | + if (r < 0) { |
247 | + goto nci_read_exit_free_skb; |
248 | + } else if (r != header.plen) { |
249 | nfc_err(&client->dev, |
250 | "Invalid frame payload length: %u (expected %u)\n", |
251 | r, header.plen); |
252 | diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c |
253 | index d3f17b23ac61f..d337a6d022825 100644 |
254 | --- a/drivers/tty/serial/8250/8250_port.c |
255 | +++ b/drivers/tty/serial/8250/8250_port.c |
256 | @@ -2789,8 +2789,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) |
257 | case UPIO_MEM32BE: |
258 | case UPIO_MEM16: |
259 | case UPIO_MEM: |
260 | - if (!port->mapbase) |
261 | + if (!port->mapbase) { |
262 | + ret = -EINVAL; |
263 | break; |
264 | + } |
265 | |
266 | if (!request_mem_region(port->mapbase, size, "serial")) { |
267 | ret = -EBUSY; |
268 | diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c |
269 | index 15b9bf35457b7..fb35a275102f4 100644 |
270 | --- a/drivers/tty/serial/samsung.c |
271 | +++ b/drivers/tty/serial/samsung.c |
272 | @@ -241,8 +241,7 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport) |
273 | /* Enable tx dma mode */ |
274 | ucon = rd_regl(port, S3C2410_UCON); |
275 | ucon &= ~(S3C64XX_UCON_TXBURST_MASK | S3C64XX_UCON_TXMODE_MASK); |
276 | - ucon |= (dma_get_cache_alignment() >= 16) ? |
277 | - S3C64XX_UCON_TXBURST_16 : S3C64XX_UCON_TXBURST_1; |
278 | + ucon |= S3C64XX_UCON_TXBURST_1; |
279 | ucon |= S3C64XX_UCON_TXMODE_DMA; |
280 | wr_regl(port, S3C2410_UCON, ucon); |
281 | |
282 | @@ -515,7 +514,7 @@ static void enable_rx_dma(struct s3c24xx_uart_port *ourport) |
283 | S3C64XX_UCON_DMASUS_EN | |
284 | S3C64XX_UCON_TIMEOUT_EN | |
285 | S3C64XX_UCON_RXMODE_MASK); |
286 | - ucon |= S3C64XX_UCON_RXBURST_16 | |
287 | + ucon |= S3C64XX_UCON_RXBURST_1 | |
288 | 0xf << S3C64XX_UCON_TIMEOUT_SHIFT | |
289 | S3C64XX_UCON_EMPTYINT_EN | |
290 | S3C64XX_UCON_TIMEOUT_EN | |
291 | diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c |
292 | index ccc47594064f2..68762501e9634 100644 |
293 | --- a/drivers/usb/dwc3/gadget.c |
294 | +++ b/drivers/usb/dwc3/gadget.c |
295 | @@ -2886,7 +2886,6 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt) |
296 | } |
297 | |
298 | evt->count = 0; |
299 | - evt->flags &= ~DWC3_EVENT_PENDING; |
300 | ret = IRQ_HANDLED; |
301 | |
302 | /* Unmask interrupt */ |
303 | @@ -2894,6 +2893,9 @@ static irqreturn_t dwc3_process_event_buf(struct dwc3_event_buffer *evt) |
304 | reg &= ~DWC3_GEVNTSIZ_INTMASK; |
305 | dwc3_writel(dwc->regs, DWC3_GEVNTSIZ(0), reg); |
306 | |
307 | + /* Keep the clearing of DWC3_EVENT_PENDING at the end */ |
308 | + evt->flags &= ~DWC3_EVENT_PENDING; |
309 | + |
310 | return ret; |
311 | } |
312 | |
313 | diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c |
314 | index 5c4fa4fcb1e88..d818aed9043d5 100644 |
315 | --- a/drivers/usb/serial/ftdi_sio.c |
316 | +++ b/drivers/usb/serial/ftdi_sio.c |
317 | @@ -1018,6 +1018,9 @@ static const struct usb_device_id id_table_combined[] = { |
318 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_DISPLAY_PID) }, |
319 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_LITE_PID) }, |
320 | { USB_DEVICE(FTDI_VID, CHETCO_SEASMART_ANALOG_PID) }, |
321 | + /* Belimo Automation devices */ |
322 | + { USB_DEVICE(FTDI_VID, BELIMO_ZTH_PID) }, |
323 | + { USB_DEVICE(FTDI_VID, BELIMO_ZIP_PID) }, |
324 | /* ICP DAS I-756xU devices */ |
325 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7560U_PID) }, |
326 | { USB_DEVICE(ICPDAS_VID, ICPDAS_I7561U_PID) }, |
327 | diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h |
328 | index 006e92d26baba..e2f0bb716a5f3 100644 |
329 | --- a/drivers/usb/serial/ftdi_sio_ids.h |
330 | +++ b/drivers/usb/serial/ftdi_sio_ids.h |
331 | @@ -1567,6 +1567,12 @@ |
332 | #define CHETCO_SEASMART_LITE_PID 0xA5AE /* SeaSmart Lite USB Adapter */ |
333 | #define CHETCO_SEASMART_ANALOG_PID 0xA5AF /* SeaSmart Analog Adapter */ |
334 | |
335 | +/* |
336 | + * Belimo Automation |
337 | + */ |
338 | +#define BELIMO_ZTH_PID 0x8050 |
339 | +#define BELIMO_ZIP_PID 0xC811 |
340 | + |
341 | /* |
342 | * Unjo AB |
343 | */ |
344 | diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c |
345 | index f62da3b7c27b4..413f6af4d132f 100644 |
346 | --- a/drivers/virtio/virtio_mmio.c |
347 | +++ b/drivers/virtio/virtio_mmio.c |
348 | @@ -66,6 +66,7 @@ |
349 | #include <linux/list.h> |
350 | #include <linux/module.h> |
351 | #include <linux/platform_device.h> |
352 | +#include <linux/pm.h> |
353 | #include <linux/slab.h> |
354 | #include <linux/spinlock.h> |
355 | #include <linux/virtio.h> |
356 | @@ -489,6 +490,28 @@ static const struct virtio_config_ops virtio_mmio_config_ops = { |
357 | .bus_name = vm_bus_name, |
358 | }; |
359 | |
360 | +#ifdef CONFIG_PM_SLEEP |
361 | +static int virtio_mmio_freeze(struct device *dev) |
362 | +{ |
363 | + struct virtio_mmio_device *vm_dev = dev_get_drvdata(dev); |
364 | + |
365 | + return virtio_device_freeze(&vm_dev->vdev); |
366 | +} |
367 | + |
368 | +static int virtio_mmio_restore(struct device *dev) |
369 | +{ |
370 | + struct virtio_mmio_device *vm_dev = dev_get_drvdata(dev); |
371 | + |
372 | + if (vm_dev->version == 1) |
373 | + writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); |
374 | + |
375 | + return virtio_device_restore(&vm_dev->vdev); |
376 | +} |
377 | + |
378 | +static const struct dev_pm_ops virtio_mmio_pm_ops = { |
379 | + SET_SYSTEM_SLEEP_PM_OPS(virtio_mmio_freeze, virtio_mmio_restore) |
380 | +}; |
381 | +#endif |
382 | |
383 | |
384 | /* Platform device */ |
385 | @@ -730,6 +753,9 @@ static struct platform_driver virtio_mmio_driver = { |
386 | .name = "virtio-mmio", |
387 | .of_match_table = virtio_mmio_match, |
388 | .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match), |
389 | +#ifdef CONFIG_PM_SLEEP |
390 | + .pm = &virtio_mmio_pm_ops, |
391 | +#endif |
392 | }, |
393 | }; |
394 | |
395 | diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h |
396 | index 33f8c8fc96e8e..a89704271428b 100644 |
397 | --- a/fs/nilfs2/nilfs.h |
398 | +++ b/fs/nilfs2/nilfs.h |
399 | @@ -212,6 +212,9 @@ static inline int nilfs_acl_chmod(struct inode *inode) |
400 | |
401 | static inline int nilfs_init_acl(struct inode *inode, struct inode *dir) |
402 | { |
403 | + if (S_ISLNK(inode->i_mode)) |
404 | + return 0; |
405 | + |
406 | inode->i_mode &= ~current_umask(); |
407 | return 0; |
408 | } |
409 | diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h |
410 | index 779abb91df810..4b322fb239728 100644 |
411 | --- a/include/trace/events/sock.h |
412 | +++ b/include/trace/events/sock.h |
413 | @@ -37,7 +37,7 @@ TRACE_EVENT(sock_exceed_buf_limit, |
414 | |
415 | TP_STRUCT__entry( |
416 | __array(char, name, 32) |
417 | - __field(long *, sysctl_mem) |
418 | + __array(long, sysctl_mem, 3) |
419 | __field(long, allocated) |
420 | __field(int, sysctl_rmem) |
421 | __field(int, rmem_alloc) |
422 | @@ -45,7 +45,9 @@ TRACE_EVENT(sock_exceed_buf_limit, |
423 | |
424 | TP_fast_assign( |
425 | strncpy(__entry->name, prot->name, 32); |
426 | - __entry->sysctl_mem = prot->sysctl_mem; |
427 | + __entry->sysctl_mem[0] = READ_ONCE(prot->sysctl_mem[0]); |
428 | + __entry->sysctl_mem[1] = READ_ONCE(prot->sysctl_mem[1]); |
429 | + __entry->sysctl_mem[2] = READ_ONCE(prot->sysctl_mem[2]); |
430 | __entry->allocated = allocated; |
431 | __entry->sysctl_rmem = prot->sysctl_rmem[0]; |
432 | __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc); |
433 | diff --git a/kernel/signal.c b/kernel/signal.c |
434 | index 2c26af848e682..670755212d350 100644 |
435 | --- a/kernel/signal.c |
436 | +++ b/kernel/signal.c |
437 | @@ -1647,12 +1647,12 @@ bool do_notify_parent(struct task_struct *tsk, int sig) |
438 | bool autoreap = false; |
439 | cputime_t utime, stime; |
440 | |
441 | - BUG_ON(sig == -1); |
442 | + WARN_ON_ONCE(sig == -1); |
443 | |
444 | - /* do_notify_parent_cldstop should have been called instead. */ |
445 | - BUG_ON(task_is_stopped_or_traced(tsk)); |
446 | + /* do_notify_parent_cldstop should have been called instead. */ |
447 | + WARN_ON_ONCE(task_is_stopped_or_traced(tsk)); |
448 | |
449 | - BUG_ON(!tsk->ptrace && |
450 | + WARN_ON_ONCE(!tsk->ptrace && |
451 | (tsk->group_leader != tsk || !thread_group_empty(tsk))); |
452 | |
453 | if (sig != SIGCHLD) { |
454 | diff --git a/mm/memory.c b/mm/memory.c |
455 | index 1b31cdce936e9..36d46e19df960 100644 |
456 | --- a/mm/memory.c |
457 | +++ b/mm/memory.c |
458 | @@ -2891,10 +2891,15 @@ static int __do_fault(struct fault_env *fe, pgoff_t pgoff, |
459 | } |
460 | |
461 | if (unlikely(PageHWPoison(vmf.page))) { |
462 | - if (ret & VM_FAULT_LOCKED) |
463 | + int poisonret = VM_FAULT_HWPOISON; |
464 | + if (ret & VM_FAULT_LOCKED) { |
465 | + /* Retry if a clean page was removed from the cache. */ |
466 | + if (invalidate_inode_page(vmf.page)) |
467 | + poisonret = 0; |
468 | unlock_page(vmf.page); |
469 | + } |
470 | put_page(vmf.page); |
471 | - return VM_FAULT_HWPOISON; |
472 | + return poisonret; |
473 | } |
474 | |
475 | if (unlikely(!(ret & VM_FAULT_LOCKED))) |
476 | diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c |
477 | index 8f2fb14fd4f71..970a498c11666 100644 |
478 | --- a/net/ipv4/af_inet.c |
479 | +++ b/net/ipv4/af_inet.c |
480 | @@ -1122,7 +1122,7 @@ static int inet_sk_reselect_saddr(struct sock *sk) |
481 | if (new_saddr == old_saddr) |
482 | return 0; |
483 | |
484 | - if (sock_net(sk)->ipv4.sysctl_ip_dynaddr > 1) { |
485 | + if (READ_ONCE(sock_net(sk)->ipv4.sysctl_ip_dynaddr) > 1) { |
486 | pr_info("%s(): shifting inet->saddr from %pI4 to %pI4\n", |
487 | __func__, &old_saddr, &new_saddr); |
488 | } |
489 | @@ -1177,7 +1177,7 @@ int inet_sk_rebuild_header(struct sock *sk) |
490 | * Other protocols have to map its equivalent state to TCP_SYN_SENT. |
491 | * DCCP maps its DCCP_REQUESTING state to TCP_SYN_SENT. -acme |
492 | */ |
493 | - if (!sock_net(sk)->ipv4.sysctl_ip_dynaddr || |
494 | + if (!READ_ONCE(sock_net(sk)->ipv4.sysctl_ip_dynaddr) || |
495 | sk->sk_state != TCP_SYN_SENT || |
496 | (sk->sk_userlocks & SOCK_BINDADDR_LOCK) || |
497 | (err = inet_sk_reselect_saddr(sk)) != 0) |
498 | diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c |
499 | index b7dc20a65b649..0bf7196d5d40b 100644 |
500 | --- a/net/ipv4/cipso_ipv4.c |
501 | +++ b/net/ipv4/cipso_ipv4.c |
502 | @@ -254,7 +254,7 @@ static int cipso_v4_cache_check(const unsigned char *key, |
503 | struct cipso_v4_map_cache_entry *prev_entry = NULL; |
504 | u32 hash; |
505 | |
506 | - if (!cipso_v4_cache_enabled) |
507 | + if (!READ_ONCE(cipso_v4_cache_enabled)) |
508 | return -ENOENT; |
509 | |
510 | hash = cipso_v4_map_cache_hash(key, key_len); |
511 | @@ -311,13 +311,14 @@ static int cipso_v4_cache_check(const unsigned char *key, |
512 | int cipso_v4_cache_add(const unsigned char *cipso_ptr, |
513 | const struct netlbl_lsm_secattr *secattr) |
514 | { |
515 | + int bkt_size = READ_ONCE(cipso_v4_cache_bucketsize); |
516 | int ret_val = -EPERM; |
517 | u32 bkt; |
518 | struct cipso_v4_map_cache_entry *entry = NULL; |
519 | struct cipso_v4_map_cache_entry *old_entry = NULL; |
520 | u32 cipso_ptr_len; |
521 | |
522 | - if (!cipso_v4_cache_enabled || cipso_v4_cache_bucketsize <= 0) |
523 | + if (!READ_ONCE(cipso_v4_cache_enabled) || bkt_size <= 0) |
524 | return 0; |
525 | |
526 | cipso_ptr_len = cipso_ptr[1]; |
527 | @@ -337,7 +338,7 @@ int cipso_v4_cache_add(const unsigned char *cipso_ptr, |
528 | |
529 | bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1); |
530 | spin_lock_bh(&cipso_v4_cache[bkt].lock); |
531 | - if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) { |
532 | + if (cipso_v4_cache[bkt].size < bkt_size) { |
533 | list_add(&entry->list, &cipso_v4_cache[bkt].list); |
534 | cipso_v4_cache[bkt].size += 1; |
535 | } else { |
536 | @@ -1214,7 +1215,8 @@ static int cipso_v4_gentag_rbm(const struct cipso_v4_doi *doi_def, |
537 | /* This will send packets using the "optimized" format when |
538 | * possible as specified in section 3.4.2.6 of the |
539 | * CIPSO draft. */ |
540 | - if (cipso_v4_rbm_optfmt && ret_val > 0 && ret_val <= 10) |
541 | + if (READ_ONCE(cipso_v4_rbm_optfmt) && ret_val > 0 && |
542 | + ret_val <= 10) |
543 | tag_len = 14; |
544 | else |
545 | tag_len = 4 + ret_val; |
546 | @@ -1617,7 +1619,7 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option) |
547 | * all the CIPSO validations here but it doesn't |
548 | * really specify _exactly_ what we need to validate |
549 | * ... so, just make it a sysctl tunable. */ |
550 | - if (cipso_v4_rbm_strictvalid) { |
551 | + if (READ_ONCE(cipso_v4_rbm_strictvalid)) { |
552 | if (cipso_v4_map_lvl_valid(doi_def, |
553 | tag[3]) < 0) { |
554 | err_offset = opt_iter + 3; |
555 | diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c |
556 | index e27ebd00bff26..ada92153b0dba 100644 |
557 | --- a/net/ipv4/icmp.c |
558 | +++ b/net/ipv4/icmp.c |
559 | @@ -268,11 +268,12 @@ bool icmp_global_allow(void) |
560 | spin_lock(&icmp_global.lock); |
561 | delta = min_t(u32, now - icmp_global.stamp, HZ); |
562 | if (delta >= HZ / 50) { |
563 | - incr = sysctl_icmp_msgs_per_sec * delta / HZ ; |
564 | + incr = READ_ONCE(sysctl_icmp_msgs_per_sec) * delta / HZ; |
565 | if (incr) |
566 | WRITE_ONCE(icmp_global.stamp, now); |
567 | } |
568 | - credit = min_t(u32, icmp_global.credit + incr, sysctl_icmp_msgs_burst); |
569 | + credit = min_t(u32, icmp_global.credit + incr, |
570 | + READ_ONCE(sysctl_icmp_msgs_burst)); |
571 | if (credit) { |
572 | /* We want to use a credit of one in average, but need to randomize |
573 | * it for security reasons. |
574 | diff --git a/net/tipc/socket.c b/net/tipc/socket.c |
575 | index 9f39276e5d4e2..1b35163680576 100644 |
576 | --- a/net/tipc/socket.c |
577 | +++ b/net/tipc/socket.c |
578 | @@ -341,6 +341,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock, |
579 | sock->state = state; |
580 | sock_init_data(sock, sk); |
581 | if (tipc_sk_insert(tsk)) { |
582 | + sk_free(sk); |
583 | pr_warn("Socket create failed; port number exhausted\n"); |
584 | return -EINVAL; |
585 | } |
586 | diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
587 | index 58f03b0bb4c46..8c7166f8b2951 100644 |
588 | --- a/sound/pci/hda/patch_realtek.c |
589 | +++ b/sound/pci/hda/patch_realtek.c |
590 | @@ -5709,6 +5709,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
591 | SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS), |
592 | SND_PCI_QUIRK(0x1025, 0x106d, "Acer Cloudbook 14", ALC283_FIXUP_CHROME_BOOK), |
593 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
594 | + SND_PCI_QUIRK(0x1028, 0x053c, "Dell Latitude E5430", ALC292_FIXUP_DELL_E7X), |
595 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
596 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
597 | SND_PCI_QUIRK(0x1028, 0x05be, "Dell Latitude E6540", ALC292_FIXUP_DELL_E7X), |
598 | diff --git a/sound/soc/codecs/wm5110.c b/sound/soc/codecs/wm5110.c |
599 | index 06bae3b23fced..2b0342bcede42 100644 |
600 | --- a/sound/soc/codecs/wm5110.c |
601 | +++ b/sound/soc/codecs/wm5110.c |
602 | @@ -404,6 +404,7 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, |
603 | unsigned int rnew = (!!ucontrol->value.integer.value[1]) << mc->rshift; |
604 | unsigned int lold, rold; |
605 | unsigned int lena, rena; |
606 | + bool change = false; |
607 | int ret; |
608 | |
609 | snd_soc_dapm_mutex_lock(dapm); |
610 | @@ -431,8 +432,8 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, |
611 | goto err; |
612 | } |
613 | |
614 | - ret = regmap_update_bits(arizona->regmap, ARIZONA_DRE_ENABLE, |
615 | - mask, lnew | rnew); |
616 | + ret = regmap_update_bits_check(arizona->regmap, ARIZONA_DRE_ENABLE, |
617 | + mask, lnew | rnew, &change); |
618 | if (ret) { |
619 | dev_err(arizona->dev, "Failed to set DRE: %d\n", ret); |
620 | goto err; |
621 | @@ -445,6 +446,9 @@ static int wm5110_put_dre(struct snd_kcontrol *kcontrol, |
622 | if (!rnew && rold) |
623 | wm5110_clear_pga_volume(arizona, mc->rshift); |
624 | |
625 | + if (change) |
626 | + ret = 1; |
627 | + |
628 | err: |
629 | snd_soc_dapm_mutex_unlock(dapm); |
630 | |
631 | diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c |
632 | index 90ba5521c189d..4fda8c24be291 100644 |
633 | --- a/sound/soc/soc-ops.c |
634 | +++ b/sound/soc/soc-ops.c |
635 | @@ -535,7 +535,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, |
636 | return -EINVAL; |
637 | if (mc->platform_max && tmp > mc->platform_max) |
638 | return -EINVAL; |
639 | - if (tmp > mc->max - mc->min + 1) |
640 | + if (tmp > mc->max - mc->min) |
641 | return -EINVAL; |
642 | |
643 | if (invert) |
644 | @@ -556,7 +556,7 @@ int snd_soc_put_volsw_range(struct snd_kcontrol *kcontrol, |
645 | return -EINVAL; |
646 | if (mc->platform_max && tmp > mc->platform_max) |
647 | return -EINVAL; |
648 | - if (tmp > mc->max - mc->min + 1) |
649 | + if (tmp > mc->max - mc->min) |
650 | return -EINVAL; |
651 | |
652 | if (invert) |