1 |
commit: b0611d5c9d1558bdbc4eab0bd9d7b2179a7d2f3b |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 24 09:09:44 2017 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 24 09:09:44 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=b0611d5c |
7 |
|
8 |
linux kernel 4.14.2 |
9 |
|
10 |
0000_README | 4 + |
11 |
1001_linux-4.14.2.patch | 577 ++++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 581 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 5bfe726..1324e53 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -47,6 +47,10 @@ Patch: 1000_linux-4.14.1.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.14.1 |
21 |
|
22 |
+Patch: 1001_linux-4.14.2.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.14.2 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1001_linux-4.14.2.patch b/1001_linux-4.14.2.patch |
31 |
new file mode 100644 |
32 |
index 0000000..4098201 |
33 |
--- /dev/null |
34 |
+++ b/1001_linux-4.14.2.patch |
35 |
@@ -0,0 +1,577 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 01f9df1af256..75d89dc2b94a 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,7 +1,7 @@ |
41 |
+ # SPDX-License-Identifier: GPL-2.0 |
42 |
+ VERSION = 4 |
43 |
+ PATCHLEVEL = 14 |
44 |
+-SUBLEVEL = 1 |
45 |
++SUBLEVEL = 2 |
46 |
+ EXTRAVERSION = |
47 |
+ NAME = Petit Gorille |
48 |
+ |
49 |
+diff --git a/block/bio.c b/block/bio.c |
50 |
+index 101c2a9b5481..33fa6b4af312 100644 |
51 |
+--- a/block/bio.c |
52 |
++++ b/block/bio.c |
53 |
+@@ -597,6 +597,7 @@ void __bio_clone_fast(struct bio *bio, struct bio *bio_src) |
54 |
+ * so we don't set nor calculate new physical/hw segment counts here |
55 |
+ */ |
56 |
+ bio->bi_disk = bio_src->bi_disk; |
57 |
++ bio->bi_partno = bio_src->bi_partno; |
58 |
+ bio_set_flag(bio, BIO_CLONED); |
59 |
+ bio->bi_opf = bio_src->bi_opf; |
60 |
+ bio->bi_write_hint = bio_src->bi_write_hint; |
61 |
+diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c |
62 |
+index 810b138f5897..c82d9fd2f05a 100644 |
63 |
+--- a/drivers/char/ipmi/ipmi_msghandler.c |
64 |
++++ b/drivers/char/ipmi/ipmi_msghandler.c |
65 |
+@@ -4030,7 +4030,8 @@ smi_from_recv_msg(ipmi_smi_t intf, struct ipmi_recv_msg *recv_msg, |
66 |
+ } |
67 |
+ |
68 |
+ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent, |
69 |
+- struct list_head *timeouts, long timeout_period, |
70 |
++ struct list_head *timeouts, |
71 |
++ unsigned long timeout_period, |
72 |
+ int slot, unsigned long *flags, |
73 |
+ unsigned int *waiting_msgs) |
74 |
+ { |
75 |
+@@ -4043,8 +4044,8 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent, |
76 |
+ if (!ent->inuse) |
77 |
+ return; |
78 |
+ |
79 |
+- ent->timeout -= timeout_period; |
80 |
+- if (ent->timeout > 0) { |
81 |
++ if (timeout_period < ent->timeout) { |
82 |
++ ent->timeout -= timeout_period; |
83 |
+ (*waiting_msgs)++; |
84 |
+ return; |
85 |
+ } |
86 |
+@@ -4110,7 +4111,8 @@ static void check_msg_timeout(ipmi_smi_t intf, struct seq_table *ent, |
87 |
+ } |
88 |
+ } |
89 |
+ |
90 |
+-static unsigned int ipmi_timeout_handler(ipmi_smi_t intf, long timeout_period) |
91 |
++static unsigned int ipmi_timeout_handler(ipmi_smi_t intf, |
92 |
++ unsigned long timeout_period) |
93 |
+ { |
94 |
+ struct list_head timeouts; |
95 |
+ struct ipmi_recv_msg *msg, *msg2; |
96 |
+diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c |
97 |
+index 36f47e8d06a3..bc3984ffe867 100644 |
98 |
+--- a/drivers/char/ipmi/ipmi_si_intf.c |
99 |
++++ b/drivers/char/ipmi/ipmi_si_intf.c |
100 |
+@@ -3424,7 +3424,7 @@ static inline void wait_for_timer_and_thread(struct smi_info *smi_info) |
101 |
+ del_timer_sync(&smi_info->si_timer); |
102 |
+ } |
103 |
+ |
104 |
+-static int is_new_interface(struct smi_info *info) |
105 |
++static struct smi_info *find_dup_si(struct smi_info *info) |
106 |
+ { |
107 |
+ struct smi_info *e; |
108 |
+ |
109 |
+@@ -3439,24 +3439,36 @@ static int is_new_interface(struct smi_info *info) |
110 |
+ */ |
111 |
+ if (info->slave_addr && !e->slave_addr) |
112 |
+ e->slave_addr = info->slave_addr; |
113 |
+- return 0; |
114 |
++ return e; |
115 |
+ } |
116 |
+ } |
117 |
+ |
118 |
+- return 1; |
119 |
++ return NULL; |
120 |
+ } |
121 |
+ |
122 |
+ static int add_smi(struct smi_info *new_smi) |
123 |
+ { |
124 |
+ int rv = 0; |
125 |
++ struct smi_info *dup; |
126 |
+ |
127 |
+ mutex_lock(&smi_infos_lock); |
128 |
+- if (!is_new_interface(new_smi)) { |
129 |
+- pr_info(PFX "%s-specified %s state machine: duplicate\n", |
130 |
+- ipmi_addr_src_to_str(new_smi->addr_source), |
131 |
+- si_to_str[new_smi->si_type]); |
132 |
+- rv = -EBUSY; |
133 |
+- goto out_err; |
134 |
++ dup = find_dup_si(new_smi); |
135 |
++ if (dup) { |
136 |
++ if (new_smi->addr_source == SI_ACPI && |
137 |
++ dup->addr_source == SI_SMBIOS) { |
138 |
++ /* We prefer ACPI over SMBIOS. */ |
139 |
++ dev_info(dup->dev, |
140 |
++ "Removing SMBIOS-specified %s state machine in favor of ACPI\n", |
141 |
++ si_to_str[new_smi->si_type]); |
142 |
++ cleanup_one_si(dup); |
143 |
++ } else { |
144 |
++ dev_info(new_smi->dev, |
145 |
++ "%s-specified %s state machine: duplicate\n", |
146 |
++ ipmi_addr_src_to_str(new_smi->addr_source), |
147 |
++ si_to_str[new_smi->si_type]); |
148 |
++ rv = -EBUSY; |
149 |
++ goto out_err; |
150 |
++ } |
151 |
+ } |
152 |
+ |
153 |
+ pr_info(PFX "Adding %s-specified %s state machine\n", |
154 |
+@@ -3865,7 +3877,8 @@ static void cleanup_one_si(struct smi_info *to_clean) |
155 |
+ poll(to_clean); |
156 |
+ schedule_timeout_uninterruptible(1); |
157 |
+ } |
158 |
+- disable_si_irq(to_clean, false); |
159 |
++ if (to_clean->handlers) |
160 |
++ disable_si_irq(to_clean, false); |
161 |
+ while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) { |
162 |
+ poll(to_clean); |
163 |
+ schedule_timeout_uninterruptible(1); |
164 |
+diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c |
165 |
+index 610638a80383..461bf0b8a094 100644 |
166 |
+--- a/drivers/char/tpm/tpm-dev-common.c |
167 |
++++ b/drivers/char/tpm/tpm-dev-common.c |
168 |
+@@ -110,6 +110,12 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf, |
169 |
+ return -EFAULT; |
170 |
+ } |
171 |
+ |
172 |
++ if (in_size < 6 || |
173 |
++ in_size < be32_to_cpu(*((__be32 *) (priv->data_buffer + 2)))) { |
174 |
++ mutex_unlock(&priv->buffer_mutex); |
175 |
++ return -EINVAL; |
176 |
++ } |
177 |
++ |
178 |
+ /* atomic tpm command send and result receive. We only hold the ops |
179 |
+ * lock during this period so that the tpm can be unregistered even if |
180 |
+ * the char dev is held open. |
181 |
+diff --git a/drivers/net/ethernet/fealnx.c b/drivers/net/ethernet/fealnx.c |
182 |
+index e92859dab7ae..e191c4ebeaf4 100644 |
183 |
+--- a/drivers/net/ethernet/fealnx.c |
184 |
++++ b/drivers/net/ethernet/fealnx.c |
185 |
+@@ -257,8 +257,8 @@ enum rx_desc_status_bits { |
186 |
+ RXFSD = 0x00000800, /* first descriptor */ |
187 |
+ RXLSD = 0x00000400, /* last descriptor */ |
188 |
+ ErrorSummary = 0x80, /* error summary */ |
189 |
+- RUNT = 0x40, /* runt packet received */ |
190 |
+- LONG = 0x20, /* long packet received */ |
191 |
++ RUNTPKT = 0x40, /* runt packet received */ |
192 |
++ LONGPKT = 0x20, /* long packet received */ |
193 |
+ FAE = 0x10, /* frame align error */ |
194 |
+ CRC = 0x08, /* crc error */ |
195 |
+ RXER = 0x04, /* receive error */ |
196 |
+@@ -1632,7 +1632,7 @@ static int netdev_rx(struct net_device *dev) |
197 |
+ dev->name, rx_status); |
198 |
+ |
199 |
+ dev->stats.rx_errors++; /* end of a packet. */ |
200 |
+- if (rx_status & (LONG | RUNT)) |
201 |
++ if (rx_status & (LONGPKT | RUNTPKT)) |
202 |
+ dev->stats.rx_length_errors++; |
203 |
+ if (rx_status & RXER) |
204 |
+ dev->stats.rx_frame_errors++; |
205 |
+diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c |
206 |
+index 47cab1bde065..9e1b74590682 100644 |
207 |
+--- a/drivers/net/usb/cdc_ncm.c |
208 |
++++ b/drivers/net/usb/cdc_ncm.c |
209 |
+@@ -771,7 +771,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ |
210 |
+ int err; |
211 |
+ u8 iface_no; |
212 |
+ struct usb_cdc_parsed_header hdr; |
213 |
+- u16 curr_ntb_format; |
214 |
++ __le16 curr_ntb_format; |
215 |
+ |
216 |
+ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); |
217 |
+ if (!ctx) |
218 |
+@@ -889,7 +889,7 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ |
219 |
+ goto error2; |
220 |
+ } |
221 |
+ |
222 |
+- if (curr_ntb_format == USB_CDC_NCM_NTB32_FORMAT) { |
223 |
++ if (curr_ntb_format == cpu_to_le16(USB_CDC_NCM_NTB32_FORMAT)) { |
224 |
+ dev_info(&intf->dev, "resetting NTB format to 16-bit"); |
225 |
+ err = usbnet_write_cmd(dev, USB_CDC_SET_NTB_FORMAT, |
226 |
+ USB_TYPE_CLASS | USB_DIR_OUT |
227 |
+diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c |
228 |
+index d7c49cf1d5e9..a2f4e52fadb5 100644 |
229 |
+--- a/drivers/net/vxlan.c |
230 |
++++ b/drivers/net/vxlan.c |
231 |
+@@ -1623,26 +1623,19 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request, |
232 |
+ static int neigh_reduce(struct net_device *dev, struct sk_buff *skb, __be32 vni) |
233 |
+ { |
234 |
+ struct vxlan_dev *vxlan = netdev_priv(dev); |
235 |
+- struct nd_msg *msg; |
236 |
+- const struct ipv6hdr *iphdr; |
237 |
+ const struct in6_addr *daddr; |
238 |
+- struct neighbour *n; |
239 |
++ const struct ipv6hdr *iphdr; |
240 |
+ struct inet6_dev *in6_dev; |
241 |
++ struct neighbour *n; |
242 |
++ struct nd_msg *msg; |
243 |
+ |
244 |
+ in6_dev = __in6_dev_get(dev); |
245 |
+ if (!in6_dev) |
246 |
+ goto out; |
247 |
+ |
248 |
+- if (!pskb_may_pull(skb, sizeof(struct ipv6hdr) + sizeof(struct nd_msg))) |
249 |
+- goto out; |
250 |
+- |
251 |
+ iphdr = ipv6_hdr(skb); |
252 |
+ daddr = &iphdr->daddr; |
253 |
+- |
254 |
+ msg = (struct nd_msg *)(iphdr + 1); |
255 |
+- if (msg->icmph.icmp6_code != 0 || |
256 |
+- msg->icmph.icmp6_type != NDISC_NEIGHBOUR_SOLICITATION) |
257 |
+- goto out; |
258 |
+ |
259 |
+ if (ipv6_addr_loopback(daddr) || |
260 |
+ ipv6_addr_is_multicast(&msg->target)) |
261 |
+@@ -2240,11 +2233,11 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, |
262 |
+ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) |
263 |
+ { |
264 |
+ struct vxlan_dev *vxlan = netdev_priv(dev); |
265 |
++ struct vxlan_rdst *rdst, *fdst = NULL; |
266 |
+ const struct ip_tunnel_info *info; |
267 |
+- struct ethhdr *eth; |
268 |
+ bool did_rsc = false; |
269 |
+- struct vxlan_rdst *rdst, *fdst = NULL; |
270 |
+ struct vxlan_fdb *f; |
271 |
++ struct ethhdr *eth; |
272 |
+ __be32 vni = 0; |
273 |
+ |
274 |
+ info = skb_tunnel_info(skb); |
275 |
+@@ -2269,12 +2262,14 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) |
276 |
+ if (ntohs(eth->h_proto) == ETH_P_ARP) |
277 |
+ return arp_reduce(dev, skb, vni); |
278 |
+ #if IS_ENABLED(CONFIG_IPV6) |
279 |
+- else if (ntohs(eth->h_proto) == ETH_P_IPV6) { |
280 |
+- struct ipv6hdr *hdr, _hdr; |
281 |
+- if ((hdr = skb_header_pointer(skb, |
282 |
+- skb_network_offset(skb), |
283 |
+- sizeof(_hdr), &_hdr)) && |
284 |
+- hdr->nexthdr == IPPROTO_ICMPV6) |
285 |
++ else if (ntohs(eth->h_proto) == ETH_P_IPV6 && |
286 |
++ pskb_may_pull(skb, sizeof(struct ipv6hdr) + |
287 |
++ sizeof(struct nd_msg)) && |
288 |
++ ipv6_hdr(skb)->nexthdr == IPPROTO_ICMPV6) { |
289 |
++ struct nd_msg *m = (struct nd_msg *)(ipv6_hdr(skb) + 1); |
290 |
++ |
291 |
++ if (m->icmph.icmp6_code == 0 && |
292 |
++ m->icmph.icmp6_type == NDISC_NEIGHBOUR_SOLICITATION) |
293 |
+ return neigh_reduce(dev, skb, vni); |
294 |
+ } |
295 |
+ #endif |
296 |
+diff --git a/drivers/tty/serial/8250/8250_fintek.c b/drivers/tty/serial/8250/8250_fintek.c |
297 |
+index e500f7dd2470..4bd376c08b59 100644 |
298 |
+--- a/drivers/tty/serial/8250/8250_fintek.c |
299 |
++++ b/drivers/tty/serial/8250/8250_fintek.c |
300 |
+@@ -118,6 +118,9 @@ static int fintek_8250_enter_key(u16 base_port, u8 key) |
301 |
+ if (!request_muxed_region(base_port, 2, "8250_fintek")) |
302 |
+ return -EBUSY; |
303 |
+ |
304 |
++ /* Force to deactive all SuperIO in this base_port */ |
305 |
++ outb(EXIT_KEY, base_port + ADDR_PORT); |
306 |
++ |
307 |
+ outb(key, base_port + ADDR_PORT); |
308 |
+ outb(key, base_port + ADDR_PORT); |
309 |
+ return 0; |
310 |
+diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c |
311 |
+index 7754053deeda..26a22b100df1 100644 |
312 |
+--- a/drivers/tty/serial/omap-serial.c |
313 |
++++ b/drivers/tty/serial/omap-serial.c |
314 |
+@@ -693,7 +693,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl) |
315 |
+ if ((mctrl & TIOCM_RTS) && (port->status & UPSTAT_AUTORTS)) |
316 |
+ up->efr |= UART_EFR_RTS; |
317 |
+ else |
318 |
+- up->efr &= UART_EFR_RTS; |
319 |
++ up->efr &= ~UART_EFR_RTS; |
320 |
+ serial_out(up, UART_EFR, up->efr); |
321 |
+ serial_out(up, UART_LCR, lcr); |
322 |
+ |
323 |
+diff --git a/fs/coda/upcall.c b/fs/coda/upcall.c |
324 |
+index a37f003530d7..1175a1722411 100644 |
325 |
+--- a/fs/coda/upcall.c |
326 |
++++ b/fs/coda/upcall.c |
327 |
+@@ -447,8 +447,7 @@ int venus_fsync(struct super_block *sb, struct CodaFid *fid) |
328 |
+ UPARG(CODA_FSYNC); |
329 |
+ |
330 |
+ inp->coda_fsync.VFid = *fid; |
331 |
+- error = coda_upcall(coda_vcp(sb), sizeof(union inputArgs), |
332 |
+- &outsize, inp); |
333 |
++ error = coda_upcall(coda_vcp(sb), insize, &outsize, inp); |
334 |
+ |
335 |
+ CODA_FREE(inp, insize); |
336 |
+ return error; |
337 |
+diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c |
338 |
+index 74407c6dd592..ec8f75813beb 100644 |
339 |
+--- a/fs/ocfs2/dlm/dlmrecovery.c |
340 |
++++ b/fs/ocfs2/dlm/dlmrecovery.c |
341 |
+@@ -2419,6 +2419,7 @@ static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node) |
342 |
+ dlm_lockres_put(res); |
343 |
+ continue; |
344 |
+ } |
345 |
++ dlm_move_lockres_to_recovery_list(dlm, res); |
346 |
+ } else if (res->owner == dlm->node_num) { |
347 |
+ dlm_free_dead_locks(dlm, res, dead_node); |
348 |
+ __dlm_lockres_calc_usage(dlm, res); |
349 |
+diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c |
350 |
+index 6e41fc8fabbe..dc455d45a66a 100644 |
351 |
+--- a/fs/ocfs2/file.c |
352 |
++++ b/fs/ocfs2/file.c |
353 |
+@@ -1161,6 +1161,13 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) |
354 |
+ } |
355 |
+ size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE; |
356 |
+ if (size_change) { |
357 |
++ /* |
358 |
++ * Here we should wait dio to finish before inode lock |
359 |
++ * to avoid a deadlock between ocfs2_setattr() and |
360 |
++ * ocfs2_dio_end_io_write() |
361 |
++ */ |
362 |
++ inode_dio_wait(inode); |
363 |
++ |
364 |
+ status = ocfs2_rw_lock(inode, 1); |
365 |
+ if (status < 0) { |
366 |
+ mlog_errno(status); |
367 |
+@@ -1200,8 +1207,6 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) |
368 |
+ if (status) |
369 |
+ goto bail_unlock; |
370 |
+ |
371 |
+- inode_dio_wait(inode); |
372 |
+- |
373 |
+ if (i_size_read(inode) >= attr->ia_size) { |
374 |
+ if (ocfs2_should_order_data(inode)) { |
375 |
+ status = ocfs2_begin_ordered_truncate(inode, |
376 |
+diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h |
377 |
+index c9c4a81b9767..18b06983131a 100644 |
378 |
+--- a/include/linux/mmzone.h |
379 |
++++ b/include/linux/mmzone.h |
380 |
+@@ -700,7 +700,8 @@ typedef struct pglist_data { |
381 |
+ * is the first PFN that needs to be initialised. |
382 |
+ */ |
383 |
+ unsigned long first_deferred_pfn; |
384 |
+- unsigned long static_init_size; |
385 |
++ /* Number of non-deferred pages */ |
386 |
++ unsigned long static_init_pgcnt; |
387 |
+ #endif /* CONFIG_DEFERRED_STRUCT_PAGE_INIT */ |
388 |
+ |
389 |
+ #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
390 |
+diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h |
391 |
+index e012b9be777e..fed95fa941e6 100644 |
392 |
+--- a/kernel/rcu/tree_plugin.h |
393 |
++++ b/kernel/rcu/tree_plugin.h |
394 |
+@@ -1507,7 +1507,7 @@ static void rcu_prepare_for_idle(void) |
395 |
+ rdtp->last_accelerate = jiffies; |
396 |
+ for_each_rcu_flavor(rsp) { |
397 |
+ rdp = this_cpu_ptr(rsp->rda); |
398 |
+- if (rcu_segcblist_pend_cbs(&rdp->cblist)) |
399 |
++ if (!rcu_segcblist_pend_cbs(&rdp->cblist)) |
400 |
+ continue; |
401 |
+ rnp = rdp->mynode; |
402 |
+ raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */ |
403 |
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c |
404 |
+index 77e4d3c5c57b..82a6270c9743 100644 |
405 |
+--- a/mm/page_alloc.c |
406 |
++++ b/mm/page_alloc.c |
407 |
+@@ -290,28 +290,37 @@ EXPORT_SYMBOL(nr_online_nodes); |
408 |
+ int page_group_by_mobility_disabled __read_mostly; |
409 |
+ |
410 |
+ #ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT |
411 |
++ |
412 |
++/* |
413 |
++ * Determine how many pages need to be initialized durig early boot |
414 |
++ * (non-deferred initialization). |
415 |
++ * The value of first_deferred_pfn will be set later, once non-deferred pages |
416 |
++ * are initialized, but for now set it ULONG_MAX. |
417 |
++ */ |
418 |
+ static inline void reset_deferred_meminit(pg_data_t *pgdat) |
419 |
+ { |
420 |
+- unsigned long max_initialise; |
421 |
+- unsigned long reserved_lowmem; |
422 |
++ phys_addr_t start_addr, end_addr; |
423 |
++ unsigned long max_pgcnt; |
424 |
++ unsigned long reserved; |
425 |
+ |
426 |
+ /* |
427 |
+ * Initialise at least 2G of a node but also take into account that |
428 |
+ * two large system hashes that can take up 1GB for 0.25TB/node. |
429 |
+ */ |
430 |
+- max_initialise = max(2UL << (30 - PAGE_SHIFT), |
431 |
+- (pgdat->node_spanned_pages >> 8)); |
432 |
++ max_pgcnt = max(2UL << (30 - PAGE_SHIFT), |
433 |
++ (pgdat->node_spanned_pages >> 8)); |
434 |
+ |
435 |
+ /* |
436 |
+ * Compensate the all the memblock reservations (e.g. crash kernel) |
437 |
+ * from the initial estimation to make sure we will initialize enough |
438 |
+ * memory to boot. |
439 |
+ */ |
440 |
+- reserved_lowmem = memblock_reserved_memory_within(pgdat->node_start_pfn, |
441 |
+- pgdat->node_start_pfn + max_initialise); |
442 |
+- max_initialise += reserved_lowmem; |
443 |
++ start_addr = PFN_PHYS(pgdat->node_start_pfn); |
444 |
++ end_addr = PFN_PHYS(pgdat->node_start_pfn + max_pgcnt); |
445 |
++ reserved = memblock_reserved_memory_within(start_addr, end_addr); |
446 |
++ max_pgcnt += PHYS_PFN(reserved); |
447 |
+ |
448 |
+- pgdat->static_init_size = min(max_initialise, pgdat->node_spanned_pages); |
449 |
++ pgdat->static_init_pgcnt = min(max_pgcnt, pgdat->node_spanned_pages); |
450 |
+ pgdat->first_deferred_pfn = ULONG_MAX; |
451 |
+ } |
452 |
+ |
453 |
+@@ -338,7 +347,7 @@ static inline bool update_defer_init(pg_data_t *pgdat, |
454 |
+ if (zone_end < pgdat_end_pfn(pgdat)) |
455 |
+ return true; |
456 |
+ (*nr_initialised)++; |
457 |
+- if ((*nr_initialised > pgdat->static_init_size) && |
458 |
++ if ((*nr_initialised > pgdat->static_init_pgcnt) && |
459 |
+ (pfn & (PAGES_PER_SECTION - 1)) == 0) { |
460 |
+ pgdat->first_deferred_pfn = pfn; |
461 |
+ return false; |
462 |
+diff --git a/mm/page_ext.c b/mm/page_ext.c |
463 |
+index 4f0367d472c4..2c16216c29b6 100644 |
464 |
+--- a/mm/page_ext.c |
465 |
++++ b/mm/page_ext.c |
466 |
+@@ -125,7 +125,6 @@ struct page_ext *lookup_page_ext(struct page *page) |
467 |
+ struct page_ext *base; |
468 |
+ |
469 |
+ base = NODE_DATA(page_to_nid(page))->node_page_ext; |
470 |
+-#if defined(CONFIG_DEBUG_VM) |
471 |
+ /* |
472 |
+ * The sanity checks the page allocator does upon freeing a |
473 |
+ * page can reach here before the page_ext arrays are |
474 |
+@@ -134,7 +133,6 @@ struct page_ext *lookup_page_ext(struct page *page) |
475 |
+ */ |
476 |
+ if (unlikely(!base)) |
477 |
+ return NULL; |
478 |
+-#endif |
479 |
+ index = pfn - round_down(node_start_pfn(page_to_nid(page)), |
480 |
+ MAX_ORDER_NR_PAGES); |
481 |
+ return get_entry(base, index); |
482 |
+@@ -199,7 +197,6 @@ struct page_ext *lookup_page_ext(struct page *page) |
483 |
+ { |
484 |
+ unsigned long pfn = page_to_pfn(page); |
485 |
+ struct mem_section *section = __pfn_to_section(pfn); |
486 |
+-#if defined(CONFIG_DEBUG_VM) |
487 |
+ /* |
488 |
+ * The sanity checks the page allocator does upon freeing a |
489 |
+ * page can reach here before the page_ext arrays are |
490 |
+@@ -208,7 +205,6 @@ struct page_ext *lookup_page_ext(struct page *page) |
491 |
+ */ |
492 |
+ if (!section->page_ext) |
493 |
+ return NULL; |
494 |
+-#endif |
495 |
+ return get_entry(section->page_ext, pfn); |
496 |
+ } |
497 |
+ |
498 |
+diff --git a/mm/pagewalk.c b/mm/pagewalk.c |
499 |
+index 8bd4afa83cb8..23a3e415ac2c 100644 |
500 |
+--- a/mm/pagewalk.c |
501 |
++++ b/mm/pagewalk.c |
502 |
+@@ -188,8 +188,12 @@ static int walk_hugetlb_range(unsigned long addr, unsigned long end, |
503 |
+ do { |
504 |
+ next = hugetlb_entry_end(h, addr, end); |
505 |
+ pte = huge_pte_offset(walk->mm, addr & hmask, sz); |
506 |
+- if (pte && walk->hugetlb_entry) |
507 |
++ |
508 |
++ if (pte) |
509 |
+ err = walk->hugetlb_entry(pte, hmask, addr, next, walk); |
510 |
++ else if (walk->pte_hole) |
511 |
++ err = walk->pte_hole(addr, next, walk); |
512 |
++ |
513 |
+ if (err) |
514 |
+ break; |
515 |
+ } while (addr = next, addr != end); |
516 |
+diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c |
517 |
+index b93148e8e9fb..15c99dfa3d72 100644 |
518 |
+--- a/net/netlink/af_netlink.c |
519 |
++++ b/net/netlink/af_netlink.c |
520 |
+@@ -2136,7 +2136,7 @@ static int netlink_dump(struct sock *sk) |
521 |
+ struct sk_buff *skb = NULL; |
522 |
+ struct nlmsghdr *nlh; |
523 |
+ struct module *module; |
524 |
+- int len, err = -ENOBUFS; |
525 |
++ int err = -ENOBUFS; |
526 |
+ int alloc_min_size; |
527 |
+ int alloc_size; |
528 |
+ |
529 |
+@@ -2183,9 +2183,11 @@ static int netlink_dump(struct sock *sk) |
530 |
+ skb_reserve(skb, skb_tailroom(skb) - alloc_size); |
531 |
+ netlink_skb_set_owner_r(skb, sk); |
532 |
+ |
533 |
+- len = cb->dump(skb, cb); |
534 |
++ if (nlk->dump_done_errno > 0) |
535 |
++ nlk->dump_done_errno = cb->dump(skb, cb); |
536 |
+ |
537 |
+- if (len > 0) { |
538 |
++ if (nlk->dump_done_errno > 0 || |
539 |
++ skb_tailroom(skb) < nlmsg_total_size(sizeof(nlk->dump_done_errno))) { |
540 |
+ mutex_unlock(nlk->cb_mutex); |
541 |
+ |
542 |
+ if (sk_filter(sk, skb)) |
543 |
+@@ -2195,13 +2197,15 @@ static int netlink_dump(struct sock *sk) |
544 |
+ return 0; |
545 |
+ } |
546 |
+ |
547 |
+- nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE, sizeof(len), NLM_F_MULTI); |
548 |
+- if (!nlh) |
549 |
++ nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE, |
550 |
++ sizeof(nlk->dump_done_errno), NLM_F_MULTI); |
551 |
++ if (WARN_ON(!nlh)) |
552 |
+ goto errout_skb; |
553 |
+ |
554 |
+ nl_dump_check_consistent(cb, nlh); |
555 |
+ |
556 |
+- memcpy(nlmsg_data(nlh), &len, sizeof(len)); |
557 |
++ memcpy(nlmsg_data(nlh), &nlk->dump_done_errno, |
558 |
++ sizeof(nlk->dump_done_errno)); |
559 |
+ |
560 |
+ if (sk_filter(sk, skb)) |
561 |
+ kfree_skb(skb); |
562 |
+@@ -2273,6 +2277,7 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
563 |
+ } |
564 |
+ |
565 |
+ nlk->cb_running = true; |
566 |
++ nlk->dump_done_errno = INT_MAX; |
567 |
+ |
568 |
+ mutex_unlock(nlk->cb_mutex); |
569 |
+ |
570 |
+diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h |
571 |
+index 028188597eaa..962de7b3c023 100644 |
572 |
+--- a/net/netlink/af_netlink.h |
573 |
++++ b/net/netlink/af_netlink.h |
574 |
+@@ -34,6 +34,7 @@ struct netlink_sock { |
575 |
+ wait_queue_head_t wait; |
576 |
+ bool bound; |
577 |
+ bool cb_running; |
578 |
++ int dump_done_errno; |
579 |
+ struct netlink_callback cb; |
580 |
+ struct mutex *cb_mutex; |
581 |
+ struct mutex cb_def_mutex; |
582 |
+diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c |
583 |
+index a6dfa86c0201..3b18085e3b10 100644 |
584 |
+--- a/net/sctp/ipv6.c |
585 |
++++ b/net/sctp/ipv6.c |
586 |
+@@ -807,9 +807,10 @@ static void sctp_inet6_skb_msgname(struct sk_buff *skb, char *msgname, |
587 |
+ addr->v6.sin6_flowinfo = 0; |
588 |
+ addr->v6.sin6_port = sh->source; |
589 |
+ addr->v6.sin6_addr = ipv6_hdr(skb)->saddr; |
590 |
+- if (ipv6_addr_type(&addr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) { |
591 |
++ if (ipv6_addr_type(&addr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) |
592 |
+ addr->v6.sin6_scope_id = sctp_v6_skb_iif(skb); |
593 |
+- } |
594 |
++ else |
595 |
++ addr->v6.sin6_scope_id = 0; |
596 |
+ } |
597 |
+ |
598 |
+ *addr_len = sctp_v6_addr_to_user(sctp_sk(skb->sk), addr); |
599 |
+diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c |
600 |
+index 809ba70fbbbf..7d769b948de8 100644 |
601 |
+--- a/security/integrity/ima/ima_appraise.c |
602 |
++++ b/security/integrity/ima/ima_appraise.c |
603 |
+@@ -320,6 +320,9 @@ void ima_update_xattr(struct integrity_iint_cache *iint, struct file *file) |
604 |
+ if (iint->flags & IMA_DIGSIG) |
605 |
+ return; |
606 |
+ |
607 |
++ if (iint->ima_file_status != INTEGRITY_PASS) |
608 |
++ return; |
609 |
++ |
610 |
+ rc = ima_collect_measurement(iint, file, NULL, 0, ima_hash_algo); |
611 |
+ if (rc < 0) |
612 |
+ return; |