aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-01-28 12:24:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-02-01 15:52:47 +0000
commit785eeb30457539c4be3484278cc7899fda596acf (patch)
treeeb1c177b0446a38e8eeb596936576fe12ad71ff0
parent06499b593148a1df4c82274fb4d45b324d0143d2 (diff)
downloadalpine_aports-785eeb30457539c4be3484278cc7899fda596acf.tar.bz2
alpine_aports-785eeb30457539c4be3484278cc7899fda596acf.tar.xz
alpine_aports-785eeb30457539c4be3484278cc7899fda596acf.zip
main/linux-grsec: merge in stable changes
up to 3.4.28 (cherry picked from commit e9cdf8cd88dc59d04558de3006ffd63cf4c175eb) Conflicts: main/linux-grsec/APKBUILD
-rw-r--r--main/linux-grsec/APKBUILD6
-rw-r--r--main/linux-grsec/patch-3.6.11-al2.patch (renamed from main/linux-grsec/patch-3.6.11-al1.patch)892
2 files changed, 893 insertions, 5 deletions
diff --git a/main/linux-grsec/APKBUILD b/main/linux-grsec/APKBUILD
index 21c7b161d6..604ca3bd00 100644
--- a/main/linux-grsec/APKBUILD
+++ b/main/linux-grsec/APKBUILD
@@ -4,7 +4,7 @@ _flavor=grsec
4pkgname=linux-${_flavor} 4pkgname=linux-${_flavor}
5pkgver=3.6.11 5pkgver=3.6.11
6_kernver=3.6 6_kernver=3.6
7pkgrel=5 7pkgrel=6
8pkgdesc="Linux kernel with grsecurity" 8pkgdesc="Linux kernel with grsecurity"
9url=http://grsecurity.net 9url=http://grsecurity.net
10depends="mkinitfs linux-firmware" 10depends="mkinitfs linux-firmware"
@@ -14,7 +14,7 @@ _config=${config:-kernelconfig.${CARCH}}
14install= 14install=
15source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz 15source="http://ftp.kernel.org/pub/linux/kernel/v3.x/linux-$_kernver.tar.xz
16 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz 16 http://ftp.kernel.org/pub/linux/kernel/v3.x/patch-$pkgver.xz
17 patch-3.6.11-al1.patch 17 patch-3.6.11-al2.patch
18 grsecurity-2.9.1-3.6.11-al1-unofficial-0.patch 18 grsecurity-2.9.1-3.6.11-al1-unofficial-0.patch
19 19
20 0004-arp-flush-arp-cache-on-device-change.patch 20 0004-arp-flush-arp-cache-on-device-change.patch
@@ -144,7 +144,7 @@ dev() {
144 144
145md5sums="1a1760420eac802c541a20ab51a093d1 linux-3.6.tar.xz 145md5sums="1a1760420eac802c541a20ab51a093d1 linux-3.6.tar.xz
146bd4bba74093405887d521309a74c19e9 patch-3.6.11.xz 146bd4bba74093405887d521309a74c19e9 patch-3.6.11.xz
14790efc91d59e9cfde50de2031a798e62b patch-3.6.11-al1.patch 1474d225839f004e4133c5fa48b7ca0ddf5 patch-3.6.11-al2.patch
1483838e6334ed957fd73e793e1816fe66c grsecurity-2.9.1-3.6.11-al1-unofficial-0.patch 1483838e6334ed957fd73e793e1816fe66c grsecurity-2.9.1-3.6.11-al1-unofficial-0.patch
149776adeeb5272093574f8836c5037dd7d 0004-arp-flush-arp-cache-on-device-change.patch 149776adeeb5272093574f8836c5037dd7d 0004-arp-flush-arp-cache-on-device-change.patch
150daf2cbb558588c49c138fe9ca2482b64 r8169-num-rx-desc.patch 150daf2cbb558588c49c138fe9ca2482b64 r8169-num-rx-desc.patch
diff --git a/main/linux-grsec/patch-3.6.11-al1.patch b/main/linux-grsec/patch-3.6.11-al2.patch
index 053b2c9d75..3139bf3a63 100644
--- a/main/linux-grsec/patch-3.6.11-al1.patch
+++ b/main/linux-grsec/patch-3.6.11-al2.patch
@@ -422,6 +422,28 @@ index 5cee802..53339c1 100644
422 init_gbpages(); 422 init_gbpages();
423 423
424 /* max_pfn_mapped is updated here */ 424 /* max_pfn_mapped is updated here */
425diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
426index ad3730b..aac684d 100644
427--- a/drivers/acpi/processor_idle.c
428+++ b/drivers/acpi/processor_idle.c
429@@ -1009,6 +1009,9 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr)
430 return -EINVAL;
431 }
432
433+ if (!dev)
434+ return -EINVAL;
435+
436 dev->cpu = pr->id;
437
438 if (max_cstate == 0)
439@@ -1196,6 +1199,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
440 }
441
442 /* Populate Updated C-state information */
443+ acpi_processor_get_power_info(pr);
444 acpi_processor_setup_cpuidle_states(pr);
445
446 /* Enable all cpuidle devices */
425diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c 447diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
426index d1ecca2..f1fcaca 100644 448index d1ecca2..f1fcaca 100644
427--- a/drivers/acpi/scan.c 449--- a/drivers/acpi/scan.c
@@ -842,6 +864,41 @@ index 847ed55..813aa38 100644
842 sleep_states[ACPI_STATE_S0] = 1; 864 sleep_states[ACPI_STATE_S0] = 1;
843 printk(KERN_INFO PREFIX "(supports S0"); 865 printk(KERN_INFO PREFIX "(supports S0");
844 866
867diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
868index 7862d17..4979127 100644
869--- a/drivers/ata/ahci.c
870+++ b/drivers/ata/ahci.c
871@@ -53,6 +53,7 @@
872
873 enum {
874 AHCI_PCI_BAR_STA2X11 = 0,
875+ AHCI_PCI_BAR_ENMOTUS = 2,
876 AHCI_PCI_BAR_STANDARD = 5,
877 };
878
879@@ -410,6 +411,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
880 { PCI_VDEVICE(ASMEDIA, 0x0611), board_ahci }, /* ASM1061 */
881 { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */
882
883+ /* Enmotus */
884+ { PCI_DEVICE(0x1c44, 0x8000), board_ahci },
885+
886 /* Generic, PCI class code for AHCI */
887 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
888 PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },
889@@ -1098,9 +1102,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
890 dev_info(&pdev->dev,
891 "PDC42819 can only drive SATA devices with this driver\n");
892
893- /* The Connext uses non-standard BAR */
894+ /* Both Connext and Enmotus devices use non-standard BARs */
895 if (pdev->vendor == PCI_VENDOR_ID_STMICRO && pdev->device == 0xCC06)
896 ahci_pci_bar = AHCI_PCI_BAR_STA2X11;
897+ else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
898+ ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
899
900 /* acquire resources */
901 rc = pcim_enable_device(pdev);
845diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c 902diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
846index 8e1039c..8789aef 100644 903index 8e1039c..8789aef 100644
847--- a/drivers/ata/libata-core.c 904--- a/drivers/ata/libata-core.c
@@ -1221,6 +1278,19 @@ index 654e248..e023c65 100644
1221 1278
1222 /* Atheros AR9285 Malbec with sflash firmware */ 1279 /* Atheros AR9285 Malbec with sflash firmware */
1223 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE }, 1280 { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },
1281diff --git a/drivers/dma/ioat/dma_v3.c b/drivers/dma/ioat/dma_v3.c
1282index f7f1dc6..ed0e8b7 100644
1283--- a/drivers/dma/ioat/dma_v3.c
1284+++ b/drivers/dma/ioat/dma_v3.c
1285@@ -951,7 +951,7 @@ static int __devinit ioat_xor_val_self_test(struct ioatdma_device *device)
1286 goto free_resources;
1287 }
1288 }
1289- dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_TO_DEVICE);
1290+ dma_sync_single_for_device(dev, dest_dma, PAGE_SIZE, DMA_FROM_DEVICE);
1291
1292 /* skip validate if the capability is not present */
1293 if (!dma_has_cap(DMA_XOR_VAL, dma_chan->device->cap_mask))
1224diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c 1294diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
1225index 08c6749..638e1f7 100644 1295index 08c6749..638e1f7 100644
1226--- a/drivers/firewire/net.c 1296--- a/drivers/firewire/net.c
@@ -1259,11 +1329,206 @@ index 08c6749..638e1f7 100644
1259 put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p); 1329 put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);
1260 put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24 1330 put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24
1261 | RFC2734_SW_VERSION, &p[4]); 1331 | RFC2734_SW_VERSION, &p[4]);
1332diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
1333index b298158..fd3ae62 100644
1334--- a/drivers/firmware/dmi_scan.c
1335+++ b/drivers/firmware/dmi_scan.c
1336@@ -16,6 +16,7 @@
1337 */
1338 static char dmi_empty_string[] = " ";
1339
1340+static u16 __initdata dmi_ver;
1341 /*
1342 * Catch too early calls to dmi_check_system():
1343 */
1344@@ -118,12 +119,12 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *,
1345 return 0;
1346 }
1347
1348-static int __init dmi_checksum(const u8 *buf)
1349+static int __init dmi_checksum(const u8 *buf, u8 len)
1350 {
1351 u8 sum = 0;
1352 int a;
1353
1354- for (a = 0; a < 15; a++)
1355+ for (a = 0; a < len; a++)
1356 sum += buf[a];
1357
1358 return sum == 0;
1359@@ -161,8 +162,10 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde
1360 return;
1361
1362 for (i = 0; i < 16 && (is_ff || is_00); i++) {
1363- if(d[i] != 0x00) is_ff = 0;
1364- if(d[i] != 0xFF) is_00 = 0;
1365+ if (d[i] != 0x00)
1366+ is_00 = 0;
1367+ if (d[i] != 0xFF)
1368+ is_ff = 0;
1369 }
1370
1371 if (is_ff || is_00)
1372@@ -172,7 +175,15 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, int inde
1373 if (!s)
1374 return;
1375
1376- sprintf(s, "%pUB", d);
1377+ /*
1378+ * As of version 2.6 of the SMBIOS specification, the first 3 fields of
1379+ * the UUID are supposed to be little-endian encoded. The specification
1380+ * says that this is the defacto standard.
1381+ */
1382+ if (dmi_ver >= 0x0206)
1383+ sprintf(s, "%pUL", d);
1384+ else
1385+ sprintf(s, "%pUB", d);
1386
1387 dmi_ident[slot] = s;
1388 }
1389@@ -404,29 +415,57 @@ static int __init dmi_present(const char __iomem *p)
1390 u8 buf[15];
1391
1392 memcpy_fromio(buf, p, 15);
1393- if ((memcmp(buf, "_DMI_", 5) == 0) && dmi_checksum(buf)) {
1394+ if (dmi_checksum(buf, 15)) {
1395 dmi_num = (buf[13] << 8) | buf[12];
1396 dmi_len = (buf[7] << 8) | buf[6];
1397 dmi_base = (buf[11] << 24) | (buf[10] << 16) |
1398 (buf[9] << 8) | buf[8];
1399
1400- /*
1401- * DMI version 0.0 means that the real version is taken from
1402- * the SMBIOS version, which we don't know at this point.
1403- */
1404- if (buf[14] != 0)
1405- printk(KERN_INFO "DMI %d.%d present.\n",
1406- buf[14] >> 4, buf[14] & 0xF);
1407- else
1408- printk(KERN_INFO "DMI present.\n");
1409 if (dmi_walk_early(dmi_decode) == 0) {
1410+ if (dmi_ver)
1411+ pr_info("SMBIOS %d.%d present.\n",
1412+ dmi_ver >> 8, dmi_ver & 0xFF);
1413+ else {
1414+ dmi_ver = (buf[14] & 0xF0) << 4 |
1415+ (buf[14] & 0x0F);
1416+ pr_info("Legacy DMI %d.%d present.\n",
1417+ dmi_ver >> 8, dmi_ver & 0xFF);
1418+ }
1419 dmi_dump_ids();
1420 return 0;
1421 }
1422 }
1423+ dmi_ver = 0;
1424 return 1;
1425 }
1426
1427+static int __init smbios_present(const char __iomem *p)
1428+{
1429+ u8 buf[32];
1430+ int offset = 0;
1431+
1432+ memcpy_fromio(buf, p, 32);
1433+ if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) {
1434+ dmi_ver = (buf[6] << 8) + buf[7];
1435+
1436+ /* Some BIOS report weird SMBIOS version, fix that up */
1437+ switch (dmi_ver) {
1438+ case 0x021F:
1439+ case 0x0221:
1440+ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n",
1441+ dmi_ver & 0xFF, 3);
1442+ dmi_ver = 0x0203;
1443+ break;
1444+ case 0x0233:
1445+ pr_debug("SMBIOS version fixup(2.%d->2.%d)\n", 51, 6);
1446+ dmi_ver = 0x0206;
1447+ break;
1448+ }
1449+ offset = 16;
1450+ }
1451+ return dmi_present(buf + offset);
1452+}
1453+
1454 void __init dmi_scan_machine(void)
1455 {
1456 char __iomem *p, *q;
1457@@ -444,7 +483,7 @@ void __init dmi_scan_machine(void)
1458 if (p == NULL)
1459 goto error;
1460
1461- rc = dmi_present(p + 0x10); /* offset of _DMI_ string */
1462+ rc = smbios_present(p);
1463 dmi_iounmap(p, 32);
1464 if (!rc) {
1465 dmi_available = 1;
1466@@ -462,7 +501,12 @@ void __init dmi_scan_machine(void)
1467 goto error;
1468
1469 for (q = p; q < p + 0x10000; q += 16) {
1470- rc = dmi_present(q);
1471+ if (memcmp(q, "_SM_", 4) == 0 && q - p <= 0xFFE0)
1472+ rc = smbios_present(q);
1473+ else if (memcmp(q, "_DMI_", 5) == 0)
1474+ rc = dmi_present(q);
1475+ else
1476+ continue;
1477 if (!rc) {
1478 dmi_available = 1;
1479 dmi_iounmap(p, 0x10000);
1480diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
1481index cdf46b5..d8bb392 100644
1482--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
1483+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
1484@@ -749,6 +749,8 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
1485 total = 0;
1486 for (i = 0; i < count; i++) {
1487 struct drm_i915_gem_relocation_entry __user *user_relocs;
1488+ u64 invalid_offset = (u64)-1;
1489+ int j;
1490
1491 user_relocs = (void __user *)(uintptr_t)exec[i].relocs_ptr;
1492
1493@@ -759,6 +761,25 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
1494 goto err;
1495 }
1496
1497+ /* As we do not update the known relocation offsets after
1498+ * relocating (due to the complexities in lock handling),
1499+ * we need to mark them as invalid now so that we force the
1500+ * relocation processing next time. Just in case the target
1501+ * object is evicted and then rebound into its old
1502+ * presumed_offset before the next execbuffer - if that
1503+ * happened we would make the mistake of assuming that the
1504+ * relocations were valid.
1505+ */
1506+ for (j = 0; j < exec[i].relocation_count; j++) {
1507+ if (copy_to_user(&user_relocs[j].presumed_offset,
1508+ &invalid_offset,
1509+ sizeof(invalid_offset))) {
1510+ ret = -EFAULT;
1511+ mutex_lock(&dev->struct_mutex);
1512+ goto err;
1513+ }
1514+ }
1515+
1516 reloc_offset[i] = total;
1517 total += exec[i].relocation_count;
1518 }
1262diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h 1519diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
1263index f02cfad..a1f91aa 100644 1520index f02cfad..380e7da 100644
1264--- a/drivers/gpu/drm/i915/i915_reg.h 1521--- a/drivers/gpu/drm/i915/i915_reg.h
1265+++ b/drivers/gpu/drm/i915/i915_reg.h 1522+++ b/drivers/gpu/drm/i915/i915_reg.h
1266@@ -3274,6 +3274,8 @@ 1523@@ -506,6 +506,7 @@
1524 * the enables for writing to the corresponding low bit.
1525 */
1526 #define _3D_CHICKEN 0x02084
1527+#define _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB (1 << 10)
1528 #define _3D_CHICKEN2 0x0208c
1529 /* Disables pipelining of read flushes past the SF-WIZ interface.
1530 * Required on all Ironlake steppings according to the B-Spec, but the
1531@@ -3274,6 +3275,8 @@
1267 #define _PFA_CTL_1 0x68080 1532 #define _PFA_CTL_1 0x68080
1268 #define _PFB_CTL_1 0x68880 1533 #define _PFB_CTL_1 0x68880
1269 #define PF_ENABLE (1<<31) 1534 #define PF_ENABLE (1<<31)
@@ -1374,6 +1639,21 @@ index 0c52448..2e6448c 100644
1374 .ident = "Gigabyte GA-D525TUD", 1639 .ident = "Gigabyte GA-D525TUD",
1375 .matches = { 1640 .matches = {
1376 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."), 1641 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co., Ltd."),
1642diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
1643index c23c9ea..572b2ca 100644
1644--- a/drivers/gpu/drm/i915/intel_pm.c
1645+++ b/drivers/gpu/drm/i915/intel_pm.c
1646@@ -3324,6 +3324,10 @@ static void gen6_init_clock_gating(struct drm_device *dev)
1647 I915_READ(ILK_DISPLAY_CHICKEN2) |
1648 ILK_ELPIN_409_SELECT);
1649
1650+ /* WaDisableHiZPlanesWhenMSAAEnabled */
1651+ I915_WRITE(_3D_CHICKEN,
1652+ _MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB));
1653+
1654 I915_WRITE(WM3_LP_ILK, 0);
1655 I915_WRITE(WM2_LP_ILK, 0);
1656 I915_WRITE(WM1_LP_ILK, 0);
1377diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c 1657diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c
1378index 89640f2..2b59f41 100644 1658index 89640f2..2b59f41 100644
1379--- a/drivers/gpu/drm/nouveau/nv04_dfp.c 1659--- a/drivers/gpu/drm/nouveau/nv04_dfp.c
@@ -3305,6 +3585,242 @@ index aa970fc..8fa144f 100644
3305 } 3585 }
3306 3586
3307 static void _rtl_usb_io_handler_init(struct device *dev, 3587 static void _rtl_usb_io_handler_init(struct device *dev,
3588diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
3589index 26ffd3e..2c113de 100644
3590--- a/drivers/pci/hotplug/pciehp.h
3591+++ b/drivers/pci/hotplug/pciehp.h
3592@@ -44,7 +44,6 @@ extern bool pciehp_poll_mode;
3593 extern int pciehp_poll_time;
3594 extern bool pciehp_debug;
3595 extern bool pciehp_force;
3596-extern struct workqueue_struct *pciehp_wq;
3597
3598 #define dbg(format, arg...) \
3599 do { \
3600@@ -78,6 +77,7 @@ struct slot {
3601 struct hotplug_slot *hotplug_slot;
3602 struct delayed_work work; /* work for button event */
3603 struct mutex lock;
3604+ struct workqueue_struct *wq;
3605 };
3606
3607 struct event_info {
3608diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
3609index 365c6b9..9e39df9 100644
3610--- a/drivers/pci/hotplug/pciehp_core.c
3611+++ b/drivers/pci/hotplug/pciehp_core.c
3612@@ -42,7 +42,6 @@ bool pciehp_debug;
3613 bool pciehp_poll_mode;
3614 int pciehp_poll_time;
3615 bool pciehp_force;
3616-struct workqueue_struct *pciehp_wq;
3617
3618 #define DRIVER_VERSION "0.4"
3619 #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
3620@@ -340,18 +339,13 @@ static int __init pcied_init(void)
3621 {
3622 int retval = 0;
3623
3624- pciehp_wq = alloc_workqueue("pciehp", 0, 0);
3625- if (!pciehp_wq)
3626- return -ENOMEM;
3627-
3628 pciehp_firmware_init();
3629 retval = pcie_port_service_register(&hpdriver_portdrv);
3630 dbg("pcie_port_service_register = %d\n", retval);
3631 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
3632- if (retval) {
3633- destroy_workqueue(pciehp_wq);
3634+ if (retval)
3635 dbg("Failure to register service\n");
3636- }
3637+
3638 return retval;
3639 }
3640
3641@@ -359,7 +353,6 @@ static void __exit pcied_cleanup(void)
3642 {
3643 dbg("unload_pciehpd()\n");
3644 pcie_port_service_unregister(&hpdriver_portdrv);
3645- destroy_workqueue(pciehp_wq);
3646 info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
3647 }
3648
3649diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
3650index 27f4429..38f0186 100644
3651--- a/drivers/pci/hotplug/pciehp_ctrl.c
3652+++ b/drivers/pci/hotplug/pciehp_ctrl.c
3653@@ -49,7 +49,7 @@ static int queue_interrupt_event(struct slot *p_slot, u32 event_type)
3654 info->p_slot = p_slot;
3655 INIT_WORK(&info->work, interrupt_event_handler);
3656
3657- queue_work(pciehp_wq, &info->work);
3658+ queue_work(p_slot->wq, &info->work);
3659
3660 return 0;
3661 }
3662@@ -344,7 +344,7 @@ void pciehp_queue_pushbutton_work(struct work_struct *work)
3663 kfree(info);
3664 goto out;
3665 }
3666- queue_work(pciehp_wq, &info->work);
3667+ queue_work(p_slot->wq, &info->work);
3668 out:
3669 mutex_unlock(&p_slot->lock);
3670 }
3671@@ -377,7 +377,7 @@ static void handle_button_press_event(struct slot *p_slot)
3672 if (ATTN_LED(ctrl))
3673 pciehp_set_attention_status(p_slot, 0);
3674
3675- queue_delayed_work(pciehp_wq, &p_slot->work, 5*HZ);
3676+ queue_delayed_work(p_slot->wq, &p_slot->work, 5*HZ);
3677 break;
3678 case BLINKINGOFF_STATE:
3679 case BLINKINGON_STATE:
3680@@ -439,7 +439,7 @@ static void handle_surprise_event(struct slot *p_slot)
3681 else
3682 p_slot->state = POWERON_STATE;
3683
3684- queue_work(pciehp_wq, &info->work);
3685+ queue_work(p_slot->wq, &info->work);
3686 }
3687
3688 static void interrupt_event_handler(struct work_struct *work)
3689diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
3690index 302451e..61632c5 100644
3691--- a/drivers/pci/hotplug/pciehp_hpc.c
3692+++ b/drivers/pci/hotplug/pciehp_hpc.c
3693@@ -773,23 +773,32 @@ static void pcie_shutdown_notification(struct controller *ctrl)
3694 static int pcie_init_slot(struct controller *ctrl)
3695 {
3696 struct slot *slot;
3697+ char name[32];
3698
3699 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
3700 if (!slot)
3701 return -ENOMEM;
3702
3703+ snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
3704+ slot->wq = alloc_workqueue(name, 0, 0);
3705+ if (!slot->wq)
3706+ goto abort;
3707+
3708 slot->ctrl = ctrl;
3709 mutex_init(&slot->lock);
3710 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
3711 ctrl->slot = slot;
3712 return 0;
3713+abort:
3714+ kfree(slot);
3715+ return -ENOMEM;
3716 }
3717
3718 static void pcie_cleanup_slot(struct controller *ctrl)
3719 {
3720 struct slot *slot = ctrl->slot;
3721 cancel_delayed_work(&slot->work);
3722- flush_workqueue(pciehp_wq);
3723+ destroy_workqueue(slot->wq);
3724 kfree(slot);
3725 }
3726
3727diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
3728index ca64932..1b69d95 100644
3729--- a/drivers/pci/hotplug/shpchp.h
3730+++ b/drivers/pci/hotplug/shpchp.h
3731@@ -47,7 +47,6 @@ extern bool shpchp_poll_mode;
3732 extern int shpchp_poll_time;
3733 extern bool shpchp_debug;
3734 extern struct workqueue_struct *shpchp_wq;
3735-extern struct workqueue_struct *shpchp_ordered_wq;
3736
3737 #define dbg(format, arg...) \
3738 do { \
3739diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
3740index b6de307..8c6d645 100644
3741--- a/drivers/pci/hotplug/shpchp_core.c
3742+++ b/drivers/pci/hotplug/shpchp_core.c
3743@@ -40,7 +40,6 @@ bool shpchp_debug;
3744 bool shpchp_poll_mode;
3745 int shpchp_poll_time;
3746 struct workqueue_struct *shpchp_wq;
3747-struct workqueue_struct *shpchp_ordered_wq;
3748
3749 #define DRIVER_VERSION "0.4"
3750 #define DRIVER_AUTHOR "Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"
3751@@ -181,7 +180,6 @@ void cleanup_slots(struct controller *ctrl)
3752 list_del(&slot->slot_list);
3753 cancel_delayed_work(&slot->work);
3754 flush_workqueue(shpchp_wq);
3755- flush_workqueue(shpchp_ordered_wq);
3756 pci_hp_deregister(slot->hotplug_slot);
3757 }
3758 }
3759@@ -370,17 +368,10 @@ static int __init shpcd_init(void)
3760 if (!shpchp_wq)
3761 return -ENOMEM;
3762
3763- shpchp_ordered_wq = alloc_ordered_workqueue("shpchp_ordered", 0);
3764- if (!shpchp_ordered_wq) {
3765- destroy_workqueue(shpchp_wq);
3766- return -ENOMEM;
3767- }
3768-
3769 retval = pci_register_driver(&shpc_driver);
3770 dbg("%s: pci_register_driver = %d\n", __func__, retval);
3771 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
3772 if (retval) {
3773- destroy_workqueue(shpchp_ordered_wq);
3774 destroy_workqueue(shpchp_wq);
3775 }
3776 return retval;
3777@@ -390,7 +381,6 @@ static void __exit shpcd_cleanup(void)
3778 {
3779 dbg("unload_shpchpd()\n");
3780 pci_unregister_driver(&shpc_driver);
3781- destroy_workqueue(shpchp_ordered_wq);
3782 destroy_workqueue(shpchp_wq);
3783 info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
3784 }
3785diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c
3786index f9b5a52..fd2cae9 100644
3787--- a/drivers/pci/hotplug/shpchp_ctrl.c
3788+++ b/drivers/pci/hotplug/shpchp_ctrl.c
3789@@ -453,7 +453,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work)
3790 kfree(info);
3791 goto out;
3792 }
3793- queue_work(shpchp_ordered_wq, &info->work);
3794+ queue_work(shpchp_wq, &info->work);
3795 out:
3796 mutex_unlock(&p_slot->lock);
3797 }
3798diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c
3799index 1b7d05d..b0c92a5 100644
3800--- a/drivers/pci/pcie/aer/aerdrv_core.c
3801+++ b/drivers/pci/pcie/aer/aerdrv_core.c
3802@@ -649,6 +649,7 @@ static void aer_recover_work_func(struct work_struct *work)
3803 continue;
3804 }
3805 do_recovery(pdev, entry.severity);
3806+ pci_dev_put(pdev);
3807 }
3808 }
3809 #endif
3810diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
3811index b500840..474f22f 100644
3812--- a/drivers/pci/pcie/aspm.c
3813+++ b/drivers/pci/pcie/aspm.c
3814@@ -798,6 +798,9 @@ void pcie_clear_aspm(struct pci_bus *bus)
3815 {
3816 struct pci_dev *child;
3817
3818+ if (aspm_force)
3819+ return;
3820+
3821 /*
3822 * Clear any ASPM setup that the firmware has carried out on this bus
3823 */
3308diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c 3824diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
3309index 5155317..161e7f0 100644 3825index 5155317..161e7f0 100644
3310--- a/drivers/pci/quirks.c 3826--- a/drivers/pci/quirks.c
@@ -3578,6 +4094,49 @@ index ce5224c..931a7d9 100644
3578 if (!type) 4094 if (!type)
3579 goto exit_store_host_reset; 4095 goto exit_store_host_reset;
3580 4096
4097diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
4098index 4df73e5..8afedd6 100644
4099--- a/drivers/scsi/sd.c
4100+++ b/drivers/scsi/sd.c
4101@@ -2926,10 +2926,6 @@ static int __init init_sd(void)
4102 if (err)
4103 goto err_out;
4104
4105- err = scsi_register_driver(&sd_template.gendrv);
4106- if (err)
4107- goto err_out_class;
4108-
4109 sd_cdb_cache = kmem_cache_create("sd_ext_cdb", SD_EXT_CDB_SIZE,
4110 0, 0, NULL);
4111 if (!sd_cdb_cache) {
4112@@ -2943,8 +2939,15 @@ static int __init init_sd(void)
4113 goto err_out_cache;
4114 }
4115
4116+ err = scsi_register_driver(&sd_template.gendrv);
4117+ if (err)
4118+ goto err_out_driver;
4119+
4120 return 0;
4121
4122+err_out_driver:
4123+ mempool_destroy(sd_cdb_pool);
4124+
4125 err_out_cache:
4126 kmem_cache_destroy(sd_cdb_cache);
4127
4128@@ -2967,10 +2970,10 @@ static void __exit exit_sd(void)
4129
4130 SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n"));
4131
4132+ scsi_unregister_driver(&sd_template.gendrv);
4133 mempool_destroy(sd_cdb_pool);
4134 kmem_cache_destroy(sd_cdb_cache);
4135
4136- scsi_unregister_driver(&sd_template.gendrv);
4137 class_unregister(&sd_disk_class);
4138
4139 for (i = 0; i < SD_MAJORS; i++)
3581diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig 4140diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
3582index 6cee785..2701546 100644 4141index 6cee785..2701546 100644
3583--- a/drivers/staging/comedi/Kconfig 4142--- a/drivers/staging/comedi/Kconfig
@@ -4828,6 +5387,18 @@ index 0ab7da2..583150b 100644
4828 if (cp->string == NULL && 5387 if (cp->string == NULL &&
4829 !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) 5388 !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
4830 cp->string = usb_cache_string(dev, cp->desc.iConfiguration); 5389 cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
5390diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
5391index eb0fd10..b6c4084 100644
5392--- a/drivers/usb/dwc3/gadget.c
5393+++ b/drivers/usb/dwc3/gadget.c
5394@@ -1619,6 +1619,7 @@ static int __devinit dwc3_gadget_init_endpoints(struct dwc3 *dwc)
5395
5396 if (epnum == 0 || epnum == 1) {
5397 dep->endpoint.maxpacket = 512;
5398+ dep->endpoint.maxburst = 1;
5399 dep->endpoint.ops = &dwc3_gadget_ep0_ops;
5400 if (!epnum)
5401 dwc->gadget.ep0 = &dep->endpoint;
4831diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c 5402diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
4832index afdbb1c..4ad1f1c 100644 5403index afdbb1c..4ad1f1c 100644
4833--- a/drivers/usb/gadget/dummy_hcd.c 5404--- a/drivers/usb/gadget/dummy_hcd.c
@@ -5082,6 +5653,60 @@ index 39f9e4a..eb5563a 100644
5082 } 5653 }
5083 5654
5084 bool usb_is_intel_switchable_xhci(struct pci_dev *pdev) 5655 bool usb_is_intel_switchable_xhci(struct pci_dev *pdev)
5656diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c
5657index e4db350..3fe069f 100644
5658--- a/drivers/usb/host/uhci-hcd.c
5659+++ b/drivers/usb/host/uhci-hcd.c
5660@@ -447,6 +447,10 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
5661 return IRQ_NONE;
5662 uhci_writew(uhci, status, USBSTS); /* Clear it */
5663
5664+ spin_lock(&uhci->lock);
5665+ if (unlikely(!uhci->is_initialized)) /* not yet configured */
5666+ goto done;
5667+
5668 if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) {
5669 if (status & USBSTS_HSE)
5670 dev_err(uhci_dev(uhci), "host system error, "
5671@@ -455,7 +459,6 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
5672 dev_err(uhci_dev(uhci), "host controller process "
5673 "error, something bad happened!\n");
5674 if (status & USBSTS_HCH) {
5675- spin_lock(&uhci->lock);
5676 if (uhci->rh_state >= UHCI_RH_RUNNING) {
5677 dev_err(uhci_dev(uhci),
5678 "host controller halted, "
5679@@ -473,15 +476,15 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
5680 * pending unlinks */
5681 mod_timer(&hcd->rh_timer, jiffies);
5682 }
5683- spin_unlock(&uhci->lock);
5684 }
5685 }
5686
5687- if (status & USBSTS_RD)
5688+ if (status & USBSTS_RD) {
5689+ spin_unlock(&uhci->lock);
5690 usb_hcd_poll_rh_status(hcd);
5691- else {
5692- spin_lock(&uhci->lock);
5693+ } else {
5694 uhci_scan_schedule(uhci);
5695+ done:
5696 spin_unlock(&uhci->lock);
5697 }
5698
5699@@ -662,9 +665,9 @@ static int uhci_start(struct usb_hcd *hcd)
5700 */
5701 mb();
5702
5703+ spin_lock_irq(&uhci->lock);
5704 configure_hc(uhci);
5705 uhci->is_initialized = 1;
5706- spin_lock_irq(&uhci->lock);
5707 start_rh(uhci);
5708 spin_unlock_irq(&uhci->lock);
5709 return 0;
5085diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c 5710diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
5086index d5eb357..abb9772 100644 5711index d5eb357..abb9772 100644
5087--- a/drivers/usb/host/xhci-hub.c 5712--- a/drivers/usb/host/xhci-hub.c
@@ -6681,6 +7306,28 @@ index 8d3c427..50a6cbe 100644
6681 #define PCI_DEVICE_ID_RICOH_R5CE823 0xe823 7306 #define PCI_DEVICE_ID_RICOH_R5CE823 0xe823
6682 #define PCI_DEVICE_ID_RICOH_R5C832 0x0832 7307 #define PCI_DEVICE_ID_RICOH_R5C832 0x0832
6683 #define PCI_DEVICE_ID_RICOH_R5C843 0x0843 7308 #define PCI_DEVICE_ID_RICOH_R5C843 0x0843
7309diff --git a/include/linux/sched.h b/include/linux/sched.h
7310index 23bddac..d2bbc12 100644
7311--- a/include/linux/sched.h
7312+++ b/include/linux/sched.h
7313@@ -2684,7 +2684,16 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)
7314 extern void recalc_sigpending_and_wake(struct task_struct *t);
7315 extern void recalc_sigpending(void);
7316
7317-extern void signal_wake_up(struct task_struct *t, int resume_stopped);
7318+extern void signal_wake_up_state(struct task_struct *t, unsigned int state);
7319+
7320+static inline void signal_wake_up(struct task_struct *t, bool resume)
7321+{
7322+ signal_wake_up_state(t, resume ? TASK_WAKEKILL : 0);
7323+}
7324+static inline void ptrace_signal_wake_up(struct task_struct *t, bool resume)
7325+{
7326+ signal_wake_up_state(t, resume ? __TASK_TRACED : 0);
7327+}
7328
7329 /*
7330 * Wrappers for p->thread_info->cpu access. No-op on UP.
6684diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h 7331diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
6685index ba1d361..1832927 100644 7332index ba1d361..1832927 100644
6686--- a/include/net/inet_connection_sock.h 7333--- a/include/net/inet_connection_sock.h
@@ -6779,6 +7426,231 @@ index 4c69326..e48caf8 100644
6779 } 7426 }
6780 7427
6781 if (!alloc_cpumask_var(&mask, GFP_KERNEL)) { 7428 if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
7429diff --git a/kernel/ptrace.c b/kernel/ptrace.c
7430index a232bb5..b96de86b4 100644
7431--- a/kernel/ptrace.c
7432+++ b/kernel/ptrace.c
7433@@ -117,11 +117,45 @@ void __ptrace_unlink(struct task_struct *child)
7434 * TASK_KILLABLE sleeps.
7435 */
7436 if (child->jobctl & JOBCTL_STOP_PENDING || task_is_traced(child))
7437- signal_wake_up(child, task_is_traced(child));
7438+ ptrace_signal_wake_up(child, true);
7439
7440 spin_unlock(&child->sighand->siglock);
7441 }
7442
7443+/* Ensure that nothing can wake it up, even SIGKILL */
7444+static bool ptrace_freeze_traced(struct task_struct *task)
7445+{
7446+ bool ret = false;
7447+
7448+ /* Lockless, nobody but us can set this flag */
7449+ if (task->jobctl & JOBCTL_LISTENING)
7450+ return ret;
7451+
7452+ spin_lock_irq(&task->sighand->siglock);
7453+ if (task_is_traced(task) && !__fatal_signal_pending(task)) {
7454+ task->state = __TASK_TRACED;
7455+ ret = true;
7456+ }
7457+ spin_unlock_irq(&task->sighand->siglock);
7458+
7459+ return ret;
7460+}
7461+
7462+static void ptrace_unfreeze_traced(struct task_struct *task)
7463+{
7464+ if (task->state != __TASK_TRACED)
7465+ return;
7466+
7467+ WARN_ON(!task->ptrace || task->parent != current);
7468+
7469+ spin_lock_irq(&task->sighand->siglock);
7470+ if (__fatal_signal_pending(task))
7471+ wake_up_state(task, __TASK_TRACED);
7472+ else
7473+ task->state = TASK_TRACED;
7474+ spin_unlock_irq(&task->sighand->siglock);
7475+}
7476+
7477 /**
7478 * ptrace_check_attach - check whether ptracee is ready for ptrace operation
7479 * @child: ptracee to check for
7480@@ -151,24 +185,29 @@ int ptrace_check_attach(struct task_struct *child, bool ignore_state)
7481 * be changed by us so it's not changing right after this.
7482 */
7483 read_lock(&tasklist_lock);
7484- if ((child->ptrace & PT_PTRACED) && child->parent == current) {
7485+ if (child->ptrace && child->parent == current) {
7486+ WARN_ON(child->state == __TASK_TRACED);
7487 /*
7488 * child->sighand can't be NULL, release_task()
7489 * does ptrace_unlink() before __exit_signal().
7490 */
7491- spin_lock_irq(&child->sighand->siglock);
7492- WARN_ON_ONCE(task_is_stopped(child));
7493- if (ignore_state || (task_is_traced(child) &&
7494- !(child->jobctl & JOBCTL_LISTENING)))
7495+ if (ignore_state || ptrace_freeze_traced(child))
7496 ret = 0;
7497- spin_unlock_irq(&child->sighand->siglock);
7498 }
7499 read_unlock(&tasklist_lock);
7500
7501- if (!ret && !ignore_state)
7502- ret = wait_task_inactive(child, TASK_TRACED) ? 0 : -ESRCH;
7503+ if (!ret && !ignore_state) {
7504+ if (!wait_task_inactive(child, __TASK_TRACED)) {
7505+ /*
7506+ * This can only happen if may_ptrace_stop() fails and
7507+ * ptrace_stop() changes ->state back to TASK_RUNNING,
7508+ * so we should not worry about leaking __TASK_TRACED.
7509+ */
7510+ WARN_ON(child->state == __TASK_TRACED);
7511+ ret = -ESRCH;
7512+ }
7513+ }
7514
7515- /* All systems go.. */
7516 return ret;
7517 }
7518
7519@@ -310,7 +349,7 @@ static int ptrace_attach(struct task_struct *task, long request,
7520 */
7521 if (task_is_stopped(task) &&
7522 task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING))
7523- signal_wake_up(task, 1);
7524+ signal_wake_up_state(task, __TASK_STOPPED);
7525
7526 spin_unlock(&task->sighand->siglock);
7527
7528@@ -727,7 +766,7 @@ int ptrace_request(struct task_struct *child, long request,
7529 * tracee into STOP.
7530 */
7531 if (likely(task_set_jobctl_pending(child, JOBCTL_TRAP_STOP)))
7532- signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
7533+ ptrace_signal_wake_up(child, child->jobctl & JOBCTL_LISTENING);
7534
7535 unlock_task_sighand(child, &flags);
7536 ret = 0;
7537@@ -753,7 +792,7 @@ int ptrace_request(struct task_struct *child, long request,
7538 * start of this trap and now. Trigger re-trap.
7539 */
7540 if (child->jobctl & JOBCTL_TRAP_NOTIFY)
7541- signal_wake_up(child, true);
7542+ ptrace_signal_wake_up(child, true);
7543 ret = 0;
7544 }
7545 unlock_task_sighand(child, &flags);
7546@@ -890,6 +929,8 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
7547 goto out_put_task_struct;
7548
7549 ret = arch_ptrace(child, request, addr, data);
7550+ if (ret || request != PTRACE_DETACH)
7551+ ptrace_unfreeze_traced(child);
7552
7553 out_put_task_struct:
7554 put_task_struct(child);
7555@@ -1029,8 +1070,11 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
7556
7557 ret = ptrace_check_attach(child, request == PTRACE_KILL ||
7558 request == PTRACE_INTERRUPT);
7559- if (!ret)
7560+ if (!ret) {
7561 ret = compat_arch_ptrace(child, request, addr, data);
7562+ if (ret || request != PTRACE_DETACH)
7563+ ptrace_unfreeze_traced(child);
7564+ }
7565
7566 out_put_task_struct:
7567 put_task_struct(child);
7568diff --git a/kernel/sched/core.c b/kernel/sched/core.c
7569index 1a48cdb..5eb6c96 100644
7570--- a/kernel/sched/core.c
7571+++ b/kernel/sched/core.c
7572@@ -1686,7 +1686,8 @@ out:
7573 */
7574 int wake_up_process(struct task_struct *p)
7575 {
7576- return try_to_wake_up(p, TASK_ALL, 0);
7577+ WARN_ON(task_is_stopped_or_traced(p));
7578+ return try_to_wake_up(p, TASK_NORMAL, 0);
7579 }
7580 EXPORT_SYMBOL(wake_up_process);
7581
7582diff --git a/kernel/signal.c b/kernel/signal.c
7583index be4f856..67b64be 100644
7584--- a/kernel/signal.c
7585+++ b/kernel/signal.c
7586@@ -678,23 +678,17 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
7587 * No need to set need_resched since signal event passing
7588 * goes through ->blocked
7589 */
7590-void signal_wake_up(struct task_struct *t, int resume)
7591+void signal_wake_up_state(struct task_struct *t, unsigned int state)
7592 {
7593- unsigned int mask;
7594-
7595 set_tsk_thread_flag(t, TIF_SIGPENDING);
7596-
7597 /*
7598- * For SIGKILL, we want to wake it up in the stopped/traced/killable
7599+ * TASK_WAKEKILL also means wake it up in the stopped/traced/killable
7600 * case. We don't check t->state here because there is a race with it
7601 * executing another processor and just now entering stopped state.
7602 * By using wake_up_state, we ensure the process will wake up and
7603 * handle its death signal.
7604 */
7605- mask = TASK_INTERRUPTIBLE;
7606- if (resume)
7607- mask |= TASK_WAKEKILL;
7608- if (!wake_up_state(t, mask))
7609+ if (!wake_up_state(t, state | TASK_INTERRUPTIBLE))
7610 kick_process(t);
7611 }
7612
7613@@ -842,7 +836,7 @@ static void ptrace_trap_notify(struct task_struct *t)
7614 assert_spin_locked(&t->sighand->siglock);
7615
7616 task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
7617- signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
7618+ ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
7619 }
7620
7621 /*
7622@@ -1797,6 +1791,10 @@ static inline int may_ptrace_stop(void)
7623 * If SIGKILL was already sent before the caller unlocked
7624 * ->siglock we must see ->core_state != NULL. Otherwise it
7625 * is safe to enter schedule().
7626+ *
7627+ * This is almost outdated, a task with the pending SIGKILL can't
7628+ * block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported
7629+ * after SIGKILL was already dequeued.
7630 */
7631 if (unlikely(current->mm->core_state) &&
7632 unlikely(current->mm == current->parent->mm))
7633@@ -1922,6 +1920,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
7634 if (gstop_done)
7635 do_notify_parent_cldstop(current, false, why);
7636
7637+ /* tasklist protects us from ptrace_freeze_traced() */
7638 __set_current_state(TASK_RUNNING);
7639 if (clear_code)
7640 current->exit_code = 0;
7641diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
7642index 781ecc2..7f8a8df 100644
7643--- a/kernel/trace/ftrace.c
7644+++ b/kernel/trace/ftrace.c
7645@@ -3863,7 +3863,7 @@ static int ftrace_module_notify(struct notifier_block *self,
7646
7647 struct notifier_block ftrace_module_nb = {
7648 .notifier_call = ftrace_module_notify,
7649- .priority = 0,
7650+ .priority = INT_MAX, /* Run before anything that can use kprobes */
7651 };
7652
7653 extern unsigned long __start_mcount_loc[];
6782diff --git a/lib/atomic64.c b/lib/atomic64.c 7654diff --git a/lib/atomic64.c b/lib/atomic64.c
6783index 9785378..08a4f06 100644 7655index 9785378..08a4f06 100644
6784--- a/lib/atomic64.c 7656--- a/lib/atomic64.c
@@ -8088,6 +8960,22 @@ index 5d7f61d..2480c01 100644
8088 8960
8089 xprt = req->rq_xprt; 8961 xprt = req->rq_xprt;
8090 if (task->tk_ops->rpc_count_stats != NULL) 8962 if (task->tk_ops->rpc_count_stats != NULL)
8963diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
8964index 49a464f..62fa2c5 100644
8965--- a/security/integrity/evm/evm_crypto.c
8966+++ b/security/integrity/evm/evm_crypto.c
8967@@ -205,9 +205,9 @@ int evm_update_evmxattr(struct dentry *dentry, const char *xattr_name,
8968 rc = __vfs_setxattr_noperm(dentry, XATTR_NAME_EVM,
8969 &xattr_data,
8970 sizeof(xattr_data), 0);
8971- }
8972- else if (rc == -ENODATA)
8973+ } else if (rc == -ENODATA && inode->i_op->removexattr) {
8974 rc = inode->i_op->removexattr(dentry, XATTR_NAME_EVM);
8975+ }
8976 return rc;
8977 }
8978
8091diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c 8979diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c
8092index 48d7c0a..bd3ba88 100644 8980index 48d7c0a..bd3ba88 100644
8093--- a/sound/arm/pxa2xx-ac97-lib.c 8981--- a/sound/arm/pxa2xx-ac97-lib.c