1 |
commit: 19f99a810422a2dcd9b35dd90d9ded694826c9b7 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 10 11:09:02 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 10 11:09:02 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=19f99a81 |
7 |
|
8 |
Linux patch 4.4.272 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1271_linux-4.4.272.patch | 777 +++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 781 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 2d08a79..7e612db 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1127,6 +1127,10 @@ Patch: 1270_linux-4.4.271.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 4.4.271 |
23 |
|
24 |
+Patch: 1271_linux-4.4.272.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 4.4.272 |
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/1271_linux-4.4.272.patch b/1271_linux-4.4.272.patch |
33 |
new file mode 100644 |
34 |
index 0000000..e55b30d |
35 |
--- /dev/null |
36 |
+++ b/1271_linux-4.4.272.patch |
37 |
@@ -0,0 +1,777 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 8f6f408a8635a..426b4c2bf0e72 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,6 +1,6 @@ |
43 |
+ VERSION = 4 |
44 |
+ PATCHLEVEL = 4 |
45 |
+-SUBLEVEL = 271 |
46 |
++SUBLEVEL = 272 |
47 |
+ EXTRAVERSION = |
48 |
+ NAME = Blurry Fish Butt |
49 |
+ |
50 |
+diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c |
51 |
+index 02710f99c1374..a8c0fd0574fa2 100644 |
52 |
+--- a/arch/arm64/kernel/traps.c |
53 |
++++ b/arch/arm64/kernel/traps.c |
54 |
+@@ -381,14 +381,6 @@ asmlinkage long do_ni_syscall(struct pt_regs *regs) |
55 |
+ } |
56 |
+ #endif |
57 |
+ |
58 |
+- if (show_unhandled_signals_ratelimited()) { |
59 |
+- pr_info("%s[%d]: syscall %d\n", current->comm, |
60 |
+- task_pid_nr(current), (int)regs->syscallno); |
61 |
+- dump_instr("", regs); |
62 |
+- if (user_mode(regs)) |
63 |
+- __show_regs(regs); |
64 |
+- } |
65 |
+- |
66 |
+ return sys_ni_syscall(); |
67 |
+ } |
68 |
+ |
69 |
+diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c |
70 |
+index 6938a62a3df4b..931acac69703e 100644 |
71 |
+--- a/arch/x86/kvm/svm.c |
72 |
++++ b/arch/x86/kvm/svm.c |
73 |
+@@ -2927,7 +2927,7 @@ static int cr_interception(struct vcpu_svm *svm) |
74 |
+ err = 0; |
75 |
+ if (cr >= 16) { /* mov to cr */ |
76 |
+ cr -= 16; |
77 |
+- val = kvm_register_read(&svm->vcpu, reg); |
78 |
++ val = kvm_register_readl(&svm->vcpu, reg); |
79 |
+ switch (cr) { |
80 |
+ case 0: |
81 |
+ if (!check_selective_cr0_intercepted(svm, val)) |
82 |
+@@ -2972,7 +2972,7 @@ static int cr_interception(struct vcpu_svm *svm) |
83 |
+ kvm_queue_exception(&svm->vcpu, UD_VECTOR); |
84 |
+ return 1; |
85 |
+ } |
86 |
+- kvm_register_write(&svm->vcpu, reg, val); |
87 |
++ kvm_register_writel(&svm->vcpu, reg, val); |
88 |
+ } |
89 |
+ kvm_complete_insn_gp(&svm->vcpu, err); |
90 |
+ |
91 |
+@@ -3004,13 +3004,13 @@ static int dr_interception(struct vcpu_svm *svm) |
92 |
+ if (dr >= 16) { /* mov to DRn */ |
93 |
+ if (!kvm_require_dr(&svm->vcpu, dr - 16)) |
94 |
+ return 1; |
95 |
+- val = kvm_register_read(&svm->vcpu, reg); |
96 |
++ val = kvm_register_readl(&svm->vcpu, reg); |
97 |
+ kvm_set_dr(&svm->vcpu, dr - 16, val); |
98 |
+ } else { |
99 |
+ if (!kvm_require_dr(&svm->vcpu, dr)) |
100 |
+ return 1; |
101 |
+ kvm_get_dr(&svm->vcpu, dr, &val); |
102 |
+- kvm_register_write(&svm->vcpu, reg, val); |
103 |
++ kvm_register_writel(&svm->vcpu, reg, val); |
104 |
+ } |
105 |
+ |
106 |
+ skip_emulated_instruction(&svm->vcpu); |
107 |
+diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c |
108 |
+index c0e54396f2502..dc8d2603612ed 100644 |
109 |
+--- a/drivers/firmware/efi/cper.c |
110 |
++++ b/drivers/firmware/efi/cper.c |
111 |
+@@ -257,8 +257,7 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg) |
112 |
+ if (!msg || !(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE)) |
113 |
+ return 0; |
114 |
+ |
115 |
+- n = 0; |
116 |
+- len = CPER_REC_LEN - 1; |
117 |
++ len = CPER_REC_LEN; |
118 |
+ dmi_memdev_name(mem->mem_dev_handle, &bank, &device); |
119 |
+ if (bank && device) |
120 |
+ n = snprintf(msg, len, "DIMM location: %s %s ", bank, device); |
121 |
+@@ -267,7 +266,6 @@ static int cper_dimm_err_location(struct cper_mem_err_compact *mem, char *msg) |
122 |
+ "DIMM location: not present. DMI handle: 0x%.4x ", |
123 |
+ mem->mem_dev_handle); |
124 |
+ |
125 |
+- msg[n] = '\0'; |
126 |
+ return n; |
127 |
+ } |
128 |
+ |
129 |
+diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c |
130 |
+index 08174d341f4a1..bc75f1efa0f4c 100644 |
131 |
+--- a/drivers/hid/usbhid/hid-pidff.c |
132 |
++++ b/drivers/hid/usbhid/hid-pidff.c |
133 |
+@@ -1304,6 +1304,7 @@ int hid_pidff_init(struct hid_device *hid) |
134 |
+ |
135 |
+ if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && |
136 |
+ pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { |
137 |
++ error = -EPERM; |
138 |
+ hid_notice(hid, |
139 |
+ "device does not support device managed pool\n"); |
140 |
+ goto fail; |
141 |
+diff --git a/drivers/vfio/pci/vfio_pci_config.c b/drivers/vfio/pci/vfio_pci_config.c |
142 |
+index 666b234acca0a..9891001244ea6 100644 |
143 |
+--- a/drivers/vfio/pci/vfio_pci_config.c |
144 |
++++ b/drivers/vfio/pci/vfio_pci_config.c |
145 |
+@@ -1488,7 +1488,7 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev) |
146 |
+ if (len == 0xFF) { |
147 |
+ len = vfio_ext_cap_len(vdev, ecap, epos); |
148 |
+ if (len < 0) |
149 |
+- return ret; |
150 |
++ return len; |
151 |
+ } |
152 |
+ } |
153 |
+ |
154 |
+diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c |
155 |
+index e65b142d34222..9b170ce160112 100644 |
156 |
+--- a/drivers/vfio/platform/vfio_platform_common.c |
157 |
++++ b/drivers/vfio/platform/vfio_platform_common.c |
158 |
+@@ -192,7 +192,7 @@ err_irq: |
159 |
+ vfio_platform_regions_cleanup(vdev); |
160 |
+ err_reg: |
161 |
+ mutex_unlock(&driver_lock); |
162 |
+- module_put(THIS_MODULE); |
163 |
++ module_put(vdev->parent_module); |
164 |
+ return ret; |
165 |
+ } |
166 |
+ |
167 |
+diff --git a/drivers/xen/xen-pciback/vpci.c b/drivers/xen/xen-pciback/vpci.c |
168 |
+index c99f8bb1c56c4..e6c7509a3d873 100644 |
169 |
+--- a/drivers/xen/xen-pciback/vpci.c |
170 |
++++ b/drivers/xen/xen-pciback/vpci.c |
171 |
+@@ -68,7 +68,7 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, |
172 |
+ struct pci_dev *dev, int devid, |
173 |
+ publish_pci_dev_cb publish_cb) |
174 |
+ { |
175 |
+- int err = 0, slot, func = -1; |
176 |
++ int err = 0, slot, func = PCI_FUNC(dev->devfn); |
177 |
+ struct pci_dev_entry *t, *dev_entry; |
178 |
+ struct vpci_dev_data *vpci_dev = pdev->pci_dev_data; |
179 |
+ |
180 |
+@@ -93,23 +93,26 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, |
181 |
+ |
182 |
+ /* |
183 |
+ * Keep multi-function devices together on the virtual PCI bus, except |
184 |
+- * virtual functions. |
185 |
++ * that we want to keep virtual functions at func 0 on their own. They |
186 |
++ * aren't multi-function devices and hence their presence at func 0 |
187 |
++ * may cause guests to not scan the other functions. |
188 |
+ */ |
189 |
+- if (!dev->is_virtfn) { |
190 |
++ if (!dev->is_virtfn || func) { |
191 |
+ for (slot = 0; slot < PCI_SLOT_MAX; slot++) { |
192 |
+ if (list_empty(&vpci_dev->dev_list[slot])) |
193 |
+ continue; |
194 |
+ |
195 |
+ t = list_entry(list_first(&vpci_dev->dev_list[slot]), |
196 |
+ struct pci_dev_entry, list); |
197 |
++ if (t->dev->is_virtfn && !PCI_FUNC(t->dev->devfn)) |
198 |
++ continue; |
199 |
+ |
200 |
+ if (match_slot(dev, t->dev)) { |
201 |
+ pr_info("vpci: %s: assign to virtual slot %d func %d\n", |
202 |
+ pci_name(dev), slot, |
203 |
+- PCI_FUNC(dev->devfn)); |
204 |
++ func); |
205 |
+ list_add_tail(&dev_entry->list, |
206 |
+ &vpci_dev->dev_list[slot]); |
207 |
+- func = PCI_FUNC(dev->devfn); |
208 |
+ goto unlock; |
209 |
+ } |
210 |
+ } |
211 |
+@@ -122,7 +125,6 @@ static int __xen_pcibk_add_pci_dev(struct xen_pcibk_device *pdev, |
212 |
+ pci_name(dev), slot); |
213 |
+ list_add_tail(&dev_entry->list, |
214 |
+ &vpci_dev->dev_list[slot]); |
215 |
+- func = dev->is_virtfn ? 0 : PCI_FUNC(dev->devfn); |
216 |
+ goto unlock; |
217 |
+ } |
218 |
+ } |
219 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
220 |
+index 4cab553c347a2..ff4df17832196 100644 |
221 |
+--- a/fs/btrfs/tree-log.c |
222 |
++++ b/fs/btrfs/tree-log.c |
223 |
+@@ -1511,6 +1511,7 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans, |
224 |
+ break; |
225 |
+ |
226 |
+ if (ret == 1) { |
227 |
++ ret = 0; |
228 |
+ if (path->slots[0] == 0) |
229 |
+ break; |
230 |
+ path->slots[0]--; |
231 |
+@@ -1523,17 +1524,19 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans, |
232 |
+ |
233 |
+ ret = btrfs_del_item(trans, root, path); |
234 |
+ if (ret) |
235 |
+- goto out; |
236 |
++ break; |
237 |
+ |
238 |
+ btrfs_release_path(path); |
239 |
+ inode = read_one_inode(root, key.offset); |
240 |
+- if (!inode) |
241 |
+- return -EIO; |
242 |
++ if (!inode) { |
243 |
++ ret = -EIO; |
244 |
++ break; |
245 |
++ } |
246 |
+ |
247 |
+ ret = fixup_inode_link_count(trans, root, inode); |
248 |
+ iput(inode); |
249 |
+ if (ret) |
250 |
+- goto out; |
251 |
++ break; |
252 |
+ |
253 |
+ /* |
254 |
+ * fixup on a directory may create new entries, |
255 |
+@@ -1542,8 +1545,6 @@ static noinline int fixup_inode_link_counts(struct btrfs_trans_handle *trans, |
256 |
+ */ |
257 |
+ key.offset = (u64)-1; |
258 |
+ } |
259 |
+- ret = 0; |
260 |
+-out: |
261 |
+ btrfs_release_path(path); |
262 |
+ return ret; |
263 |
+ } |
264 |
+diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c |
265 |
+index 71005a944151a..50f98d6a44169 100644 |
266 |
+--- a/fs/ext4/extents.c |
267 |
++++ b/fs/ext4/extents.c |
268 |
+@@ -3268,7 +3268,10 @@ static int ext4_split_extent_at(handle_t *handle, |
269 |
+ ext4_ext_mark_unwritten(ex2); |
270 |
+ |
271 |
+ err = ext4_ext_insert_extent(handle, inode, ppath, &newex, flags); |
272 |
+- if (err == -ENOSPC && (EXT4_EXT_MAY_ZEROOUT & split_flag)) { |
273 |
++ if (err != -ENOSPC && err != -EDQUOT) |
274 |
++ goto out; |
275 |
++ |
276 |
++ if (EXT4_EXT_MAY_ZEROOUT & split_flag) { |
277 |
+ if (split_flag & (EXT4_EXT_DATA_VALID1|EXT4_EXT_DATA_VALID2)) { |
278 |
+ if (split_flag & EXT4_EXT_DATA_VALID1) { |
279 |
+ err = ext4_ext_zeroout(inode, ex2); |
280 |
+@@ -3294,30 +3297,30 @@ static int ext4_split_extent_at(handle_t *handle, |
281 |
+ ext4_ext_pblock(&orig_ex)); |
282 |
+ } |
283 |
+ |
284 |
+- if (err) |
285 |
+- goto fix_extent_len; |
286 |
+- /* update the extent length and mark as initialized */ |
287 |
+- ex->ee_len = cpu_to_le16(ee_len); |
288 |
+- ext4_ext_try_to_merge(handle, inode, path, ex); |
289 |
+- err = ext4_ext_dirty(handle, inode, path + path->p_depth); |
290 |
+- if (err) |
291 |
+- goto fix_extent_len; |
292 |
+- |
293 |
+- /* update extent status tree */ |
294 |
+- err = ext4_zeroout_es(inode, &zero_ex); |
295 |
+- |
296 |
+- goto out; |
297 |
+- } else if (err) |
298 |
+- goto fix_extent_len; |
299 |
+- |
300 |
+-out: |
301 |
+- ext4_ext_show_leaf(inode, path); |
302 |
+- return err; |
303 |
++ if (!err) { |
304 |
++ /* update the extent length and mark as initialized */ |
305 |
++ ex->ee_len = cpu_to_le16(ee_len); |
306 |
++ ext4_ext_try_to_merge(handle, inode, path, ex); |
307 |
++ err = ext4_ext_dirty(handle, inode, path + path->p_depth); |
308 |
++ if (!err) |
309 |
++ /* update extent status tree */ |
310 |
++ err = ext4_zeroout_es(inode, &zero_ex); |
311 |
++ /* If we failed at this point, we don't know in which |
312 |
++ * state the extent tree exactly is so don't try to fix |
313 |
++ * length of the original extent as it may do even more |
314 |
++ * damage. |
315 |
++ */ |
316 |
++ goto out; |
317 |
++ } |
318 |
++ } |
319 |
+ |
320 |
+ fix_extent_len: |
321 |
+ ex->ee_len = orig_ex.ee_len; |
322 |
+ ext4_ext_dirty(handle, inode, path + path->p_depth); |
323 |
+ return err; |
324 |
++out: |
325 |
++ ext4_ext_show_leaf(inode, path); |
326 |
++ return err; |
327 |
+ } |
328 |
+ |
329 |
+ /* |
330 |
+diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c |
331 |
+index 1d738723a41ad..5b0f2c806f033 100644 |
332 |
+--- a/fs/ocfs2/file.c |
333 |
++++ b/fs/ocfs2/file.c |
334 |
+@@ -1859,6 +1859,45 @@ out: |
335 |
+ return ret; |
336 |
+ } |
337 |
+ |
338 |
++/* |
339 |
++ * zero out partial blocks of one cluster. |
340 |
++ * |
341 |
++ * start: file offset where zero starts, will be made upper block aligned. |
342 |
++ * len: it will be trimmed to the end of current cluster if "start + len" |
343 |
++ * is bigger than it. |
344 |
++ */ |
345 |
++static int ocfs2_zeroout_partial_cluster(struct inode *inode, |
346 |
++ u64 start, u64 len) |
347 |
++{ |
348 |
++ int ret; |
349 |
++ u64 start_block, end_block, nr_blocks; |
350 |
++ u64 p_block, offset; |
351 |
++ u32 cluster, p_cluster, nr_clusters; |
352 |
++ struct super_block *sb = inode->i_sb; |
353 |
++ u64 end = ocfs2_align_bytes_to_clusters(sb, start); |
354 |
++ |
355 |
++ if (start + len < end) |
356 |
++ end = start + len; |
357 |
++ |
358 |
++ start_block = ocfs2_blocks_for_bytes(sb, start); |
359 |
++ end_block = ocfs2_blocks_for_bytes(sb, end); |
360 |
++ nr_blocks = end_block - start_block; |
361 |
++ if (!nr_blocks) |
362 |
++ return 0; |
363 |
++ |
364 |
++ cluster = ocfs2_bytes_to_clusters(sb, start); |
365 |
++ ret = ocfs2_get_clusters(inode, cluster, &p_cluster, |
366 |
++ &nr_clusters, NULL); |
367 |
++ if (ret) |
368 |
++ return ret; |
369 |
++ if (!p_cluster) |
370 |
++ return 0; |
371 |
++ |
372 |
++ offset = start_block - ocfs2_clusters_to_blocks(sb, cluster); |
373 |
++ p_block = ocfs2_clusters_to_blocks(sb, p_cluster) + offset; |
374 |
++ return sb_issue_zeroout(sb, p_block, nr_blocks, GFP_NOFS); |
375 |
++} |
376 |
++ |
377 |
+ /* |
378 |
+ * Parts of this function taken from xfs_change_file_space() |
379 |
+ */ |
380 |
+@@ -1869,7 +1908,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, |
381 |
+ { |
382 |
+ int ret; |
383 |
+ s64 llen; |
384 |
+- loff_t size; |
385 |
++ loff_t size, orig_isize; |
386 |
+ struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
387 |
+ struct buffer_head *di_bh = NULL; |
388 |
+ handle_t *handle; |
389 |
+@@ -1900,6 +1939,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, |
390 |
+ goto out_inode_unlock; |
391 |
+ } |
392 |
+ |
393 |
++ orig_isize = i_size_read(inode); |
394 |
+ switch (sr->l_whence) { |
395 |
+ case 0: /*SEEK_SET*/ |
396 |
+ break; |
397 |
+@@ -1907,7 +1947,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, |
398 |
+ sr->l_start += f_pos; |
399 |
+ break; |
400 |
+ case 2: /*SEEK_END*/ |
401 |
+- sr->l_start += i_size_read(inode); |
402 |
++ sr->l_start += orig_isize; |
403 |
+ break; |
404 |
+ default: |
405 |
+ ret = -EINVAL; |
406 |
+@@ -1961,6 +2001,14 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, |
407 |
+ default: |
408 |
+ ret = -EINVAL; |
409 |
+ } |
410 |
++ |
411 |
++ /* zeroout eof blocks in the cluster. */ |
412 |
++ if (!ret && change_size && orig_isize < size) { |
413 |
++ ret = ocfs2_zeroout_partial_cluster(inode, orig_isize, |
414 |
++ size - orig_isize); |
415 |
++ if (!ret) |
416 |
++ i_size_write(inode, size); |
417 |
++ } |
418 |
+ up_write(&OCFS2_I(inode)->ip_alloc_sem); |
419 |
+ if (ret) { |
420 |
+ mlog_errno(ret); |
421 |
+@@ -1977,9 +2025,6 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, |
422 |
+ goto out_inode_unlock; |
423 |
+ } |
424 |
+ |
425 |
+- if (change_size && i_size_read(inode) < size) |
426 |
+- i_size_write(inode, size); |
427 |
+- |
428 |
+ inode->i_ctime = inode->i_mtime = CURRENT_TIME; |
429 |
+ ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); |
430 |
+ if (ret < 0) |
431 |
+diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h |
432 |
+index 028b754ae9b17..0baf2e21a533f 100644 |
433 |
+--- a/include/net/caif/caif_dev.h |
434 |
++++ b/include/net/caif/caif_dev.h |
435 |
+@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *adap_layer); |
436 |
+ * The link_support layer is used to add any Link Layer specific |
437 |
+ * framing. |
438 |
+ */ |
439 |
+-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
440 |
++int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
441 |
+ struct cflayer *link_support, int head_room, |
442 |
+ struct cflayer **layer, int (**rcv_func)( |
443 |
+ struct sk_buff *, struct net_device *, |
444 |
+diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h |
445 |
+index 70bfd017581fb..219094ace893c 100644 |
446 |
+--- a/include/net/caif/cfcnfg.h |
447 |
++++ b/include/net/caif/cfcnfg.h |
448 |
+@@ -62,7 +62,7 @@ void cfcnfg_remove(struct cfcnfg *cfg); |
449 |
+ * @fcs: Specify if checksum is used in CAIF Framing Layer. |
450 |
+ * @head_room: Head space needed by link specific protocol. |
451 |
+ */ |
452 |
+-void |
453 |
++int |
454 |
+ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, |
455 |
+ struct net_device *dev, struct cflayer *phy_layer, |
456 |
+ enum cfcnfg_phy_preference pref, |
457 |
+diff --git a/include/net/caif/cfserl.h b/include/net/caif/cfserl.h |
458 |
+index b5b020f3c72eb..bc3fae07a25f9 100644 |
459 |
+--- a/include/net/caif/cfserl.h |
460 |
++++ b/include/net/caif/cfserl.h |
461 |
+@@ -9,4 +9,5 @@ |
462 |
+ #include <net/caif/caif_layer.h> |
463 |
+ |
464 |
+ struct cflayer *cfserl_create(int instance, bool use_stx); |
465 |
++void cfserl_release(struct cflayer *layer); |
466 |
+ #endif |
467 |
+diff --git a/init/main.c b/init/main.c |
468 |
+index 88159063baa17..c982c4bb1e0ea 100644 |
469 |
+--- a/init/main.c |
470 |
++++ b/init/main.c |
471 |
+@@ -997,7 +997,7 @@ static noinline void __init kernel_init_freeable(void) |
472 |
+ */ |
473 |
+ set_cpus_allowed_ptr(current, cpu_all_mask); |
474 |
+ |
475 |
+- cad_pid = task_pid(current); |
476 |
++ cad_pid = get_pid(task_pid(current)); |
477 |
+ |
478 |
+ smp_prepare_cpus(setup_max_cpus); |
479 |
+ |
480 |
+diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c |
481 |
+index 81a81b9a3c7d0..041e719543fed 100644 |
482 |
+--- a/net/bluetooth/hci_core.c |
483 |
++++ b/net/bluetooth/hci_core.c |
484 |
+@@ -1555,8 +1555,13 @@ static int hci_dev_do_open(struct hci_dev *hdev) |
485 |
+ } else { |
486 |
+ /* Init failed, cleanup */ |
487 |
+ flush_work(&hdev->tx_work); |
488 |
+- flush_work(&hdev->cmd_work); |
489 |
++ |
490 |
++ /* Since hci_rx_work() is possible to awake new cmd_work |
491 |
++ * it should be flushed first to avoid unexpected call of |
492 |
++ * hci_cmd_work() |
493 |
++ */ |
494 |
+ flush_work(&hdev->rx_work); |
495 |
++ flush_work(&hdev->cmd_work); |
496 |
+ |
497 |
+ skb_queue_purge(&hdev->cmd_q); |
498 |
+ skb_queue_purge(&hdev->rx_q); |
499 |
+diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c |
500 |
+index ea1cd8b21708a..4ab69f6e910f6 100644 |
501 |
+--- a/net/bluetooth/hci_sock.c |
502 |
++++ b/net/bluetooth/hci_sock.c |
503 |
+@@ -483,7 +483,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event) |
504 |
+ /* Detach sockets from device */ |
505 |
+ read_lock(&hci_sk_list.lock); |
506 |
+ sk_for_each(sk, &hci_sk_list.head) { |
507 |
+- bh_lock_sock_nested(sk); |
508 |
++ lock_sock(sk); |
509 |
+ if (hci_pi(sk)->hdev == hdev) { |
510 |
+ hci_pi(sk)->hdev = NULL; |
511 |
+ sk->sk_err = EPIPE; |
512 |
+@@ -492,7 +492,7 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event) |
513 |
+ |
514 |
+ hci_dev_put(hdev); |
515 |
+ } |
516 |
+- bh_unlock_sock(sk); |
517 |
++ release_sock(sk); |
518 |
+ } |
519 |
+ read_unlock(&hci_sk_list.lock); |
520 |
+ } |
521 |
+diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c |
522 |
+index a0443d40d677c..a28ffbbf7450c 100644 |
523 |
+--- a/net/caif/caif_dev.c |
524 |
++++ b/net/caif/caif_dev.c |
525 |
+@@ -303,7 +303,7 @@ static void dev_flowctrl(struct net_device *dev, int on) |
526 |
+ caifd_put(caifd); |
527 |
+ } |
528 |
+ |
529 |
+-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
530 |
++int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
531 |
+ struct cflayer *link_support, int head_room, |
532 |
+ struct cflayer **layer, |
533 |
+ int (**rcv_func)(struct sk_buff *, struct net_device *, |
534 |
+@@ -314,11 +314,12 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
535 |
+ enum cfcnfg_phy_preference pref; |
536 |
+ struct cfcnfg *cfg = get_cfcnfg(dev_net(dev)); |
537 |
+ struct caif_device_entry_list *caifdevs; |
538 |
++ int res; |
539 |
+ |
540 |
+ caifdevs = caif_device_list(dev_net(dev)); |
541 |
+ caifd = caif_device_alloc(dev); |
542 |
+ if (!caifd) |
543 |
+- return; |
544 |
++ return -ENOMEM; |
545 |
+ *layer = &caifd->layer; |
546 |
+ spin_lock_init(&caifd->flow_lock); |
547 |
+ |
548 |
+@@ -340,7 +341,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
549 |
+ sizeof(caifd->layer.name) - 1); |
550 |
+ caifd->layer.name[sizeof(caifd->layer.name) - 1] = 0; |
551 |
+ caifd->layer.transmit = transmit; |
552 |
+- cfcnfg_add_phy_layer(cfg, |
553 |
++ res = cfcnfg_add_phy_layer(cfg, |
554 |
+ dev, |
555 |
+ &caifd->layer, |
556 |
+ pref, |
557 |
+@@ -350,6 +351,7 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, |
558 |
+ mutex_unlock(&caifdevs->lock); |
559 |
+ if (rcv_func) |
560 |
+ *rcv_func = receive; |
561 |
++ return res; |
562 |
+ } |
563 |
+ EXPORT_SYMBOL(caif_enroll_dev); |
564 |
+ |
565 |
+@@ -364,6 +366,7 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, |
566 |
+ struct cflayer *layer, *link_support; |
567 |
+ int head_room = 0; |
568 |
+ struct caif_device_entry_list *caifdevs; |
569 |
++ int res; |
570 |
+ |
571 |
+ cfg = get_cfcnfg(dev_net(dev)); |
572 |
+ caifdevs = caif_device_list(dev_net(dev)); |
573 |
+@@ -389,8 +392,10 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, |
574 |
+ break; |
575 |
+ } |
576 |
+ } |
577 |
+- caif_enroll_dev(dev, caifdev, link_support, head_room, |
578 |
++ res = caif_enroll_dev(dev, caifdev, link_support, head_room, |
579 |
+ &layer, NULL); |
580 |
++ if (res) |
581 |
++ cfserl_release(link_support); |
582 |
+ caifdev->flowctrl = dev_flowctrl; |
583 |
+ break; |
584 |
+ |
585 |
+diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c |
586 |
+index 5cd44f001f647..485dde566c1a9 100644 |
587 |
+--- a/net/caif/caif_usb.c |
588 |
++++ b/net/caif/caif_usb.c |
589 |
+@@ -116,6 +116,11 @@ static struct cflayer *cfusbl_create(int phyid, u8 ethaddr[ETH_ALEN], |
590 |
+ return (struct cflayer *) this; |
591 |
+ } |
592 |
+ |
593 |
++static void cfusbl_release(struct cflayer *layer) |
594 |
++{ |
595 |
++ kfree(layer); |
596 |
++} |
597 |
++ |
598 |
+ static struct packet_type caif_usb_type __read_mostly = { |
599 |
+ .type = cpu_to_be16(ETH_P_802_EX1), |
600 |
+ }; |
601 |
+@@ -128,6 +133,7 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what, |
602 |
+ struct cflayer *layer, *link_support; |
603 |
+ struct usbnet *usbnet; |
604 |
+ struct usb_device *usbdev; |
605 |
++ int res; |
606 |
+ |
607 |
+ /* Check whether we have a NCM device, and find its VID/PID. */ |
608 |
+ if (!(dev->dev.parent && dev->dev.parent->driver && |
609 |
+@@ -170,8 +176,11 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what, |
610 |
+ if (dev->num_tx_queues > 1) |
611 |
+ pr_warn("USB device uses more than one tx queue\n"); |
612 |
+ |
613 |
+- caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN, |
614 |
++ res = caif_enroll_dev(dev, &common, link_support, CFUSB_MAX_HEADLEN, |
615 |
+ &layer, &caif_usb_type.func); |
616 |
++ if (res) |
617 |
++ goto err; |
618 |
++ |
619 |
+ if (!pack_added) |
620 |
+ dev_add_pack(&caif_usb_type); |
621 |
+ pack_added = true; |
622 |
+@@ -181,6 +190,9 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what, |
623 |
+ layer->name[sizeof(layer->name) - 1] = 0; |
624 |
+ |
625 |
+ return 0; |
626 |
++err: |
627 |
++ cfusbl_release(link_support); |
628 |
++ return res; |
629 |
+ } |
630 |
+ |
631 |
+ static struct notifier_block caif_device_notifier = { |
632 |
+diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c |
633 |
+index fa39fc2987086..c45b531a6cd5c 100644 |
634 |
+--- a/net/caif/cfcnfg.c |
635 |
++++ b/net/caif/cfcnfg.c |
636 |
+@@ -455,7 +455,7 @@ unlock: |
637 |
+ rcu_read_unlock(); |
638 |
+ } |
639 |
+ |
640 |
+-void |
641 |
++int |
642 |
+ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, |
643 |
+ struct net_device *dev, struct cflayer *phy_layer, |
644 |
+ enum cfcnfg_phy_preference pref, |
645 |
+@@ -464,7 +464,7 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, |
646 |
+ { |
647 |
+ struct cflayer *frml; |
648 |
+ struct cfcnfg_phyinfo *phyinfo = NULL; |
649 |
+- int i; |
650 |
++ int i, res = 0; |
651 |
+ u8 phyid; |
652 |
+ |
653 |
+ mutex_lock(&cnfg->lock); |
654 |
+@@ -478,12 +478,15 @@ cfcnfg_add_phy_layer(struct cfcnfg *cnfg, |
655 |
+ goto got_phyid; |
656 |
+ } |
657 |
+ pr_warn("Too many CAIF Link Layers (max 6)\n"); |
658 |
++ res = -EEXIST; |
659 |
+ goto out; |
660 |
+ |
661 |
+ got_phyid: |
662 |
+ phyinfo = kzalloc(sizeof(struct cfcnfg_phyinfo), GFP_ATOMIC); |
663 |
+- if (!phyinfo) |
664 |
++ if (!phyinfo) { |
665 |
++ res = -ENOMEM; |
666 |
+ goto out_err; |
667 |
++ } |
668 |
+ |
669 |
+ phy_layer->id = phyid; |
670 |
+ phyinfo->pref = pref; |
671 |
+@@ -497,8 +500,10 @@ got_phyid: |
672 |
+ |
673 |
+ frml = cffrml_create(phyid, fcs); |
674 |
+ |
675 |
+- if (!frml) |
676 |
++ if (!frml) { |
677 |
++ res = -ENOMEM; |
678 |
+ goto out_err; |
679 |
++ } |
680 |
+ phyinfo->frm_layer = frml; |
681 |
+ layer_set_up(frml, cnfg->mux); |
682 |
+ |
683 |
+@@ -516,11 +521,12 @@ got_phyid: |
684 |
+ list_add_rcu(&phyinfo->node, &cnfg->phys); |
685 |
+ out: |
686 |
+ mutex_unlock(&cnfg->lock); |
687 |
+- return; |
688 |
++ return res; |
689 |
+ |
690 |
+ out_err: |
691 |
+ kfree(phyinfo); |
692 |
+ mutex_unlock(&cnfg->lock); |
693 |
++ return res; |
694 |
+ } |
695 |
+ EXPORT_SYMBOL(cfcnfg_add_phy_layer); |
696 |
+ |
697 |
+diff --git a/net/caif/cfserl.c b/net/caif/cfserl.c |
698 |
+index ce60f06d76de3..af1e1e36dc90a 100644 |
699 |
+--- a/net/caif/cfserl.c |
700 |
++++ b/net/caif/cfserl.c |
701 |
+@@ -31,6 +31,11 @@ static int cfserl_transmit(struct cflayer *layr, struct cfpkt *pkt); |
702 |
+ static void cfserl_ctrlcmd(struct cflayer *layr, enum caif_ctrlcmd ctrl, |
703 |
+ int phyid); |
704 |
+ |
705 |
++void cfserl_release(struct cflayer *layer) |
706 |
++{ |
707 |
++ kfree(layer); |
708 |
++} |
709 |
++ |
710 |
+ struct cflayer *cfserl_create(int instance, bool use_stx) |
711 |
+ { |
712 |
+ struct cfserl *this = kzalloc(sizeof(struct cfserl), GFP_ATOMIC); |
713 |
+diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c |
714 |
+index 76691a07a2e08..fe31df8dc804a 100644 |
715 |
+--- a/net/ieee802154/nl-mac.c |
716 |
++++ b/net/ieee802154/nl-mac.c |
717 |
+@@ -685,8 +685,10 @@ int ieee802154_llsec_getparams(struct sk_buff *skb, struct genl_info *info) |
718 |
+ nla_put_u8(msg, IEEE802154_ATTR_LLSEC_SECLEVEL, params.out_level) || |
719 |
+ nla_put_u32(msg, IEEE802154_ATTR_LLSEC_FRAME_COUNTER, |
720 |
+ be32_to_cpu(params.frame_counter)) || |
721 |
+- ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) |
722 |
++ ieee802154_llsec_fill_key_id(msg, ¶ms.out_key)) { |
723 |
++ rc = -ENOBUFS; |
724 |
+ goto out_free; |
725 |
++ } |
726 |
+ |
727 |
+ dev_put(dev); |
728 |
+ |
729 |
+diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c |
730 |
+index 77d73014bde31..11f53dc0c1c09 100644 |
731 |
+--- a/net/ieee802154/nl-phy.c |
732 |
++++ b/net/ieee802154/nl-phy.c |
733 |
+@@ -249,8 +249,10 @@ int ieee802154_add_iface(struct sk_buff *skb, struct genl_info *info) |
734 |
+ } |
735 |
+ |
736 |
+ if (nla_put_string(msg, IEEE802154_ATTR_PHY_NAME, wpan_phy_name(phy)) || |
737 |
+- nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) |
738 |
++ nla_put_string(msg, IEEE802154_ATTR_DEV_NAME, dev->name)) { |
739 |
++ rc = -EMSGSIZE; |
740 |
+ goto nla_put_failure; |
741 |
++ } |
742 |
+ dev_put(dev); |
743 |
+ |
744 |
+ wpan_phy_put(phy); |
745 |
+diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c |
746 |
+index c7ee962a547b9..1adbcdda21587 100644 |
747 |
+--- a/net/netfilter/ipvs/ip_vs_ctl.c |
748 |
++++ b/net/netfilter/ipvs/ip_vs_ctl.c |
749 |
+@@ -1226,7 +1226,7 @@ ip_vs_add_service(struct netns_ipvs *ipvs, struct ip_vs_service_user_kern *u, |
750 |
+ ip_vs_addr_copy(svc->af, &svc->addr, &u->addr); |
751 |
+ svc->port = u->port; |
752 |
+ svc->fwmark = u->fwmark; |
753 |
+- svc->flags = u->flags; |
754 |
++ svc->flags = u->flags & ~IP_VS_SVC_F_HASHED; |
755 |
+ svc->timeout = u->timeout * HZ; |
756 |
+ svc->netmask = u->netmask; |
757 |
+ svc->ipvs = ipvs; |
758 |
+diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c |
759 |
+index 8c17338693432..63a9d5fd00c0d 100644 |
760 |
+--- a/net/netfilter/nfnetlink_cthelper.c |
761 |
++++ b/net/netfilter/nfnetlink_cthelper.c |
762 |
+@@ -355,10 +355,14 @@ static int |
763 |
+ nfnl_cthelper_update(const struct nlattr * const tb[], |
764 |
+ struct nf_conntrack_helper *helper) |
765 |
+ { |
766 |
++ u32 size; |
767 |
+ int ret; |
768 |
+ |
769 |
+- if (tb[NFCTH_PRIV_DATA_LEN]) |
770 |
+- return -EBUSY; |
771 |
++ if (tb[NFCTH_PRIV_DATA_LEN]) { |
772 |
++ size = ntohl(nla_get_be32(tb[NFCTH_PRIV_DATA_LEN])); |
773 |
++ if (size != helper->data_len) |
774 |
++ return -EBUSY; |
775 |
++ } |
776 |
+ |
777 |
+ if (tb[NFCTH_POLICY]) { |
778 |
+ ret = nfnl_cthelper_update_policy(helper, tb[NFCTH_POLICY]); |
779 |
+diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c |
780 |
+index 09a49531fa273..ece7a5d59a612 100644 |
781 |
+--- a/net/nfc/llcp_sock.c |
782 |
++++ b/net/nfc/llcp_sock.c |
783 |
+@@ -121,6 +121,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) |
784 |
+ if (!llcp_sock->service_name) { |
785 |
+ nfc_llcp_local_put(llcp_sock->local); |
786 |
+ llcp_sock->local = NULL; |
787 |
++ llcp_sock->dev = NULL; |
788 |
+ ret = -ENOMEM; |
789 |
+ goto put_dev; |
790 |
+ } |
791 |
+@@ -130,6 +131,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) |
792 |
+ llcp_sock->local = NULL; |
793 |
+ kfree(llcp_sock->service_name); |
794 |
+ llcp_sock->service_name = NULL; |
795 |
++ llcp_sock->dev = NULL; |
796 |
+ ret = -EADDRINUSE; |
797 |
+ goto put_dev; |
798 |
+ } |
799 |
+diff --git a/sound/core/timer.c b/sound/core/timer.c |
800 |
+index f989adb98a229..7e4509de01c47 100644 |
801 |
+--- a/sound/core/timer.c |
802 |
++++ b/sound/core/timer.c |
803 |
+@@ -432,9 +432,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event) |
804 |
+ return; |
805 |
+ if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE) |
806 |
+ return; |
807 |
++ event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */ |
808 |
+ list_for_each_entry(ts, &ti->slave_active_head, active_list) |
809 |
+ if (ts->ccallback) |
810 |
+- ts->ccallback(ts, event + 100, &tstamp, resolution); |
811 |
++ ts->ccallback(ts, event, &tstamp, resolution); |
812 |
+ } |
813 |
+ |
814 |
+ /* start/continue a master timer */ |