1 |
Author: tomwij |
2 |
Date: 2013-05-20 17:43:33 +0000 (Mon, 20 May 2013) |
3 |
New Revision: 2381 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/3.0/1078_linux-3.0.79.patch |
7 |
genpatches-2.6/trunk/3.0/1500_XATTR_USER_PREFIX.patch |
8 |
genpatches-2.6/trunk/3.2/1500_XATTR_USER_PREFIX.patch |
9 |
genpatches-2.6/trunk/3.4/1500_XATTR_USER_PREFIX.patch |
10 |
genpatches-2.6/trunk/3.9/1500_XATTR_USER_PREFIX.patch |
11 |
Modified: |
12 |
genpatches-2.6/trunk/3.0/0000_README |
13 |
genpatches-2.6/trunk/3.2/0000_README |
14 |
genpatches-2.6/trunk/3.4/0000_README |
15 |
genpatches-2.6/trunk/3.9/0000_README |
16 |
Log: |
17 |
Linux patch 3.0.79. Added XATTR_USER_PREFIX patch, adds support for namespace user.pax.* on tmpfs; fixes bug #470644. |
18 |
|
19 |
Modified: genpatches-2.6/trunk/3.0/0000_README |
20 |
=================================================================== |
21 |
--- genpatches-2.6/trunk/3.0/0000_README 2013-05-19 19:38:03 UTC (rev 2380) |
22 |
+++ genpatches-2.6/trunk/3.0/0000_README 2013-05-20 17:43:33 UTC (rev 2381) |
23 |
@@ -347,6 +347,14 @@ |
24 |
From: http://www.kernel.org |
25 |
Desc: Linux 3.0.78 |
26 |
|
27 |
+Patch: 1078_linux-3.0.79.patch |
28 |
+From: http://www.kernel.org |
29 |
+Desc: Linux 3.0.79 |
30 |
+ |
31 |
+Patch: 1500_XATTR_USER_PREFIX.patch |
32 |
+From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
33 |
+Desc: Support for namespace user.pax.* on tmpfs. |
34 |
+ |
35 |
Patch: 1800_fix-zcache-build.patch |
36 |
From: http://bugs.gentoo.org/show_bug.cgi?id=376325 |
37 |
Desc: Fix zcache build error |
38 |
|
39 |
Added: genpatches-2.6/trunk/3.0/1078_linux-3.0.79.patch |
40 |
=================================================================== |
41 |
--- genpatches-2.6/trunk/3.0/1078_linux-3.0.79.patch (rev 0) |
42 |
+++ genpatches-2.6/trunk/3.0/1078_linux-3.0.79.patch 2013-05-20 17:43:33 UTC (rev 2381) |
43 |
@@ -0,0 +1,995 @@ |
44 |
+diff --git a/Makefile b/Makefile |
45 |
+index f111c5b..f8ade05 100644 |
46 |
+--- a/Makefile |
47 |
++++ b/Makefile |
48 |
+@@ -1,6 +1,6 @@ |
49 |
+ VERSION = 3 |
50 |
+ PATCHLEVEL = 0 |
51 |
+-SUBLEVEL = 78 |
52 |
++SUBLEVEL = 79 |
53 |
+ EXTRAVERSION = |
54 |
+ NAME = Sneaky Weasel |
55 |
+ |
56 |
+diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c |
57 |
+index c565971..9a1e1f7 100644 |
58 |
+--- a/arch/arm/mach-omap2/board-rx51-peripherals.c |
59 |
++++ b/arch/arm/mach-omap2/board-rx51-peripherals.c |
60 |
+@@ -56,11 +56,11 @@ |
61 |
+ |
62 |
+ #define RX51_USB_TRANSCEIVER_RST_GPIO 67 |
63 |
+ |
64 |
+-/* list all spi devices here */ |
65 |
++/* List all SPI devices here. Note that the list/probe order seems to matter! */ |
66 |
+ enum { |
67 |
+ RX51_SPI_WL1251, |
68 |
+- RX51_SPI_MIPID, /* LCD panel */ |
69 |
+ RX51_SPI_TSC2005, /* Touch Controller */ |
70 |
++ RX51_SPI_MIPID, /* LCD panel */ |
71 |
+ }; |
72 |
+ |
73 |
+ static struct wl12xx_platform_data wl1251_pdata; |
74 |
+diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c |
75 |
+index 2ad060a..be1d830 100644 |
76 |
+--- a/arch/x86/kvm/vmx.c |
77 |
++++ b/arch/x86/kvm/vmx.c |
78 |
+@@ -3836,6 +3836,12 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) |
79 |
+ if (err != EMULATE_DONE) |
80 |
+ return 0; |
81 |
+ |
82 |
++ if (vcpu->arch.halt_request) { |
83 |
++ vcpu->arch.halt_request = 0; |
84 |
++ ret = kvm_emulate_halt(vcpu); |
85 |
++ goto out; |
86 |
++ } |
87 |
++ |
88 |
+ if (signal_pending(current)) |
89 |
+ goto out; |
90 |
+ if (need_resched()) |
91 |
+diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c |
92 |
+index 063ce1f..e11efbd 100644 |
93 |
+--- a/arch/x86/xen/enlighten.c |
94 |
++++ b/arch/x86/xen/enlighten.c |
95 |
+@@ -129,6 +129,21 @@ static void xen_vcpu_setup(int cpu) |
96 |
+ |
97 |
+ BUG_ON(HYPERVISOR_shared_info == &xen_dummy_shared_info); |
98 |
+ |
99 |
++ /* |
100 |
++ * This path is called twice on PVHVM - first during bootup via |
101 |
++ * smp_init -> xen_hvm_cpu_notify, and then if the VCPU is being |
102 |
++ * hotplugged: cpu_up -> xen_hvm_cpu_notify. |
103 |
++ * As we can only do the VCPUOP_register_vcpu_info once lets |
104 |
++ * not over-write its result. |
105 |
++ * |
106 |
++ * For PV it is called during restore (xen_vcpu_restore) and bootup |
107 |
++ * (xen_setup_vcpu_info_placement). The hotplug mechanism does not |
108 |
++ * use this function. |
109 |
++ */ |
110 |
++ if (xen_hvm_domain()) { |
111 |
++ if (per_cpu(xen_vcpu, cpu) == &per_cpu(xen_vcpu_info, cpu)) |
112 |
++ return; |
113 |
++ } |
114 |
+ if (cpu < MAX_VIRT_CPUS) |
115 |
+ per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; |
116 |
+ |
117 |
+diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c |
118 |
+index f915a7f..b334f54 100644 |
119 |
+--- a/drivers/acpi/acpica/exfldio.c |
120 |
++++ b/drivers/acpi/acpica/exfldio.c |
121 |
+@@ -702,7 +702,19 @@ acpi_ex_extract_from_field(union acpi_operand_object *obj_desc, |
122 |
+ |
123 |
+ if ((obj_desc->common_field.start_field_bit_offset == 0) && |
124 |
+ (obj_desc->common_field.bit_length == access_bit_width)) { |
125 |
+- status = acpi_ex_field_datum_io(obj_desc, 0, buffer, ACPI_READ); |
126 |
++ if (buffer_length >= sizeof(u64)) { |
127 |
++ status = |
128 |
++ acpi_ex_field_datum_io(obj_desc, 0, buffer, |
129 |
++ ACPI_READ); |
130 |
++ } else { |
131 |
++ /* Use raw_datum (u64) to handle buffers < 64 bits */ |
132 |
++ |
133 |
++ status = |
134 |
++ acpi_ex_field_datum_io(obj_desc, 0, &raw_datum, |
135 |
++ ACPI_READ); |
136 |
++ ACPI_MEMCPY(buffer, &raw_datum, buffer_length); |
137 |
++ } |
138 |
++ |
139 |
+ return_ACPI_STATUS(status); |
140 |
+ } |
141 |
+ |
142 |
+diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c |
143 |
+index d2519b2..51de186 100644 |
144 |
+--- a/drivers/acpi/ec.c |
145 |
++++ b/drivers/acpi/ec.c |
146 |
+@@ -217,7 +217,7 @@ static int ec_check_sci_sync(struct acpi_ec *ec, u8 state) |
147 |
+ static int ec_poll(struct acpi_ec *ec) |
148 |
+ { |
149 |
+ unsigned long flags; |
150 |
+- int repeat = 2; /* number of command restarts */ |
151 |
++ int repeat = 5; /* number of command restarts */ |
152 |
+ while (repeat--) { |
153 |
+ unsigned long delay = jiffies + |
154 |
+ msecs_to_jiffies(ec_delay); |
155 |
+@@ -235,8 +235,6 @@ static int ec_poll(struct acpi_ec *ec) |
156 |
+ } |
157 |
+ advance_transaction(ec, acpi_ec_read_status(ec)); |
158 |
+ } while (time_before(jiffies, delay)); |
159 |
+- if (acpi_ec_read_status(ec) & ACPI_EC_FLAG_IBF) |
160 |
+- break; |
161 |
+ pr_debug(PREFIX "controller reset, restart transaction\n"); |
162 |
+ spin_lock_irqsave(&ec->curr_lock, flags); |
163 |
+ start_transaction(ec); |
164 |
+diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c |
165 |
+index 43beaca..13cbdd3 100644 |
166 |
+--- a/drivers/block/drbd/drbd_receiver.c |
167 |
++++ b/drivers/block/drbd/drbd_receiver.c |
168 |
+@@ -2225,7 +2225,6 @@ static int drbd_asb_recover_1p(struct drbd_conf *mdev) __must_hold(local) |
169 |
+ if (hg == -1 && mdev->state.role == R_PRIMARY) { |
170 |
+ enum drbd_state_rv rv2; |
171 |
+ |
172 |
+- drbd_set_role(mdev, R_SECONDARY, 0); |
173 |
+ /* drbd_change_state() does not sleep while in SS_IN_TRANSIENT_STATE, |
174 |
+ * we might be here in C_WF_REPORT_PARAMS which is transient. |
175 |
+ * we do not need to wait for the after state change work either. */ |
176 |
+diff --git a/drivers/char/ipmi/ipmi_bt_sm.c b/drivers/char/ipmi/ipmi_bt_sm.c |
177 |
+index 3ed20e8..92ce302 100644 |
178 |
+--- a/drivers/char/ipmi/ipmi_bt_sm.c |
179 |
++++ b/drivers/char/ipmi/ipmi_bt_sm.c |
180 |
+@@ -95,9 +95,9 @@ struct si_sm_data { |
181 |
+ enum bt_states state; |
182 |
+ unsigned char seq; /* BT sequence number */ |
183 |
+ struct si_sm_io *io; |
184 |
+- unsigned char write_data[IPMI_MAX_MSG_LENGTH]; |
185 |
++ unsigned char write_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */ |
186 |
+ int write_count; |
187 |
+- unsigned char read_data[IPMI_MAX_MSG_LENGTH]; |
188 |
++ unsigned char read_data[IPMI_MAX_MSG_LENGTH + 2]; /* +2 for memcpy */ |
189 |
+ int read_count; |
190 |
+ int truncated; |
191 |
+ long timeout; /* microseconds countdown */ |
192 |
+diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c |
193 |
+index 2aa3977..8dde1f5 100644 |
194 |
+--- a/drivers/char/ipmi/ipmi_devintf.c |
195 |
++++ b/drivers/char/ipmi/ipmi_devintf.c |
196 |
+@@ -838,13 +838,25 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd, |
197 |
+ return ipmi_ioctl(filep, cmd, arg); |
198 |
+ } |
199 |
+ } |
200 |
++ |
201 |
++static long unlocked_compat_ipmi_ioctl(struct file *filep, unsigned int cmd, |
202 |
++ unsigned long arg) |
203 |
++{ |
204 |
++ int ret; |
205 |
++ |
206 |
++ mutex_lock(&ipmi_mutex); |
207 |
++ ret = compat_ipmi_ioctl(filep, cmd, arg); |
208 |
++ mutex_unlock(&ipmi_mutex); |
209 |
++ |
210 |
++ return ret; |
211 |
++} |
212 |
+ #endif |
213 |
+ |
214 |
+ static const struct file_operations ipmi_fops = { |
215 |
+ .owner = THIS_MODULE, |
216 |
+ .unlocked_ioctl = ipmi_unlocked_ioctl, |
217 |
+ #ifdef CONFIG_COMPAT |
218 |
+- .compat_ioctl = compat_ipmi_ioctl, |
219 |
++ .compat_ioctl = unlocked_compat_ipmi_ioctl, |
220 |
+ #endif |
221 |
+ .open = ipmi_open, |
222 |
+ .release = ipmi_release, |
223 |
+diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c |
224 |
+index 1ed89d0..e6f128a 100644 |
225 |
+--- a/drivers/dma/pch_dma.c |
226 |
++++ b/drivers/dma/pch_dma.c |
227 |
+@@ -489,7 +489,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan) |
228 |
+ dev_dbg(chan2dev(&pd_chan->chan), "scanned %d descriptors\n", i); |
229 |
+ |
230 |
+ if (!ret) { |
231 |
+- ret = pdc_alloc_desc(&pd_chan->chan, GFP_NOIO); |
232 |
++ ret = pdc_alloc_desc(&pd_chan->chan, GFP_ATOMIC); |
233 |
+ if (ret) { |
234 |
+ spin_lock(&pd_chan->lock); |
235 |
+ pd_chan->descs_allocated++; |
236 |
+diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c |
237 |
+index 959186c..01894e4 100644 |
238 |
+--- a/drivers/gpu/drm/drm_mm.c |
239 |
++++ b/drivers/gpu/drm/drm_mm.c |
240 |
+@@ -679,33 +679,35 @@ void drm_mm_debug_table(struct drm_mm *mm, const char *prefix) |
241 |
+ EXPORT_SYMBOL(drm_mm_debug_table); |
242 |
+ |
243 |
+ #if defined(CONFIG_DEBUG_FS) |
244 |
+-int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) |
245 |
++static unsigned long drm_mm_dump_hole(struct seq_file *m, struct drm_mm_node *entry) |
246 |
+ { |
247 |
+- struct drm_mm_node *entry; |
248 |
+- unsigned long total_used = 0, total_free = 0, total = 0; |
249 |
+ unsigned long hole_start, hole_end, hole_size; |
250 |
+ |
251 |
+- hole_start = drm_mm_hole_node_start(&mm->head_node); |
252 |
+- hole_end = drm_mm_hole_node_end(&mm->head_node); |
253 |
+- hole_size = hole_end - hole_start; |
254 |
+- if (hole_size) |
255 |
++ if (entry->hole_follows) { |
256 |
++ hole_start = drm_mm_hole_node_start(entry); |
257 |
++ hole_end = drm_mm_hole_node_end(entry); |
258 |
++ hole_size = hole_end - hole_start; |
259 |
+ seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", |
260 |
+ hole_start, hole_end, hole_size); |
261 |
+- total_free += hole_size; |
262 |
++ return hole_size; |
263 |
++ } |
264 |
++ |
265 |
++ return 0; |
266 |
++} |
267 |
++ |
268 |
++int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm) |
269 |
++{ |
270 |
++ struct drm_mm_node *entry; |
271 |
++ unsigned long total_used = 0, total_free = 0, total = 0; |
272 |
++ |
273 |
++ total_free += drm_mm_dump_hole(m, &mm->head_node); |
274 |
+ |
275 |
+ drm_mm_for_each_node(entry, mm) { |
276 |
+ seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: used\n", |
277 |
+ entry->start, entry->start + entry->size, |
278 |
+ entry->size); |
279 |
+ total_used += entry->size; |
280 |
+- if (entry->hole_follows) { |
281 |
+- hole_start = drm_mm_hole_node_start(entry); |
282 |
+- hole_end = drm_mm_hole_node_end(entry); |
283 |
+- hole_size = hole_end - hole_start; |
284 |
+- seq_printf(m, "0x%08lx-0x%08lx: 0x%08lx: free\n", |
285 |
+- hole_start, hole_end, hole_size); |
286 |
+- total_free += hole_size; |
287 |
+- } |
288 |
++ total_free += drm_mm_dump_hole(m, entry); |
289 |
+ } |
290 |
+ total = total_free + total_used; |
291 |
+ |
292 |
+diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c |
293 |
+index c5c2742..a12f373 100644 |
294 |
+--- a/drivers/gpu/drm/radeon/r300_cmdbuf.c |
295 |
++++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c |
296 |
+@@ -74,7 +74,7 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv, |
297 |
+ OUT_RING(CP_PACKET0(R300_RE_CLIPRECT_TL_0, nr * 2 - 1)); |
298 |
+ |
299 |
+ for (i = 0; i < nr; ++i) { |
300 |
+- if (DRM_COPY_FROM_USER_UNCHECKED |
301 |
++ if (DRM_COPY_FROM_USER |
302 |
+ (&box, &cmdbuf->boxes[n + i], sizeof(box))) { |
303 |
+ DRM_ERROR("copy cliprect faulted\n"); |
304 |
+ return -EFAULT; |
305 |
+diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c |
306 |
+index 9ecff5f..f3e632a 100644 |
307 |
+--- a/drivers/md/dm-snap.c |
308 |
++++ b/drivers/md/dm-snap.c |
309 |
+@@ -1121,6 +1121,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) |
310 |
+ s->pending_pool = mempool_create_slab_pool(MIN_IOS, pending_cache); |
311 |
+ if (!s->pending_pool) { |
312 |
+ ti->error = "Could not allocate mempool for pending exceptions"; |
313 |
++ r = -ENOMEM; |
314 |
+ goto bad_pending_pool; |
315 |
+ } |
316 |
+ |
317 |
+diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c |
318 |
+index 44b28b2..15410f7 100644 |
319 |
+--- a/drivers/net/3c509.c |
320 |
++++ b/drivers/net/3c509.c |
321 |
+@@ -309,6 +309,7 @@ static int __devinit el3_isa_match(struct device *pdev, |
322 |
+ if (!dev) |
323 |
+ return -ENOMEM; |
324 |
+ |
325 |
++ SET_NETDEV_DEV(dev, pdev); |
326 |
+ netdev_boot_setup_check(dev); |
327 |
+ |
328 |
+ if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) { |
329 |
+@@ -704,6 +705,7 @@ static int __init el3_eisa_probe (struct device *device) |
330 |
+ return -ENOMEM; |
331 |
+ } |
332 |
+ |
333 |
++ SET_NETDEV_DEV(dev, device); |
334 |
+ netdev_boot_setup_check(dev); |
335 |
+ |
336 |
+ el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_EISA); |
337 |
+diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c |
338 |
+index 41afc40..c83be40 100644 |
339 |
+--- a/drivers/net/3c59x.c |
340 |
++++ b/drivers/net/3c59x.c |
341 |
+@@ -632,7 +632,6 @@ struct vortex_private { |
342 |
+ pm_state_valid:1, /* pci_dev->saved_config_space has sane contents */ |
343 |
+ open:1, |
344 |
+ medialock:1, |
345 |
+- must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ |
346 |
+ large_frames:1, /* accept large frames */ |
347 |
+ handling_irq:1; /* private in_irq indicator */ |
348 |
+ /* {get|set}_wol operations are already serialized by rtnl. |
349 |
+@@ -951,7 +950,7 @@ static int __devexit vortex_eisa_remove(struct device *device) |
350 |
+ |
351 |
+ unregister_netdev(dev); |
352 |
+ iowrite16(TotalReset|0x14, ioaddr + EL3_CMD); |
353 |
+- release_region(dev->base_addr, VORTEX_TOTAL_SIZE); |
354 |
++ release_region(edev->base_addr, VORTEX_TOTAL_SIZE); |
355 |
+ |
356 |
+ free_netdev(dev); |
357 |
+ return 0; |
358 |
+@@ -1012,6 +1011,12 @@ static int __devinit vortex_init_one(struct pci_dev *pdev, |
359 |
+ if (rc < 0) |
360 |
+ goto out; |
361 |
+ |
362 |
++ rc = pci_request_regions(pdev, DRV_NAME); |
363 |
++ if (rc < 0) { |
364 |
++ pci_disable_device(pdev); |
365 |
++ goto out; |
366 |
++ } |
367 |
++ |
368 |
+ unit = vortex_cards_found; |
369 |
+ |
370 |
+ if (global_use_mmio < 0 && (unit >= MAX_UNITS || use_mmio[unit] < 0)) { |
371 |
+@@ -1027,6 +1032,7 @@ static int __devinit vortex_init_one(struct pci_dev *pdev, |
372 |
+ if (!ioaddr) /* If mapping fails, fall-back to BAR 0... */ |
373 |
+ ioaddr = pci_iomap(pdev, 0, 0); |
374 |
+ if (!ioaddr) { |
375 |
++ pci_release_regions(pdev); |
376 |
+ pci_disable_device(pdev); |
377 |
+ rc = -ENOMEM; |
378 |
+ goto out; |
379 |
+@@ -1036,6 +1042,7 @@ static int __devinit vortex_init_one(struct pci_dev *pdev, |
380 |
+ ent->driver_data, unit); |
381 |
+ if (rc < 0) { |
382 |
+ pci_iounmap(pdev, ioaddr); |
383 |
++ pci_release_regions(pdev); |
384 |
+ pci_disable_device(pdev); |
385 |
+ goto out; |
386 |
+ } |
387 |
+@@ -1180,11 +1187,6 @@ static int __devinit vortex_probe1(struct device *gendev, |
388 |
+ |
389 |
+ /* PCI-only startup logic */ |
390 |
+ if (pdev) { |
391 |
+- /* EISA resources already marked, so only PCI needs to do this here */ |
392 |
+- /* Ignore return value, because Cardbus drivers already allocate for us */ |
393 |
+- if (request_region(dev->base_addr, vci->io_size, print_name) != NULL) |
394 |
+- vp->must_free_region = 1; |
395 |
+- |
396 |
+ /* enable bus-mastering if necessary */ |
397 |
+ if (vci->flags & PCI_USES_MASTER) |
398 |
+ pci_set_master(pdev); |
399 |
+@@ -1222,7 +1224,7 @@ static int __devinit vortex_probe1(struct device *gendev, |
400 |
+ &vp->rx_ring_dma); |
401 |
+ retval = -ENOMEM; |
402 |
+ if (!vp->rx_ring) |
403 |
+- goto free_region; |
404 |
++ goto free_device; |
405 |
+ |
406 |
+ vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE); |
407 |
+ vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE; |
408 |
+@@ -1487,9 +1489,7 @@ free_ring: |
409 |
+ + sizeof(struct boom_tx_desc) * TX_RING_SIZE, |
410 |
+ vp->rx_ring, |
411 |
+ vp->rx_ring_dma); |
412 |
+-free_region: |
413 |
+- if (vp->must_free_region) |
414 |
+- release_region(dev->base_addr, vci->io_size); |
415 |
++free_device: |
416 |
+ free_netdev(dev); |
417 |
+ pr_err(PFX "vortex_probe1 fails. Returns %d\n", retval); |
418 |
+ out: |
419 |
+@@ -3253,8 +3253,9 @@ static void __devexit vortex_remove_one(struct pci_dev *pdev) |
420 |
+ + sizeof(struct boom_tx_desc) * TX_RING_SIZE, |
421 |
+ vp->rx_ring, |
422 |
+ vp->rx_ring_dma); |
423 |
+- if (vp->must_free_region) |
424 |
+- release_region(dev->base_addr, vp->io_size); |
425 |
++ |
426 |
++ pci_release_regions(pdev); |
427 |
++ |
428 |
+ free_netdev(dev); |
429 |
+ } |
430 |
+ |
431 |
+diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c |
432 |
+index 735f726..4c0bdac 100644 |
433 |
+--- a/drivers/net/macvlan.c |
434 |
++++ b/drivers/net/macvlan.c |
435 |
+@@ -193,7 +193,8 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb) |
436 |
+ } |
437 |
+ |
438 |
+ if (port->passthru) |
439 |
+- vlan = list_first_entry(&port->vlans, struct macvlan_dev, list); |
440 |
++ vlan = list_first_or_null_rcu(&port->vlans, |
441 |
++ struct macvlan_dev, list); |
442 |
+ else |
443 |
+ vlan = macvlan_hash_lookup(port, eth->h_dest); |
444 |
+ if (vlan == NULL) |
445 |
+@@ -687,7 +688,7 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev, |
446 |
+ if (err < 0) |
447 |
+ goto destroy_port; |
448 |
+ |
449 |
+- list_add_tail(&vlan->list, &port->vlans); |
450 |
++ list_add_tail_rcu(&vlan->list, &port->vlans); |
451 |
+ netif_stacked_transfer_operstate(lowerdev, dev); |
452 |
+ |
453 |
+ return 0; |
454 |
+@@ -713,7 +714,7 @@ void macvlan_dellink(struct net_device *dev, struct list_head *head) |
455 |
+ { |
456 |
+ struct macvlan_dev *vlan = netdev_priv(dev); |
457 |
+ |
458 |
+- list_del(&vlan->list); |
459 |
++ list_del_rcu(&vlan->list); |
460 |
+ unregister_netdevice_queue(dev, head); |
461 |
+ } |
462 |
+ EXPORT_SYMBOL_GPL(macvlan_dellink); |
463 |
+diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c |
464 |
+index 8350f8d..bf67991 100644 |
465 |
+--- a/drivers/net/r8169.c |
466 |
++++ b/drivers/net/r8169.c |
467 |
+@@ -1494,8 +1494,6 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb) |
468 |
+ |
469 |
+ if (opts2 & RxVlanTag) |
470 |
+ __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff)); |
471 |
+- |
472 |
+- desc->opts2 = 0; |
473 |
+ } |
474 |
+ |
475 |
+ static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd) |
476 |
+@@ -5188,7 +5186,6 @@ static int rtl8169_rx_interrupt(struct net_device *dev, |
477 |
+ rtl8169_schedule_work(dev, rtl8169_reset_task); |
478 |
+ dev->stats.rx_fifo_errors++; |
479 |
+ } |
480 |
+- rtl8169_mark_to_asic(desc, rx_buf_sz); |
481 |
+ } else { |
482 |
+ struct sk_buff *skb; |
483 |
+ dma_addr_t addr = le64_to_cpu(desc->addr); |
484 |
+@@ -5202,16 +5199,14 @@ static int rtl8169_rx_interrupt(struct net_device *dev, |
485 |
+ if (unlikely(rtl8169_fragmented_frame(status))) { |
486 |
+ dev->stats.rx_dropped++; |
487 |
+ dev->stats.rx_length_errors++; |
488 |
+- rtl8169_mark_to_asic(desc, rx_buf_sz); |
489 |
+- continue; |
490 |
++ goto release_descriptor; |
491 |
+ } |
492 |
+ |
493 |
+ skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry], |
494 |
+ tp, pkt_size, addr); |
495 |
+- rtl8169_mark_to_asic(desc, rx_buf_sz); |
496 |
+ if (!skb) { |
497 |
+ dev->stats.rx_dropped++; |
498 |
+- continue; |
499 |
++ goto release_descriptor; |
500 |
+ } |
501 |
+ |
502 |
+ rtl8169_rx_csum(skb, status); |
503 |
+@@ -5225,6 +5220,10 @@ static int rtl8169_rx_interrupt(struct net_device *dev, |
504 |
+ dev->stats.rx_bytes += pkt_size; |
505 |
+ dev->stats.rx_packets++; |
506 |
+ } |
507 |
++release_descriptor: |
508 |
++ desc->opts2 = 0; |
509 |
++ wmb(); |
510 |
++ rtl8169_mark_to_asic(desc, rx_buf_sz); |
511 |
+ } |
512 |
+ |
513 |
+ count = cur_rx - tp->cur_rx; |
514 |
+diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c |
515 |
+index 633f962..806748a 100644 |
516 |
+--- a/drivers/net/wireless/ath/ath9k/main.c |
517 |
++++ b/drivers/net/wireless/ath/ath9k/main.c |
518 |
+@@ -1791,6 +1791,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw, |
519 |
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
520 |
+ struct ath_node *an = (struct ath_node *) sta->drv_priv; |
521 |
+ struct ieee80211_key_conf ps_key = { }; |
522 |
++ int key; |
523 |
+ |
524 |
+ ath_node_attach(sc, sta); |
525 |
+ |
526 |
+@@ -1798,7 +1799,9 @@ static int ath9k_sta_add(struct ieee80211_hw *hw, |
527 |
+ vif->type != NL80211_IFTYPE_AP_VLAN) |
528 |
+ return 0; |
529 |
+ |
530 |
+- an->ps_key = ath_key_config(common, vif, sta, &ps_key); |
531 |
++ key = ath_key_config(common, vif, sta, &ps_key); |
532 |
++ if (key > 0) |
533 |
++ an->ps_key = key; |
534 |
+ |
535 |
+ return 0; |
536 |
+ } |
537 |
+@@ -1815,6 +1818,7 @@ static void ath9k_del_ps_key(struct ath_softc *sc, |
538 |
+ return; |
539 |
+ |
540 |
+ ath_key_delete(common, &ps_key); |
541 |
++ an->ps_key = 0; |
542 |
+ } |
543 |
+ |
544 |
+ static int ath9k_sta_remove(struct ieee80211_hw *hw, |
545 |
+diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c |
546 |
+index cd89fed..677e60b 100644 |
547 |
+--- a/drivers/net/wireless/mwifiex/cmdevt.c |
548 |
++++ b/drivers/net/wireless/mwifiex/cmdevt.c |
549 |
+@@ -1081,6 +1081,7 @@ mwifiex_process_hs_config(struct mwifiex_adapter *adapter) |
550 |
+ adapter->if_ops.wakeup(adapter); |
551 |
+ adapter->hs_activated = false; |
552 |
+ adapter->is_hs_configured = false; |
553 |
++ adapter->is_suspended = false; |
554 |
+ mwifiex_hs_activated_event(mwifiex_get_priv(adapter, |
555 |
+ MWIFIEX_BSS_ROLE_ANY), false); |
556 |
+ } |
557 |
+diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c |
558 |
+index d05907d..a677e7b 100644 |
559 |
+--- a/drivers/net/wireless/mwifiex/sta_ioctl.c |
560 |
++++ b/drivers/net/wireless/mwifiex/sta_ioctl.c |
561 |
+@@ -100,7 +100,7 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, |
562 |
+ } else { |
563 |
+ /* Multicast */ |
564 |
+ priv->curr_pkt_filter &= ~HostCmd_ACT_MAC_PROMISCUOUS_ENABLE; |
565 |
+- if (mcast_list->mode == MWIFIEX_MULTICAST_MODE) { |
566 |
++ if (mcast_list->mode == MWIFIEX_ALL_MULTI_MODE) { |
567 |
+ dev_dbg(priv->adapter->dev, |
568 |
+ "info: Enabling All Multicast!\n"); |
569 |
+ priv->curr_pkt_filter |= |
570 |
+@@ -112,20 +112,11 @@ int mwifiex_request_set_multicast_list(struct mwifiex_private *priv, |
571 |
+ dev_dbg(priv->adapter->dev, |
572 |
+ "info: Set multicast list=%d\n", |
573 |
+ mcast_list->num_multicast_addr); |
574 |
+- /* Set multicast addresses to firmware */ |
575 |
+- if (old_pkt_filter == priv->curr_pkt_filter) { |
576 |
+- /* Send request to firmware */ |
577 |
+- ret = mwifiex_send_cmd_async(priv, |
578 |
+- HostCmd_CMD_MAC_MULTICAST_ADR, |
579 |
+- HostCmd_ACT_GEN_SET, 0, |
580 |
+- mcast_list); |
581 |
+- } else { |
582 |
+- /* Send request to firmware */ |
583 |
+- ret = mwifiex_send_cmd_async(priv, |
584 |
+- HostCmd_CMD_MAC_MULTICAST_ADR, |
585 |
+- HostCmd_ACT_GEN_SET, 0, |
586 |
+- mcast_list); |
587 |
+- } |
588 |
++ /* Send multicast addresses to firmware */ |
589 |
++ ret = mwifiex_send_cmd_async(priv, |
590 |
++ HostCmd_CMD_MAC_MULTICAST_ADR, |
591 |
++ HostCmd_ACT_GEN_SET, 0, |
592 |
++ mcast_list); |
593 |
+ } |
594 |
+ } |
595 |
+ } |
596 |
+diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c |
597 |
+index 71bab0e..646f6fe 100644 |
598 |
+--- a/drivers/rtc/rtc-pcf2123.c |
599 |
++++ b/drivers/rtc/rtc-pcf2123.c |
600 |
+@@ -263,6 +263,7 @@ static int __devinit pcf2123_probe(struct spi_device *spi) |
601 |
+ |
602 |
+ if (!(rxbuf[0] & 0x20)) { |
603 |
+ dev_err(&spi->dev, "chip not found\n"); |
604 |
++ ret = -ENODEV; |
605 |
+ goto kfree_exit; |
606 |
+ } |
607 |
+ |
608 |
+diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c |
609 |
+index 515ec6d..7db7eb7 100644 |
610 |
+--- a/drivers/scsi/sd.c |
611 |
++++ b/drivers/scsi/sd.c |
612 |
+@@ -138,6 +138,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, |
613 |
+ char *buffer_data; |
614 |
+ struct scsi_mode_data data; |
615 |
+ struct scsi_sense_hdr sshdr; |
616 |
++ const char *temp = "temporary "; |
617 |
+ int len; |
618 |
+ |
619 |
+ if (sdp->type != TYPE_DISK) |
620 |
+@@ -146,6 +147,13 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, |
621 |
+ * it's not worth the risk */ |
622 |
+ return -EINVAL; |
623 |
+ |
624 |
++ if (strncmp(buf, temp, sizeof(temp) - 1) == 0) { |
625 |
++ buf += sizeof(temp) - 1; |
626 |
++ sdkp->cache_override = 1; |
627 |
++ } else { |
628 |
++ sdkp->cache_override = 0; |
629 |
++ } |
630 |
++ |
631 |
+ for (i = 0; i < ARRAY_SIZE(sd_cache_types); i++) { |
632 |
+ len = strlen(sd_cache_types[i]); |
633 |
+ if (strncmp(sd_cache_types[i], buf, len) == 0 && |
634 |
+@@ -158,6 +166,13 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr, |
635 |
+ return -EINVAL; |
636 |
+ rcd = ct & 0x01 ? 1 : 0; |
637 |
+ wce = ct & 0x02 ? 1 : 0; |
638 |
++ |
639 |
++ if (sdkp->cache_override) { |
640 |
++ sdkp->WCE = wce; |
641 |
++ sdkp->RCD = rcd; |
642 |
++ return count; |
643 |
++ } |
644 |
++ |
645 |
+ if (scsi_mode_sense(sdp, 0x08, 8, buffer, sizeof(buffer), SD_TIMEOUT, |
646 |
+ SD_MAX_RETRIES, &data, NULL)) |
647 |
+ return -EINVAL; |
648 |
+@@ -2036,6 +2051,10 @@ sd_read_cache_type(struct scsi_disk *sdkp, unsigned char *buffer) |
649 |
+ int old_rcd = sdkp->RCD; |
650 |
+ int old_dpofua = sdkp->DPOFUA; |
651 |
+ |
652 |
++ |
653 |
++ if (sdkp->cache_override) |
654 |
++ return; |
655 |
++ |
656 |
+ first_len = 4; |
657 |
+ if (sdp->skip_ms_page_8) { |
658 |
+ if (sdp->type == TYPE_RBC) |
659 |
+@@ -2517,6 +2536,7 @@ static void sd_probe_async(void *data, async_cookie_t cookie) |
660 |
+ sdkp->capacity = 0; |
661 |
+ sdkp->media_present = 1; |
662 |
+ sdkp->write_prot = 0; |
663 |
++ sdkp->cache_override = 0; |
664 |
+ sdkp->WCE = 0; |
665 |
+ sdkp->RCD = 0; |
666 |
+ sdkp->ATO = 0; |
667 |
+diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h |
668 |
+index 6ad798b..812f1ba 100644 |
669 |
+--- a/drivers/scsi/sd.h |
670 |
++++ b/drivers/scsi/sd.h |
671 |
+@@ -70,6 +70,7 @@ struct scsi_disk { |
672 |
+ u8 protection_type;/* Data Integrity Field */ |
673 |
+ u8 provisioning_mode; |
674 |
+ unsigned ATO : 1; /* state of disk ATO bit */ |
675 |
++ unsigned cache_override : 1; /* temp override of WCE,RCD */ |
676 |
+ unsigned WCE : 1; /* state of disk WCE bit */ |
677 |
+ unsigned RCD : 1; /* state of disk RCD bit, unused */ |
678 |
+ unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ |
679 |
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c |
680 |
+index 35959f6..cdb8414 100644 |
681 |
+--- a/fs/ext4/mballoc.c |
682 |
++++ b/fs/ext4/mballoc.c |
683 |
+@@ -2026,7 +2026,11 @@ repeat: |
684 |
+ group = ac->ac_g_ex.fe_group; |
685 |
+ |
686 |
+ for (i = 0; i < ngroups; group++, i++) { |
687 |
+- if (group == ngroups) |
688 |
++ /* |
689 |
++ * Artificially restricted ngroups for non-extent |
690 |
++ * files makes group > ngroups possible on first loop. |
691 |
++ */ |
692 |
++ if (group >= ngroups) |
693 |
+ group = 0; |
694 |
+ |
695 |
+ /* This now checks without needing the buddy page */ |
696 |
+diff --git a/include/linux/if_cablemodem.h b/include/linux/if_cablemodem.h |
697 |
+index 9ca1007..ee6b3c4 100644 |
698 |
+--- a/include/linux/if_cablemodem.h |
699 |
++++ b/include/linux/if_cablemodem.h |
700 |
+@@ -12,11 +12,11 @@ |
701 |
+ */ |
702 |
+ |
703 |
+ /* some useful defines for sb1000.c e cmconfig.c - fv */ |
704 |
+-#define SIOCGCMSTATS SIOCDEVPRIVATE+0 /* get cable modem stats */ |
705 |
+-#define SIOCGCMFIRMWARE SIOCDEVPRIVATE+1 /* get cm firmware version */ |
706 |
+-#define SIOCGCMFREQUENCY SIOCDEVPRIVATE+2 /* get cable modem frequency */ |
707 |
+-#define SIOCSCMFREQUENCY SIOCDEVPRIVATE+3 /* set cable modem frequency */ |
708 |
+-#define SIOCGCMPIDS SIOCDEVPRIVATE+4 /* get cable modem PIDs */ |
709 |
+-#define SIOCSCMPIDS SIOCDEVPRIVATE+5 /* set cable modem PIDs */ |
710 |
++#define SIOCGCMSTATS (SIOCDEVPRIVATE+0) /* get cable modem stats */ |
711 |
++#define SIOCGCMFIRMWARE (SIOCDEVPRIVATE+1) /* get cm firmware version */ |
712 |
++#define SIOCGCMFREQUENCY (SIOCDEVPRIVATE+2) /* get cable modem frequency */ |
713 |
++#define SIOCSCMFREQUENCY (SIOCDEVPRIVATE+3) /* set cable modem frequency */ |
714 |
++#define SIOCGCMPIDS (SIOCDEVPRIVATE+4) /* get cable modem PIDs */ |
715 |
++#define SIOCSCMPIDS (SIOCDEVPRIVATE+5) /* set cable modem PIDs */ |
716 |
+ |
717 |
+ #endif |
718 |
+diff --git a/include/linux/rculist.h b/include/linux/rculist.h |
719 |
+index e3beb31..c30ffd8 100644 |
720 |
+--- a/include/linux/rculist.h |
721 |
++++ b/include/linux/rculist.h |
722 |
+@@ -242,6 +242,23 @@ static inline void list_splice_init_rcu(struct list_head *list, |
723 |
+ list_entry_rcu((ptr)->next, type, member) |
724 |
+ |
725 |
+ /** |
726 |
++ * list_first_or_null_rcu - get the first element from a list |
727 |
++ * @ptr: the list head to take the element from. |
728 |
++ * @type: the type of the struct this is embedded in. |
729 |
++ * @member: the name of the list_struct within the struct. |
730 |
++ * |
731 |
++ * Note that if the list is empty, it returns NULL. |
732 |
++ * |
733 |
++ * This primitive may safely run concurrently with the _rcu list-mutation |
734 |
++ * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
735 |
++ */ |
736 |
++#define list_first_or_null_rcu(ptr, type, member) \ |
737 |
++ ({struct list_head *__ptr = (ptr); \ |
738 |
++ struct list_head __rcu *__next = list_next_rcu(__ptr); \ |
739 |
++ likely(__ptr != __next) ? container_of(__next, type, member) : NULL; \ |
740 |
++ }) |
741 |
++ |
742 |
++/** |
743 |
+ * list_for_each_entry_rcu - iterate over rcu list of given type |
744 |
+ * @pos: the type * to use as a loop cursor. |
745 |
+ * @head: the head for your list. |
746 |
+diff --git a/include/net/sock.h b/include/net/sock.h |
747 |
+index b2deeab..b6abd4f 100644 |
748 |
+--- a/include/net/sock.h |
749 |
++++ b/include/net/sock.h |
750 |
+@@ -721,6 +721,18 @@ struct timewait_sock_ops; |
751 |
+ struct inet_hashinfo; |
752 |
+ struct raw_hashinfo; |
753 |
+ |
754 |
++/* |
755 |
++ * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes |
756 |
++ * un-modified. Special care is taken when initializing object to zero. |
757 |
++ */ |
758 |
++static inline void sk_prot_clear_nulls(struct sock *sk, int size) |
759 |
++{ |
760 |
++ if (offsetof(struct sock, sk_node.next) != 0) |
761 |
++ memset(sk, 0, offsetof(struct sock, sk_node.next)); |
762 |
++ memset(&sk->sk_node.pprev, 0, |
763 |
++ size - offsetof(struct sock, sk_node.pprev)); |
764 |
++} |
765 |
++ |
766 |
+ /* Networking protocol blocks we attach to sockets. |
767 |
+ * socket layer -> transport layer interface |
768 |
+ * transport -> network interface is defined by struct inet_proto |
769 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
770 |
+index b28a49f..4881cb6 100644 |
771 |
+--- a/include/net/tcp.h |
772 |
++++ b/include/net/tcp.h |
773 |
+@@ -902,6 +902,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) |
774 |
+ if (sysctl_tcp_low_latency || !tp->ucopy.task) |
775 |
+ return 0; |
776 |
+ |
777 |
++ skb_dst_force(skb); |
778 |
+ __skb_queue_tail(&tp->ucopy.prequeue, skb); |
779 |
+ tp->ucopy.memory += skb->truesize; |
780 |
+ if (tp->ucopy.memory > sk->sk_rcvbuf) { |
781 |
+diff --git a/kernel/kmod.c b/kernel/kmod.c |
782 |
+index fabfe54..f625b4f 100644 |
783 |
+--- a/kernel/kmod.c |
784 |
++++ b/kernel/kmod.c |
785 |
+@@ -421,6 +421,11 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, |
786 |
+ int retval = 0; |
787 |
+ |
788 |
+ helper_lock(); |
789 |
++ if (!sub_info->path) { |
790 |
++ retval = -EINVAL; |
791 |
++ goto out; |
792 |
++ } |
793 |
++ |
794 |
+ if (sub_info->path[0] == '\0') |
795 |
+ goto out; |
796 |
+ |
797 |
+diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c |
798 |
+index c473ce2..c0be5f2 100644 |
799 |
+--- a/kernel/time/tick-sched.c |
800 |
++++ b/kernel/time/tick-sched.c |
801 |
+@@ -811,7 +811,7 @@ void tick_cancel_sched_timer(int cpu) |
802 |
+ hrtimer_cancel(&ts->sched_timer); |
803 |
+ # endif |
804 |
+ |
805 |
+- ts->nohz_mode = NOHZ_MODE_INACTIVE; |
806 |
++ memset(ts, 0, sizeof(*ts)); |
807 |
+ } |
808 |
+ #endif |
809 |
+ |
810 |
+diff --git a/kernel/timer.c b/kernel/timer.c |
811 |
+index 27982d9..45a2f29 100644 |
812 |
+--- a/kernel/timer.c |
813 |
++++ b/kernel/timer.c |
814 |
+@@ -1630,12 +1630,12 @@ static int __cpuinit init_timers_cpu(int cpu) |
815 |
+ boot_done = 1; |
816 |
+ base = &boot_tvec_bases; |
817 |
+ } |
818 |
++ spin_lock_init(&base->lock); |
819 |
+ tvec_base_done[cpu] = 1; |
820 |
+ } else { |
821 |
+ base = per_cpu(tvec_bases, cpu); |
822 |
+ } |
823 |
+ |
824 |
+- spin_lock_init(&base->lock); |
825 |
+ |
826 |
+ for (j = 0; j < TVN_SIZE; j++) { |
827 |
+ INIT_LIST_HEAD(base->tv5.vec + j); |
828 |
+diff --git a/net/bridge/br_stp_timer.c b/net/bridge/br_stp_timer.c |
829 |
+index 3e96514..0abc6b1 100644 |
830 |
+--- a/net/bridge/br_stp_timer.c |
831 |
++++ b/net/bridge/br_stp_timer.c |
832 |
+@@ -106,7 +106,7 @@ static void br_tcn_timer_expired(unsigned long arg) |
833 |
+ |
834 |
+ br_debug(br, "tcn timer expired\n"); |
835 |
+ spin_lock(&br->lock); |
836 |
+- if (br->dev->flags & IFF_UP) { |
837 |
++ if (!br_is_root_bridge(br) && (br->dev->flags & IFF_UP)) { |
838 |
+ br_transmit_tcn(br); |
839 |
+ |
840 |
+ mod_timer(&br->tcn_timer,jiffies + br->bridge_hello_time); |
841 |
+diff --git a/net/core/sock.c b/net/core/sock.c |
842 |
+index b9d5610..b43e260 100644 |
843 |
+--- a/net/core/sock.c |
844 |
++++ b/net/core/sock.c |
845 |
+@@ -1017,18 +1017,6 @@ static void sock_copy(struct sock *nsk, const struct sock *osk) |
846 |
+ #endif |
847 |
+ } |
848 |
+ |
849 |
+-/* |
850 |
+- * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes |
851 |
+- * un-modified. Special care is taken when initializing object to zero. |
852 |
+- */ |
853 |
+-static inline void sk_prot_clear_nulls(struct sock *sk, int size) |
854 |
+-{ |
855 |
+- if (offsetof(struct sock, sk_node.next) != 0) |
856 |
+- memset(sk, 0, offsetof(struct sock, sk_node.next)); |
857 |
+- memset(&sk->sk_node.pprev, 0, |
858 |
+- size - offsetof(struct sock, sk_node.pprev)); |
859 |
+-} |
860 |
+- |
861 |
+ void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) |
862 |
+ { |
863 |
+ unsigned long nulls1, nulls2; |
864 |
+diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c |
865 |
+index a6d5850..627c35a 100644 |
866 |
+--- a/net/ipv6/tcp_ipv6.c |
867 |
++++ b/net/ipv6/tcp_ipv6.c |
868 |
+@@ -2205,6 +2205,17 @@ void tcp6_proc_exit(struct net *net) |
869 |
+ } |
870 |
+ #endif |
871 |
+ |
872 |
++static void tcp_v6_clear_sk(struct sock *sk, int size) |
873 |
++{ |
874 |
++ struct inet_sock *inet = inet_sk(sk); |
875 |
++ |
876 |
++ /* we do not want to clear pinet6 field, because of RCU lookups */ |
877 |
++ sk_prot_clear_nulls(sk, offsetof(struct inet_sock, pinet6)); |
878 |
++ |
879 |
++ size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); |
880 |
++ memset(&inet->pinet6 + 1, 0, size); |
881 |
++} |
882 |
++ |
883 |
+ struct proto tcpv6_prot = { |
884 |
+ .name = "TCPv6", |
885 |
+ .owner = THIS_MODULE, |
886 |
+@@ -2244,6 +2255,7 @@ struct proto tcpv6_prot = { |
887 |
+ .compat_setsockopt = compat_tcp_setsockopt, |
888 |
+ .compat_getsockopt = compat_tcp_getsockopt, |
889 |
+ #endif |
890 |
++ .clear_sk = tcp_v6_clear_sk, |
891 |
+ }; |
892 |
+ |
893 |
+ static const struct inet6_protocol tcpv6_protocol = { |
894 |
+diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c |
895 |
+index 0d920c5..cd89d6c 100644 |
896 |
+--- a/net/ipv6/udp.c |
897 |
++++ b/net/ipv6/udp.c |
898 |
+@@ -1448,6 +1448,17 @@ void udp6_proc_exit(struct net *net) { |
899 |
+ } |
900 |
+ #endif /* CONFIG_PROC_FS */ |
901 |
+ |
902 |
++void udp_v6_clear_sk(struct sock *sk, int size) |
903 |
++{ |
904 |
++ struct inet_sock *inet = inet_sk(sk); |
905 |
++ |
906 |
++ /* we do not want to clear pinet6 field, because of RCU lookups */ |
907 |
++ sk_prot_clear_portaddr_nulls(sk, offsetof(struct inet_sock, pinet6)); |
908 |
++ |
909 |
++ size -= offsetof(struct inet_sock, pinet6) + sizeof(inet->pinet6); |
910 |
++ memset(&inet->pinet6 + 1, 0, size); |
911 |
++} |
912 |
++ |
913 |
+ /* ------------------------------------------------------------------------ */ |
914 |
+ |
915 |
+ struct proto udpv6_prot = { |
916 |
+@@ -1478,7 +1489,7 @@ struct proto udpv6_prot = { |
917 |
+ .compat_setsockopt = compat_udpv6_setsockopt, |
918 |
+ .compat_getsockopt = compat_udpv6_getsockopt, |
919 |
+ #endif |
920 |
+- .clear_sk = sk_prot_clear_portaddr_nulls, |
921 |
++ .clear_sk = udp_v6_clear_sk, |
922 |
+ }; |
923 |
+ |
924 |
+ static struct inet_protosw udpv6_protosw = { |
925 |
+diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h |
926 |
+index d757104..4691ed5 100644 |
927 |
+--- a/net/ipv6/udp_impl.h |
928 |
++++ b/net/ipv6/udp_impl.h |
929 |
+@@ -31,6 +31,8 @@ extern int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk, |
930 |
+ extern int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb); |
931 |
+ extern void udpv6_destroy_sock(struct sock *sk); |
932 |
+ |
933 |
++extern void udp_v6_clear_sk(struct sock *sk, int size); |
934 |
++ |
935 |
+ #ifdef CONFIG_PROC_FS |
936 |
+ extern int udp6_seq_show(struct seq_file *seq, void *v); |
937 |
+ #endif |
938 |
+diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c |
939 |
+index 986c4de..41b2256 100644 |
940 |
+--- a/net/ipv6/udplite.c |
941 |
++++ b/net/ipv6/udplite.c |
942 |
+@@ -55,7 +55,7 @@ struct proto udplitev6_prot = { |
943 |
+ .compat_setsockopt = compat_udpv6_setsockopt, |
944 |
+ .compat_getsockopt = compat_udpv6_getsockopt, |
945 |
+ #endif |
946 |
+- .clear_sk = sk_prot_clear_portaddr_nulls, |
947 |
++ .clear_sk = udp_v6_clear_sk, |
948 |
+ }; |
949 |
+ |
950 |
+ static struct inet_protosw udplite6_protosw = { |
951 |
+diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c |
952 |
+index d879f7e..db78e7d 100644 |
953 |
+--- a/net/ipv6/xfrm6_policy.c |
954 |
++++ b/net/ipv6/xfrm6_policy.c |
955 |
+@@ -96,8 +96,10 @@ static int xfrm6_fill_dst(struct xfrm_dst *xdst, struct net_device *dev, |
956 |
+ dev_hold(dev); |
957 |
+ |
958 |
+ xdst->u.rt6.rt6i_idev = in6_dev_get(dev); |
959 |
+- if (!xdst->u.rt6.rt6i_idev) |
960 |
++ if (!xdst->u.rt6.rt6i_idev) { |
961 |
++ dev_put(dev); |
962 |
+ return -ENODEV; |
963 |
++ } |
964 |
+ |
965 |
+ xdst->u.rt6.rt6i_peer = rt->rt6i_peer; |
966 |
+ if (rt->rt6i_peer) |
967 |
+diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c |
968 |
+index 9fc211a..ec66b5e 100644 |
969 |
+--- a/net/sched/act_ipt.c |
970 |
++++ b/net/sched/act_ipt.c |
971 |
+@@ -8,7 +8,7 @@ |
972 |
+ * as published by the Free Software Foundation; either version |
973 |
+ * 2 of the License, or (at your option) any later version. |
974 |
+ * |
975 |
+- * Copyright: Jamal Hadi Salim (2002-4) |
976 |
++ * Copyright: Jamal Hadi Salim (2002-13) |
977 |
+ */ |
978 |
+ |
979 |
+ #include <linux/types.h> |
980 |
+@@ -299,17 +299,44 @@ static struct tc_action_ops act_ipt_ops = { |
981 |
+ .walk = tcf_generic_walker |
982 |
+ }; |
983 |
+ |
984 |
+-MODULE_AUTHOR("Jamal Hadi Salim(2002-4)"); |
985 |
++static struct tc_action_ops act_xt_ops = { |
986 |
++ .kind = "xt", |
987 |
++ .hinfo = &ipt_hash_info, |
988 |
++ .type = TCA_ACT_IPT, |
989 |
++ .capab = TCA_CAP_NONE, |
990 |
++ .owner = THIS_MODULE, |
991 |
++ .act = tcf_ipt, |
992 |
++ .dump = tcf_ipt_dump, |
993 |
++ .cleanup = tcf_ipt_cleanup, |
994 |
++ .lookup = tcf_hash_search, |
995 |
++ .init = tcf_ipt_init, |
996 |
++ .walk = tcf_generic_walker |
997 |
++}; |
998 |
++ |
999 |
++MODULE_AUTHOR("Jamal Hadi Salim(2002-13)"); |
1000 |
+ MODULE_DESCRIPTION("Iptables target actions"); |
1001 |
+ MODULE_LICENSE("GPL"); |
1002 |
++MODULE_ALIAS("act_xt"); |
1003 |
+ |
1004 |
+ static int __init ipt_init_module(void) |
1005 |
+ { |
1006 |
+- return tcf_register_action(&act_ipt_ops); |
1007 |
++ int ret1, ret2; |
1008 |
++ ret1 = tcf_register_action(&act_xt_ops); |
1009 |
++ if (ret1 < 0) |
1010 |
++ printk("Failed to load xt action\n"); |
1011 |
++ ret2 = tcf_register_action(&act_ipt_ops); |
1012 |
++ if (ret2 < 0) |
1013 |
++ printk("Failed to load ipt action\n"); |
1014 |
++ |
1015 |
++ if (ret1 < 0 && ret2 < 0) |
1016 |
++ return ret1; |
1017 |
++ else |
1018 |
++ return 0; |
1019 |
+ } |
1020 |
+ |
1021 |
+ static void __exit ipt_cleanup_module(void) |
1022 |
+ { |
1023 |
++ tcf_unregister_action(&act_xt_ops); |
1024 |
+ tcf_unregister_action(&act_ipt_ops); |
1025 |
+ } |
1026 |
+ |
1027 |
+diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c |
1028 |
+index 1f7616d..0c73274 100644 |
1029 |
+--- a/sound/soc/codecs/wm8994.c |
1030 |
++++ b/sound/soc/codecs/wm8994.c |
1031 |
+@@ -2249,6 +2249,7 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream, |
1032 |
+ default: |
1033 |
+ return 0; |
1034 |
+ } |
1035 |
++ break; |
1036 |
+ default: |
1037 |
+ return 0; |
1038 |
+ } |
1039 |
|
1040 |
Added: genpatches-2.6/trunk/3.0/1500_XATTR_USER_PREFIX.patch |
1041 |
=================================================================== |
1042 |
--- genpatches-2.6/trunk/3.0/1500_XATTR_USER_PREFIX.patch (rev 0) |
1043 |
+++ genpatches-2.6/trunk/3.0/1500_XATTR_USER_PREFIX.patch 2013-05-20 17:43:33 UTC (rev 2381) |
1044 |
@@ -0,0 +1,55 @@ |
1045 |
+From: Anthony G. Basile <blueness@g.o> |
1046 |
+ |
1047 |
+This patch adds support for a restricted user-controlled namespace on |
1048 |
+tmpfs filesystem used to house PaX flags. The namespace must be of the |
1049 |
+form user.pax.* and its value cannot exceed a size of 8 bytes. |
1050 |
+ |
1051 |
+This is needed even on all Gentoo systems so that XATTR_PAX flags |
1052 |
+are preserved for users who might build packages using portage on |
1053 |
+a tmpfs system with a non-hardened kernel and then switch to a |
1054 |
+hardened kernel with XATTR_PAX enabled. |
1055 |
+ |
1056 |
+The namespace is added to any user with Extended Attribute support |
1057 |
+enabled for tmpfs. Users who do not enable xattrs will not have |
1058 |
+the XATTR_PAX flags preserved. |
1059 |
+ |
1060 |
+diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h |
1061 |
+index e4629b9..6958086 100644 |
1062 |
+--- a/include/linux/xattr.h |
1063 |
++++ b/include/linux/xattr.h |
1064 |
+@@ -63,3 +63,8 @@ |
1065 |
+ #endif /* __KERNEL__ */ |
1066 |
++ |
1067 |
++/* User namespace */ |
1068 |
++#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." |
1069 |
++#define XATTR_PAX_FLAGS_SUFFIX "flags" |
1070 |
++#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX |
1071 |
+ |
1072 |
+ #endif /* _UAPI_LINUX_XATTR_H */ |
1073 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1074 |
+index 1c44af7..f23bb1b 100644 |
1075 |
+--- a/mm/shmem.c |
1076 |
++++ b/mm/shmem.c |
1077 |
+@@ -2201,6 +2201,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = { |
1078 |
+ static int shmem_xattr_validate(const char *name) |
1079 |
+ { |
1080 |
+ struct { const char *prefix; size_t len; } arr[] = { |
1081 |
++ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN}, |
1082 |
+ { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN }, |
1083 |
+ { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN } |
1084 |
+ }; |
1085 |
+@@ -2256,7 +2257,14 @@ static int shmem_setxattr(struct dentry *dentry, const char *name, |
1086 |
+ if (err) |
1087 |
+ return err; |
1088 |
++ |
1089 |
++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { |
1090 |
++ if (strcmp(name, XATTR_NAME_PAX_FLAGS)) |
1091 |
++ return -EOPNOTSUPP; |
1092 |
++ if (size > 8) |
1093 |
++ return -EINVAL; |
1094 |
++ } |
1095 |
+ |
1096 |
+ if (size == 0) |
1097 |
+ value = ""; /* empty EA, do not remove */ |
1098 |
+ |
1099 |
+ return shmem_xattr_set(dentry, name, value, size, flags); |
1100 |
|
1101 |
Modified: genpatches-2.6/trunk/3.2/0000_README |
1102 |
=================================================================== |
1103 |
--- genpatches-2.6/trunk/3.2/0000_README 2013-05-19 19:38:03 UTC (rev 2380) |
1104 |
+++ genpatches-2.6/trunk/3.2/0000_README 2013-05-20 17:43:33 UTC (rev 2381) |
1105 |
@@ -220,6 +220,10 @@ |
1106 |
From: http://www.kernel.org |
1107 |
Desc: Linux 3.2.45 |
1108 |
|
1109 |
+Patch: 1500_XATTR_USER_PREFIX.patch |
1110 |
+From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
1111 |
+Desc: Support for namespace user.pax.* on tmpfs. |
1112 |
+ |
1113 |
Patch: 2300_per-pci-device-msi-irq-listing.patch |
1114 |
From: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=da8d1c8ba4dcb16d60be54b233deca9a7cac98dc |
1115 |
Desc: Add a per-pci-device subdirectory in sysfs |
1116 |
|
1117 |
Added: genpatches-2.6/trunk/3.2/1500_XATTR_USER_PREFIX.patch |
1118 |
=================================================================== |
1119 |
--- genpatches-2.6/trunk/3.2/1500_XATTR_USER_PREFIX.patch (rev 0) |
1120 |
+++ genpatches-2.6/trunk/3.2/1500_XATTR_USER_PREFIX.patch 2013-05-20 17:43:33 UTC (rev 2381) |
1121 |
@@ -0,0 +1,55 @@ |
1122 |
+From: Anthony G. Basile <blueness@g.o> |
1123 |
+ |
1124 |
+This patch adds support for a restricted user-controlled namespace on |
1125 |
+tmpfs filesystem used to house PaX flags. The namespace must be of the |
1126 |
+form user.pax.* and its value cannot exceed a size of 8 bytes. |
1127 |
+ |
1128 |
+This is needed even on all Gentoo systems so that XATTR_PAX flags |
1129 |
+are preserved for users who might build packages using portage on |
1130 |
+a tmpfs system with a non-hardened kernel and then switch to a |
1131 |
+hardened kernel with XATTR_PAX enabled. |
1132 |
+ |
1133 |
+The namespace is added to any user with Extended Attribute support |
1134 |
+enabled for tmpfs. Users who do not enable xattrs will not have |
1135 |
+the XATTR_PAX flags preserved. |
1136 |
+ |
1137 |
+diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h |
1138 |
+index e4629b9..6958086 100644 |
1139 |
+--- a/include/linux/xattr.h |
1140 |
++++ b/include/linux/xattr.h |
1141 |
+@@ -63,3 +63,8 @@ |
1142 |
+ #endif /* __KERNEL__ */ |
1143 |
++ |
1144 |
++/* User namespace */ |
1145 |
++#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." |
1146 |
++#define XATTR_PAX_FLAGS_SUFFIX "flags" |
1147 |
++#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX |
1148 |
+ |
1149 |
+ #endif /* _UAPI_LINUX_XATTR_H */ |
1150 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1151 |
+index 1c44af7..f23bb1b 100644 |
1152 |
+--- a/mm/shmem.c |
1153 |
++++ b/mm/shmem.c |
1154 |
+@@ -2201,6 +2201,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = { |
1155 |
+ static int shmem_xattr_validate(const char *name) |
1156 |
+ { |
1157 |
+ struct { const char *prefix; size_t len; } arr[] = { |
1158 |
++ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN}, |
1159 |
+ { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN }, |
1160 |
+ { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN } |
1161 |
+ }; |
1162 |
+@@ -2256,7 +2257,14 @@ static int shmem_setxattr(struct dentry *dentry, const char *name, |
1163 |
+ if (err) |
1164 |
+ return err; |
1165 |
++ |
1166 |
++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { |
1167 |
++ if (strcmp(name, XATTR_NAME_PAX_FLAGS)) |
1168 |
++ return -EOPNOTSUPP; |
1169 |
++ if (size > 8) |
1170 |
++ return -EINVAL; |
1171 |
++ } |
1172 |
+ |
1173 |
+ if (size == 0) |
1174 |
+ value = ""; /* empty EA, do not remove */ |
1175 |
+ |
1176 |
+ return shmem_xattr_set(dentry, name, value, size, flags); |
1177 |
|
1178 |
Modified: genpatches-2.6/trunk/3.4/0000_README |
1179 |
=================================================================== |
1180 |
--- genpatches-2.6/trunk/3.4/0000_README 2013-05-19 19:38:03 UTC (rev 2380) |
1181 |
+++ genpatches-2.6/trunk/3.4/0000_README 2013-05-20 17:43:33 UTC (rev 2381) |
1182 |
@@ -223,6 +223,10 @@ |
1183 |
From: http://www.kernel.org |
1184 |
Desc: Linux 3.4.46 |
1185 |
|
1186 |
+Patch: 1500_XATTR_USER_PREFIX.patch |
1187 |
+From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
1188 |
+Desc: Support for namespace user.pax.* on tmpfs. |
1189 |
+ |
1190 |
Patch: 1700_correct-bnx2-firware-ver-mips.patch |
1191 |
From: https://bugs.gentoo.org/show_bug.cgi?id=424609 |
1192 |
Desc: Correct firmware version for bnx2 on mips |
1193 |
|
1194 |
Added: genpatches-2.6/trunk/3.4/1500_XATTR_USER_PREFIX.patch |
1195 |
=================================================================== |
1196 |
--- genpatches-2.6/trunk/3.4/1500_XATTR_USER_PREFIX.patch (rev 0) |
1197 |
+++ genpatches-2.6/trunk/3.4/1500_XATTR_USER_PREFIX.patch 2013-05-20 17:43:33 UTC (rev 2381) |
1198 |
@@ -0,0 +1,55 @@ |
1199 |
+From: Anthony G. Basile <blueness@g.o> |
1200 |
+ |
1201 |
+This patch adds support for a restricted user-controlled namespace on |
1202 |
+tmpfs filesystem used to house PaX flags. The namespace must be of the |
1203 |
+form user.pax.* and its value cannot exceed a size of 8 bytes. |
1204 |
+ |
1205 |
+This is needed even on all Gentoo systems so that XATTR_PAX flags |
1206 |
+are preserved for users who might build packages using portage on |
1207 |
+a tmpfs system with a non-hardened kernel and then switch to a |
1208 |
+hardened kernel with XATTR_PAX enabled. |
1209 |
+ |
1210 |
+The namespace is added to any user with Extended Attribute support |
1211 |
+enabled for tmpfs. Users who do not enable xattrs will not have |
1212 |
+the XATTR_PAX flags preserved. |
1213 |
+ |
1214 |
+diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h |
1215 |
+index e4629b9..6958086 100644 |
1216 |
+--- a/include/linux/xattr.h |
1217 |
++++ b/include/linux/xattr.h |
1218 |
+@@ -63,3 +63,8 @@ |
1219 |
+ #endif /* __KERNEL__ */ |
1220 |
++ |
1221 |
++/* User namespace */ |
1222 |
++#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." |
1223 |
++#define XATTR_PAX_FLAGS_SUFFIX "flags" |
1224 |
++#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX |
1225 |
+ |
1226 |
+ #endif /* _UAPI_LINUX_XATTR_H */ |
1227 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1228 |
+index 1c44af7..f23bb1b 100644 |
1229 |
+--- a/mm/shmem.c |
1230 |
++++ b/mm/shmem.c |
1231 |
+@@ -2201,6 +2201,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = { |
1232 |
+ static int shmem_xattr_validate(const char *name) |
1233 |
+ { |
1234 |
+ struct { const char *prefix; size_t len; } arr[] = { |
1235 |
++ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN}, |
1236 |
+ { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN }, |
1237 |
+ { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN } |
1238 |
+ }; |
1239 |
+@@ -2256,7 +2257,14 @@ static int shmem_setxattr(struct dentry *dentry, const char *name, |
1240 |
+ if (err) |
1241 |
+ return err; |
1242 |
++ |
1243 |
++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { |
1244 |
++ if (strcmp(name, XATTR_NAME_PAX_FLAGS)) |
1245 |
++ return -EOPNOTSUPP; |
1246 |
++ if (size > 8) |
1247 |
++ return -EINVAL; |
1248 |
++ } |
1249 |
+ |
1250 |
+ if (size == 0) |
1251 |
+ value = ""; /* empty EA, do not remove */ |
1252 |
+ |
1253 |
+ return shmem_xattr_set(dentry, name, value, size, flags); |
1254 |
|
1255 |
Modified: genpatches-2.6/trunk/3.9/0000_README |
1256 |
=================================================================== |
1257 |
--- genpatches-2.6/trunk/3.9/0000_README 2013-05-19 19:38:03 UTC (rev 2380) |
1258 |
+++ genpatches-2.6/trunk/3.9/0000_README 2013-05-20 17:43:33 UTC (rev 2381) |
1259 |
@@ -51,6 +51,10 @@ |
1260 |
From: http://www.kernel.org |
1261 |
Desc: Linux 3.9.3 |
1262 |
|
1263 |
+Patch: 1500_XATTR_USER_PREFIX.patch |
1264 |
+From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
1265 |
+Desc: Support for namespace user.pax.* on tmpfs. |
1266 |
+ |
1267 |
Patch: 1700_enable-thinkpad-micled.patch |
1268 |
From: https://bugs.gentoo.org/show_bug.cgi?id=449248 |
1269 |
Desc: Enable mic mute led in thinkpads |
1270 |
|
1271 |
Added: genpatches-2.6/trunk/3.9/1500_XATTR_USER_PREFIX.patch |
1272 |
=================================================================== |
1273 |
--- genpatches-2.6/trunk/3.9/1500_XATTR_USER_PREFIX.patch (rev 0) |
1274 |
+++ genpatches-2.6/trunk/3.9/1500_XATTR_USER_PREFIX.patch 2013-05-20 17:43:33 UTC (rev 2381) |
1275 |
@@ -0,0 +1,54 @@ |
1276 |
+From: Anthony G. Basile <blueness@g.o> |
1277 |
+ |
1278 |
+This patch adds support for a restricted user-controlled namespace on |
1279 |
+tmpfs filesystem used to house PaX flags. The namespace must be of the |
1280 |
+form user.pax.* and its value cannot exceed a size of 8 bytes. |
1281 |
+ |
1282 |
+This is needed even on all Gentoo systems so that XATTR_PAX flags |
1283 |
+are preserved for users who might build packages using portage on |
1284 |
+a tmpfs system with a non-hardened kernel and then switch to a |
1285 |
+hardened kernel with XATTR_PAX enabled. |
1286 |
+ |
1287 |
+The namespace is added to any user with Extended Attribute support |
1288 |
+enabled for tmpfs. Users who do not enable xattrs will not have |
1289 |
+the XATTR_PAX flags preserved. |
1290 |
+ |
1291 |
+diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h |
1292 |
+index e4629b9..6958086 100644 |
1293 |
+--- a/include/uapi/linux/xattr.h |
1294 |
++++ b/include/uapi/linux/xattr.h |
1295 |
+@@ -63,5 +63,9 @@ |
1296 |
+ #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default" |
1297 |
+ #define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT |
1298 |
+ |
1299 |
++/* User namespace */ |
1300 |
++#define XATTR_PAX_PREFIX XATTR_USER_PREFIX "pax." |
1301 |
++#define XATTR_PAX_FLAGS_SUFFIX "flags" |
1302 |
++#define XATTR_NAME_PAX_FLAGS XATTR_PAX_PREFIX XATTR_PAX_FLAGS_SUFFIX |
1303 |
+ |
1304 |
+ #endif /* _UAPI_LINUX_XATTR_H */ |
1305 |
+diff --git a/mm/shmem.c b/mm/shmem.c |
1306 |
+index 1c44af7..f23bb1b 100644 |
1307 |
+--- a/mm/shmem.c |
1308 |
++++ b/mm/shmem.c |
1309 |
+@@ -2201,6 +2201,7 @@ static const struct xattr_handler *shmem_xattr_handlers[] = { |
1310 |
+ static int shmem_xattr_validate(const char *name) |
1311 |
+ { |
1312 |
+ struct { const char *prefix; size_t len; } arr[] = { |
1313 |
++ { XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN}, |
1314 |
+ { XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN }, |
1315 |
+ { XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN } |
1316 |
+ }; |
1317 |
+@@ -2256,6 +2257,12 @@ static int shmem_setxattr(struct dentry *dentry, const char *name, |
1318 |
+ if (err) |
1319 |
+ return err; |
1320 |
+ |
1321 |
++ if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { |
1322 |
++ if (strcmp(name, XATTR_NAME_PAX_FLAGS)) |
1323 |
++ return -EOPNOTSUPP; |
1324 |
++ if (size > 8) |
1325 |
++ return -EINVAL; |
1326 |
++ } |
1327 |
+ return simple_xattr_set(&info->xattrs, name, value, size, flags); |
1328 |
+ } |
1329 |
+ |