summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2016-05-21 06:11:29 -0400
committerAnthony G. Basile <blueness@gentoo.org>2016-05-21 06:11:29 -0400
commit8e9faeac7e399ed463fb15f86476f22ece5049ce (patch)
tree68dce6a82356fb89f5dc698dcc2d98b3b563c381
parentscripts: intelligently obtain KMAJOR (diff)
downloadhardened-patchset-8e9faeac7e399ed463fb15f86476f22ece5049ce.tar.gz
hardened-patchset-8e9faeac7e399ed463fb15f86476f22ece5049ce.tar.bz2
hardened-patchset-8e9faeac7e399ed463fb15f86476f22ece5049ce.zip
grsecurity-3.1-4.5.5-20160520210220160520
-rw-r--r--4.5.4/1003_linux-4.5.4.patch2354
-rw-r--r--4.5.5/0000_README (renamed from 4.5.4/0000_README)6
-rw-r--r--4.5.5/4420_grsecurity-3.1-4.5.5-201605202102.patch (renamed from 4.5.4/4420_grsecurity-3.1-4.5.4-201605131918.patch)641
-rw-r--r--4.5.5/4425_grsec_remove_EI_PAX.patch (renamed from 4.5.4/4425_grsec_remove_EI_PAX.patch)0
-rw-r--r--4.5.5/4427_force_XATTR_PAX_tmpfs.patch (renamed from 4.5.4/4427_force_XATTR_PAX_tmpfs.patch)0
-rw-r--r--4.5.5/4430_grsec-remove-localversion-grsec.patch (renamed from 4.5.4/4430_grsec-remove-localversion-grsec.patch)0
-rw-r--r--4.5.5/4435_grsec-mute-warnings.patch (renamed from 4.5.4/4435_grsec-mute-warnings.patch)0
-rw-r--r--4.5.5/4440_grsec-remove-protected-paths.patch (renamed from 4.5.4/4440_grsec-remove-protected-paths.patch)0
-rw-r--r--4.5.5/4450_grsec-kconfig-default-gids.patch (renamed from 4.5.4/4450_grsec-kconfig-default-gids.patch)0
-rw-r--r--4.5.5/4465_selinux-avc_audit-log-curr_ip.patch (renamed from 4.5.4/4465_selinux-avc_audit-log-curr_ip.patch)0
-rw-r--r--4.5.5/4470_disable-compat_vdso.patch (renamed from 4.5.4/4470_disable-compat_vdso.patch)0
-rw-r--r--4.5.5/4475_emutramp_default_on.patch (renamed from 4.5.4/4475_emutramp_default_on.patch)0
12 files changed, 450 insertions, 2551 deletions
diff --git a/4.5.4/1003_linux-4.5.4.patch b/4.5.4/1003_linux-4.5.4.patch
deleted file mode 100644
index 9d0c6b9..0000000
--- a/4.5.4/1003_linux-4.5.4.patch
+++ /dev/null
@@ -1,2354 +0,0 @@
-diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
-index c2340ee..c000832 100644
---- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
-+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
-@@ -30,6 +30,10 @@ Optional properties:
- - target-supply : regulator for SATA target power
- - phys : reference to the SATA PHY node
- - phy-names : must be "sata-phy"
-+- ports-implemented : Mask that indicates which ports that the HBA supports
-+ are available for software to use. Useful if PORTS_IMPL
-+ is not programmed by the BIOS, which is true with
-+ some embedded SOC's.
-
- Required properties when using sub-nodes:
- - #address-cells : number of cells to encode an address
-diff --git a/MAINTAINERS b/MAINTAINERS
-index 5a389bc..77e4c10 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -4163,8 +4163,8 @@ F: Documentation/efi-stub.txt
- F: arch/ia64/kernel/efi.c
- F: arch/x86/boot/compressed/eboot.[ch]
- F: arch/x86/include/asm/efi.h
--F: arch/x86/platform/efi/*
--F: drivers/firmware/efi/*
-+F: arch/x86/platform/efi/
-+F: drivers/firmware/efi/
- F: include/linux/efi*.h
-
- EFI VARIABLE FILESYSTEM
-diff --git a/Makefile b/Makefile
-index 9b56a6c..d64eade 100644
---- a/Makefile
-+++ b/Makefile
-@@ -1,6 +1,6 @@
- VERSION = 4
- PATCHLEVEL = 5
--SUBLEVEL = 3
-+SUBLEVEL = 4
- EXTRAVERSION =
- NAME = Blurry Fish Butt
-
-diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
-index 27b17ad..cb69299 100644
---- a/arch/arc/include/asm/io.h
-+++ b/arch/arc/include/asm/io.h
-@@ -13,6 +13,15 @@
- #include <asm/byteorder.h>
- #include <asm/page.h>
-
-+#ifdef CONFIG_ISA_ARCV2
-+#include <asm/barrier.h>
-+#define __iormb() rmb()
-+#define __iowmb() wmb()
-+#else
-+#define __iormb() do { } while (0)
-+#define __iowmb() do { } while (0)
-+#endif
-+
- extern void __iomem *ioremap(unsigned long physaddr, unsigned long size);
- extern void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
- unsigned long flags);
-@@ -22,6 +31,15 @@ extern void iounmap(const void __iomem *addr);
- #define ioremap_wc(phy, sz) ioremap(phy, sz)
- #define ioremap_wt(phy, sz) ioremap(phy, sz)
-
-+/*
-+ * io{read,write}{16,32}be() macros
-+ */
-+#define ioread16be(p) ({ u16 __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; })
-+#define ioread32be(p) ({ u32 __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; })
-+
-+#define iowrite16be(v,p) ({ __iowmb(); __raw_writew((__force u16)cpu_to_be16(v), p); })
-+#define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force u32)cpu_to_be32(v), p); })
-+
- /* Change struct page to physical address */
- #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
-
-@@ -99,15 +117,6 @@ static inline void __raw_writel(u32 w, volatile void __iomem *addr)
-
- }
-
--#ifdef CONFIG_ISA_ARCV2
--#include <asm/barrier.h>
--#define __iormb() rmb()
--#define __iowmb() wmb()
--#else
--#define __iormb() do { } while (0)
--#define __iowmb() do { } while (0)
--#endif
--
- /*
- * MMIO can also get buffered/optimized in micro-arch, so barriers needed
- * Based on ARM model for the typical use case
-diff --git a/arch/arm/boot/dts/qcom-apq8064.dtsi b/arch/arm/boot/dts/qcom-apq8064.dtsi
-index ed521e8..e8bc7e8 100644
---- a/arch/arm/boot/dts/qcom-apq8064.dtsi
-+++ b/arch/arm/boot/dts/qcom-apq8064.dtsi
-@@ -665,7 +665,7 @@
- };
-
- sata0: sata@29000000 {
-- compatible = "generic-ahci";
-+ compatible = "qcom,apq8064-ahci", "generic-ahci";
- status = "disabled";
- reg = <0x29000000 0x180>;
- interrupts = <GIC_SPI 209 IRQ_TYPE_NONE>;
-@@ -687,6 +687,7 @@
-
- phys = <&sata_phy0>;
- phy-names = "sata-phy";
-+ ports-implemented = <0x1>;
- };
-
- /* Temporary fixed regulator */
-diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
-index 47905a5..318394e 100644
---- a/arch/arm/mach-cns3xxx/pcie.c
-+++ b/arch/arm/mach-cns3xxx/pcie.c
-@@ -220,13 +220,13 @@ static void cns3xxx_write_config(struct cns3xxx_pcie *cnspci,
- u32 mask = (0x1ull << (size * 8)) - 1;
- int shift = (where % 4) * 8;
-
-- v = readl_relaxed(base + (where & 0xffc));
-+ v = readl_relaxed(base);
-
- v &= ~(mask << shift);
- v |= (val & mask) << shift;
-
-- writel_relaxed(v, base + (where & 0xffc));
-- readl_relaxed(base + (where & 0xffc));
-+ writel_relaxed(v, base);
-+ readl_relaxed(base);
- }
-
- static void __init cns3xxx_pcie_hw_init(struct cns3xxx_pcie *cnspci)
-diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
-index 7c21760..875a2ba 100644
---- a/arch/arm/mach-exynos/pm_domains.c
-+++ b/arch/arm/mach-exynos/pm_domains.c
-@@ -92,7 +92,7 @@ static int exynos_pd_power(struct generic_pm_domain *domain, bool power_on)
- if (IS_ERR(pd->clk[i]))
- break;
-
-- if (IS_ERR(pd->clk[i]))
-+ if (IS_ERR(pd->pclk[i]))
- continue; /* Skip on first power up */
- if (clk_set_parent(pd->clk[i], pd->pclk[i]))
- pr_err("%s: error setting parent to clock%d\n",
-diff --git a/arch/arm/mach-socfpga/headsmp.S b/arch/arm/mach-socfpga/headsmp.S
-index 5d94b7a..c160fa3 100644
---- a/arch/arm/mach-socfpga/headsmp.S
-+++ b/arch/arm/mach-socfpga/headsmp.S
-@@ -13,6 +13,7 @@
- #include <asm/assembler.h>
-
- .arch armv7-a
-+ .arm
-
- ENTRY(secondary_trampoline)
- /* CPU1 will always fetch from 0x0 when it is brought out of reset.
-diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
-index c976ebf..57b4836 100644
---- a/arch/parisc/kernel/syscall.S
-+++ b/arch/parisc/kernel/syscall.S
-@@ -344,7 +344,7 @@ tracesys_next:
- #endif
-
- cmpib,COND(=),n -1,%r20,tracesys_exit /* seccomp may have returned -1 */
-- comiclr,>>= __NR_Linux_syscalls, %r20, %r0
-+ comiclr,>> __NR_Linux_syscalls, %r20, %r0
- b,n .Ltracesys_nosys
-
- LDREGX %r20(%r19), %r19
-diff --git a/arch/powerpc/include/asm/word-at-a-time.h b/arch/powerpc/include/asm/word-at-a-time.h
-index e4396a7..4afe66a 100644
---- a/arch/powerpc/include/asm/word-at-a-time.h
-+++ b/arch/powerpc/include/asm/word-at-a-time.h
-@@ -82,7 +82,7 @@ static inline unsigned long create_zero_mask(unsigned long bits)
- "andc %1,%1,%2\n\t"
- "popcntd %0,%1"
- : "=r" (leading_zero_bits), "=&r" (trailing_zero_bit_mask)
-- : "r" (bits));
-+ : "b" (bits));
-
- return leading_zero_bits;
- }
-diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
-index 2c5aaf8..0553858 100644
---- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
-+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
-@@ -385,6 +385,9 @@ static void intel_thermal_interrupt(void)
- {
- __u64 msr_val;
-
-+ if (static_cpu_has(X86_FEATURE_HWP))
-+ wrmsrl_safe(MSR_HWP_STATUS, 0);
-+
- rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
-
- /* Check for violation of core thermal thresholds*/
-diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c
-index b285d4e..5da924b 100644
---- a/arch/x86/kernel/sysfb_efi.c
-+++ b/arch/x86/kernel/sysfb_efi.c
-@@ -106,14 +106,24 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
- continue;
- for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
- resource_size_t start, end;
-+ unsigned long flags;
-+
-+ flags = pci_resource_flags(dev, i);
-+ if (!(flags & IORESOURCE_MEM))
-+ continue;
-+
-+ if (flags & IORESOURCE_UNSET)
-+ continue;
-+
-+ if (pci_resource_len(dev, i) == 0)
-+ continue;
-
- start = pci_resource_start(dev, i);
-- if (start == 0)
-- break;
- end = pci_resource_end(dev, i);
- if (screen_info.lfb_base >= start &&
- screen_info.lfb_base < end) {
- found_bar = 1;
-+ break;
- }
- }
- }
-diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
-index 92ae6ac..6aa0f4d 100644
---- a/arch/x86/kernel/tsc_msr.c
-+++ b/arch/x86/kernel/tsc_msr.c
-@@ -92,7 +92,7 @@ unsigned long try_msr_calibrate_tsc(void)
-
- if (freq_desc_tables[cpu_index].msr_plat) {
- rdmsr(MSR_PLATFORM_INFO, lo, hi);
-- ratio = (lo >> 8) & 0x1f;
-+ ratio = (lo >> 8) & 0xff;
- } else {
- rdmsr(MSR_IA32_PERF_STATUS, lo, hi);
- ratio = (hi >> 8) & 0x1f;
-diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
-index 6979186..9f77943 100644
---- a/drivers/acpi/acpi_processor.c
-+++ b/drivers/acpi/acpi_processor.c
-@@ -491,6 +491,58 @@ static void acpi_processor_remove(struct acpi_device *device)
- }
- #endif /* CONFIG_ACPI_HOTPLUG_CPU */
-
-+#ifdef CONFIG_X86
-+static bool acpi_hwp_native_thermal_lvt_set;
-+static acpi_status __init acpi_hwp_native_thermal_lvt_osc(acpi_handle handle,
-+ u32 lvl,
-+ void *context,
-+ void **rv)
-+{
-+ u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953";
-+ u32 capbuf[2];
-+ struct acpi_osc_context osc_context = {
-+ .uuid_str = sb_uuid_str,
-+ .rev = 1,
-+ .cap.length = 8,
-+ .cap.pointer = capbuf,
-+ };
-+
-+ if (acpi_hwp_native_thermal_lvt_set)
-+ return AE_CTRL_TERMINATE;
-+
-+ capbuf[0] = 0x0000;
-+ capbuf[1] = 0x1000; /* set bit 12 */
-+
-+ if (ACPI_SUCCESS(acpi_run_osc(handle, &osc_context))) {
-+ if (osc_context.ret.pointer && osc_context.ret.length > 1) {
-+ u32 *capbuf_ret = osc_context.ret.pointer;
-+
-+ if (capbuf_ret[1] & 0x1000) {
-+ acpi_handle_info(handle,
-+ "_OSC native thermal LVT Acked\n");
-+ acpi_hwp_native_thermal_lvt_set = true;
-+ }
-+ }
-+ kfree(osc_context.ret.pointer);
-+ }
-+
-+ return AE_OK;
-+}
-+
-+void __init acpi_early_processor_osc(void)
-+{
-+ if (boot_cpu_has(X86_FEATURE_HWP)) {
-+ acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
-+ ACPI_UINT32_MAX,
-+ acpi_hwp_native_thermal_lvt_osc,
-+ NULL, NULL, NULL);
-+ acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID,
-+ acpi_hwp_native_thermal_lvt_osc,
-+ NULL, NULL);
-+ }
-+}
-+#endif
-+
- /*
- * The following ACPI IDs are known to be suitable for representing as
- * processor devices.
-diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
-index 6a72047..c3a052d 100644
---- a/drivers/acpi/acpica/dsmethod.c
-+++ b/drivers/acpi/acpica/dsmethod.c
-@@ -428,6 +428,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
- obj_desc->method.mutex->mutex.
- original_sync_level =
- obj_desc->method.mutex->mutex.sync_level;
-+
-+ obj_desc->method.mutex->mutex.thread_id =
-+ acpi_os_get_thread_id();
- }
- }
-
-diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
-index 891c42d..f9081b7 100644
---- a/drivers/acpi/bus.c
-+++ b/drivers/acpi/bus.c
-@@ -1005,6 +1005,9 @@ static int __init acpi_bus_init(void)
- goto error1;
- }
-
-+ /* Set capability bits for _OSC under processor scope */
-+ acpi_early_processor_osc();
-+
- /*
- * _OSC method may exist in module level code,
- * so it must be run after ACPI_FULL_INITIALIZATION
-diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
-index 1e6833a..6f41c73 100644
---- a/drivers/acpi/internal.h
-+++ b/drivers/acpi/internal.h
-@@ -138,6 +138,12 @@ void acpi_early_processor_set_pdc(void);
- static inline void acpi_early_processor_set_pdc(void) {}
- #endif
-
-+#ifdef CONFIG_X86
-+void acpi_early_processor_osc(void);
-+#else
-+static inline void acpi_early_processor_osc(void) {}
-+#endif
-+
- /* --------------------------------------------------------------------------
- Embedded Controller
- -------------------------------------------------------------------------- */
-diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
-index 04975b8..639adb1 100644
---- a/drivers/ata/ahci_platform.c
-+++ b/drivers/ata/ahci_platform.c
-@@ -51,6 +51,9 @@ static int ahci_probe(struct platform_device *pdev)
- if (rc)
- return rc;
-
-+ of_property_read_u32(dev->of_node,
-+ "ports-implemented", &hpriv->force_port_map);
-+
- if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
- hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
-
-diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
-index 8e3f7fa..73b19b2 100644
---- a/drivers/ata/ahci_xgene.c
-+++ b/drivers/ata/ahci_xgene.c
-@@ -821,9 +821,9 @@ static int xgene_ahci_probe(struct platform_device *pdev)
- dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n",
- __func__);
- version = XGENE_AHCI_V1;
-- }
-- if (info->valid & ACPI_VALID_CID)
-+ } else if (info->valid & ACPI_VALID_CID) {
- version = XGENE_AHCI_V2;
-+ }
- }
- }
- #endif
-diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
-index 85ea514..bb050ea 100644
---- a/drivers/ata/libahci.c
-+++ b/drivers/ata/libahci.c
-@@ -469,6 +469,7 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
- dev_info(dev, "forcing port_map 0x%x -> 0x%x\n",
- port_map, hpriv->force_port_map);
- port_map = hpriv->force_port_map;
-+ hpriv->saved_port_map = port_map;
- }
-
- if (hpriv->mask_port_map) {
-diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
-index e4c5cc1..c65d41f 100644
---- a/drivers/block/nbd.c
-+++ b/drivers/block/nbd.c
-@@ -618,8 +618,8 @@ static void nbd_request_handler(struct request_queue *q)
- req, req->cmd_type);
-
- if (unlikely(!nbd->sock)) {
-- dev_err(disk_to_dev(nbd->disk),
-- "Attempted send on closed socket\n");
-+ dev_err_ratelimited(disk_to_dev(nbd->disk),
-+ "Attempted send on closed socket\n");
- req->errors++;
- nbd_end_request(nbd, req);
- spin_lock_irq(q->queue_lock);
-diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c
-index 64a7b59..cab9759 100644
---- a/drivers/block/null_blk.c
-+++ b/drivers/block/null_blk.c
-@@ -742,10 +742,11 @@ static int null_add_dev(void)
-
- add_disk(disk);
-
-+done:
- mutex_lock(&lock);
- list_add_tail(&nullb->list, &nullb_list);
- mutex_unlock(&lock);
--done:
-+
- return 0;
-
- out_cleanup_lightnvm:
-diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c
-index e4f89e2..3a177ad 100644
---- a/drivers/clk/bcm/clk-bcm2835-aux.c
-+++ b/drivers/clk/bcm/clk-bcm2835-aux.c
-@@ -38,8 +38,8 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev)
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- reg = devm_ioremap_resource(dev, res);
-- if (!reg)
-- return -ENODEV;
-+ if (IS_ERR(reg))
-+ return PTR_ERR(reg);
-
- onecell = devm_kmalloc(dev, sizeof(*onecell), GFP_KERNEL);
- if (!onecell)
-diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
-index ded3ff4..aa1dacd 100644
---- a/drivers/clk/clk-divider.c
-+++ b/drivers/clk/clk-divider.c
-@@ -423,6 +423,12 @@ const struct clk_ops clk_divider_ops = {
- };
- EXPORT_SYMBOL_GPL(clk_divider_ops);
-
-+const struct clk_ops clk_divider_ro_ops = {
-+ .recalc_rate = clk_divider_recalc_rate,
-+ .round_rate = clk_divider_round_rate,
-+};
-+EXPORT_SYMBOL_GPL(clk_divider_ro_ops);
-+
- static struct clk *_register_divider(struct device *dev, const char *name,
- const char *parent_name, unsigned long flags,
- void __iomem *reg, u8 shift, u8 width,
-@@ -446,7 +452,10 @@ static struct clk *_register_divider(struct device *dev, const char *name,
- return ERR_PTR(-ENOMEM);
-
- init.name = name;
-- init.ops = &clk_divider_ops;
-+ if (clk_divider_flags & CLK_DIVIDER_READ_ONLY)
-+ init.ops = &clk_divider_ro_ops;
-+ else
-+ init.ops = &clk_divider_ops;
- init.flags = flags | CLK_IS_BASIC;
- init.parent_names = (parent_name ? &parent_name: NULL);
- init.num_parents = (parent_name ? 1 : 0);
-diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c
-index 10224b0..b134a8b 100644
---- a/drivers/clk/clk-xgene.c
-+++ b/drivers/clk/clk-xgene.c
-@@ -351,8 +351,8 @@ static int xgene_clk_set_rate(struct clk_hw *hw, unsigned long rate,
- /* Set new divider */
- data = xgene_clk_read(pclk->param.divider_reg +
- pclk->param.reg_divider_offset);
-- data &= ~((1 << pclk->param.reg_divider_width) - 1)
-- << pclk->param.reg_divider_shift;
-+ data &= ~(((1 << pclk->param.reg_divider_width) - 1)
-+ << pclk->param.reg_divider_shift);
- data |= divider;
- xgene_clk_write(data, pclk->param.divider_reg +
- pclk->param.reg_divider_offset);
-diff --git a/drivers/clk/meson/clkc.c b/drivers/clk/meson/clkc.c
-index c83ae13..d920d41 100644
---- a/drivers/clk/meson/clkc.c
-+++ b/drivers/clk/meson/clkc.c
-@@ -198,7 +198,7 @@ meson_clk_register_fixed_rate(const struct clk_conf *clk_conf,
- }
-
- void __init meson_clk_register_clks(const struct clk_conf *clk_confs,
-- size_t nr_confs,
-+ unsigned int nr_confs,
- void __iomem *clk_base)
- {
- unsigned int i;
-diff --git a/drivers/clk/nxp/clk-lpc18xx-ccu.c b/drivers/clk/nxp/clk-lpc18xx-ccu.c
-index 13aabbb..558da89 100644
---- a/drivers/clk/nxp/clk-lpc18xx-ccu.c
-+++ b/drivers/clk/nxp/clk-lpc18xx-ccu.c
-@@ -222,7 +222,7 @@ static void lpc18xx_ccu_register_branch_gate_div(struct lpc18xx_clk_branch *bran
- div->width = 1;
-
- div_hw = &div->hw;
-- div_ops = &clk_divider_ops;
-+ div_ops = &clk_divider_ro_ops;
- }
-
- branch->gate.reg = branch->offset + reg_base;
-diff --git a/drivers/clk/qcom/gcc-msm8960.c b/drivers/clk/qcom/gcc-msm8960.c
-index 983dd7d..0a0c1f5 100644
---- a/drivers/clk/qcom/gcc-msm8960.c
-+++ b/drivers/clk/qcom/gcc-msm8960.c
-@@ -2753,7 +2753,7 @@ static struct clk_rcg ce3_src = {
- },
- .freq_tbl = clk_tbl_ce3,
- .clkr = {
-- .enable_reg = 0x2c08,
-+ .enable_reg = 0x36c0,
- .enable_mask = BIT(7),
- .hw.init = &(struct clk_init_data){
- .name = "ce3_src",
-@@ -2769,7 +2769,7 @@ static struct clk_branch ce3_core_clk = {
- .halt_reg = 0x2fdc,
- .halt_bit = 5,
- .clkr = {
-- .enable_reg = 0x36c4,
-+ .enable_reg = 0x36cc,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "ce3_core_clk",
-diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c
-index 981a502..97f49aa 100644
---- a/drivers/clk/rockchip/clk-rk3228.c
-+++ b/drivers/clk/rockchip/clk-rk3228.c
-@@ -605,13 +605,13 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
-
- /* PD_MMC */
- MMC(SCLK_SDMMC_DRV, "sdmmc_drv", "sclk_sdmmc", RK3228_SDMMC_CON0, 1),
-- MMC(SCLK_SDMMC_SAMPLE, "sdmmc_sample", "sclk_sdmmc", RK3228_SDMMC_CON1, 1),
-+ MMC(SCLK_SDMMC_SAMPLE, "sdmmc_sample", "sclk_sdmmc", RK3228_SDMMC_CON1, 0),
-
- MMC(SCLK_SDIO_DRV, "sdio_drv", "sclk_sdio", RK3228_SDIO_CON0, 1),
-- MMC(SCLK_SDIO_SAMPLE, "sdio_sample", "sclk_sdio", RK3228_SDIO_CON1, 1),
-+ MMC(SCLK_SDIO_SAMPLE, "sdio_sample", "sclk_sdio", RK3228_SDIO_CON1, 0),
-
- MMC(SCLK_EMMC_DRV, "emmc_drv", "sclk_emmc", RK3228_EMMC_CON0, 1),
-- MMC(SCLK_EMMC_SAMPLE, "emmc_sample", "sclk_emmc", RK3228_EMMC_CON1, 1),
-+ MMC(SCLK_EMMC_SAMPLE, "emmc_sample", "sclk_emmc", RK3228_EMMC_CON1, 0),
- };
-
- static const char *const rk3228_critical_clocks[] __initconst = {
-diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c
-index d9a0b5d..226af57 100644
---- a/drivers/clk/rockchip/clk.c
-+++ b/drivers/clk/rockchip/clk.c
-@@ -70,7 +70,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
- if (gate_offset >= 0) {
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
- if (!gate)
-- return ERR_PTR(-ENOMEM);
-+ goto err_gate;
-
- gate->flags = gate_flags;
- gate->reg = base + gate_offset;
-@@ -82,7 +82,7 @@ static struct clk *rockchip_clk_register_branch(const char *name,
- if (div_width > 0) {
- div = kzalloc(sizeof(*div), GFP_KERNEL);
- if (!div)
-- return ERR_PTR(-ENOMEM);
-+ goto err_div;
-
- div->flags = div_flags;
- div->reg = base + muxdiv_offset;
-@@ -90,7 +90,9 @@ static struct clk *rockchip_clk_register_branch(const char *name,
- div->width = div_width;
- div->lock = lock;
- div->table = div_table;
-- div_ops = &clk_divider_ops;
-+ div_ops = (div_flags & CLK_DIVIDER_READ_ONLY)
-+ ? &clk_divider_ro_ops
-+ : &clk_divider_ops;
- }
-
- clk = clk_register_composite(NULL, name, parent_names, num_parents,
-@@ -100,6 +102,11 @@ static struct clk *rockchip_clk_register_branch(const char *name,
- flags);
-
- return clk;
-+err_div:
-+ kfree(gate);
-+err_gate:
-+ kfree(mux);
-+ return ERR_PTR(-ENOMEM);
- }
-
- struct rockchip_clk_frac {
-diff --git a/drivers/clk/sunxi/clk-sun8i-apb0.c b/drivers/clk/sunxi/clk-sun8i-apb0.c
-index 7ba6110..2ea61de 100644
---- a/drivers/clk/sunxi/clk-sun8i-apb0.c
-+++ b/drivers/clk/sunxi/clk-sun8i-apb0.c
-@@ -36,7 +36,7 @@ static struct clk *sun8i_a23_apb0_register(struct device_node *node,
-
- /* The A23 APB0 clock is a standard 2 bit wide divider clock */
- clk = clk_register_divider(NULL, clk_name, clk_parent, 0, reg,
-- 0, 2, CLK_DIVIDER_POWER_OF_TWO, NULL);
-+ 0, 2, 0, NULL);
- if (IS_ERR(clk))
- return clk;
-
-diff --git a/drivers/clk/versatile/clk-sp810.c b/drivers/clk/versatile/clk-sp810.c
-index e78755e..1fe1e8d 100644
---- a/drivers/clk/versatile/clk-sp810.c
-+++ b/drivers/clk/versatile/clk-sp810.c
-@@ -92,6 +92,7 @@ static void __init clk_sp810_of_setup(struct device_node *node)
- int num = ARRAY_SIZE(parent_names);
- char name[12];
- struct clk_init_data init;
-+ static int instance;
- int i;
- bool deprecated;
-
-@@ -117,7 +118,7 @@ static void __init clk_sp810_of_setup(struct device_node *node)
- deprecated = !of_find_property(node, "assigned-clock-parents", NULL);
-
- for (i = 0; i < ARRAY_SIZE(sp810->timerclken); i++) {
-- snprintf(name, ARRAY_SIZE(name), "timerclken%d", i);
-+ snprintf(name, sizeof(name), "sp810_%d_%d", instance, i);
-
- sp810->timerclken[i].sp810 = sp810;
- sp810->timerclken[i].channel = i;
-@@ -138,5 +139,6 @@ static void __init clk_sp810_of_setup(struct device_node *node)
- }
-
- of_clk_add_provider(node, clk_sp810_timerclken_of_get, sp810);
-+ instance++;
- }
- CLK_OF_DECLARE(sp810, "arm,sp810", clk_sp810_of_setup);
-diff --git a/drivers/clocksource/tango_xtal.c b/drivers/clocksource/tango_xtal.c
-index 2bcecaf..c407c47 100644
---- a/drivers/clocksource/tango_xtal.c
-+++ b/drivers/clocksource/tango_xtal.c
-@@ -42,7 +42,7 @@ static void __init tango_clocksource_init(struct device_node *np)
-
- ret = clocksource_mmio_init(xtal_in_cnt, "tango-xtal", xtal_freq, 350,
- 32, clocksource_mmio_readl_up);
-- if (!ret) {
-+ if (ret) {
- pr_err("%s: registration failed\n", np->full_name);
- return;
- }
-diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c
-index a9c659f..0404203 100644
---- a/drivers/cpufreq/sti-cpufreq.c
-+++ b/drivers/cpufreq/sti-cpufreq.c
-@@ -259,6 +259,10 @@ static int sti_cpufreq_init(void)
- {
- int ret;
-
-+ if ((!of_machine_is_compatible("st,stih407")) &&
-+ (!of_machine_is_compatible("st,stih410")))
-+ return -ENODEV;
-+
- ddata.cpu = get_cpu_device(0);
- if (!ddata.cpu) {
- dev_err(ddata.cpu, "Failed to get device for CPU0\n");
-diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
-index 545069d..e342565e 100644
---- a/drivers/cpuidle/cpuidle-arm.c
-+++ b/drivers/cpuidle/cpuidle-arm.c
-@@ -50,7 +50,7 @@ static int arm_enter_idle_state(struct cpuidle_device *dev,
- * call the CPU ops suspend protocol with idle index as a
- * parameter.
- */
-- arm_cpuidle_suspend(idx);
-+ ret = arm_cpuidle_suspend(idx);
-
- cpu_pm_exit();
- }
-diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
-index 540cbc8..cc4d9bd 100644
---- a/drivers/gpio/gpiolib-acpi.c
-+++ b/drivers/gpio/gpiolib-acpi.c
-@@ -977,7 +977,7 @@ bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
- lookup = kmalloc(sizeof(*lookup), GFP_KERNEL);
- if (lookup) {
- lookup->adev = adev;
-- lookup->con_id = con_id;
-+ lookup->con_id = kstrdup(con_id, GFP_KERNEL);
- list_add_tail(&lookup->node, &acpi_crs_lookup_list);
- }
- }
-diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-index b8fbbd7..73628c7 100644
---- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
-@@ -540,6 +540,7 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
- if (!metadata_size) {
- if (bo->metadata_size) {
- kfree(bo->metadata);
-+ bo->metadata = NULL;
- bo->metadata_size = 0;
- }
- return 0;
-diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
-index 1e0bba2..1cd6de5 100644
---- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
-+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
-@@ -298,6 +298,10 @@ bool amdgpu_atombios_encoder_mode_fixup(struct drm_encoder *encoder,
- && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2)))
- adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2;
-
-+ /* vertical FP must be at least 1 */
-+ if (mode->crtc_vsync_start == mode->crtc_vdisplay)
-+ adjusted_mode->crtc_vsync_start++;
-+
- /* get the native mode for scaling */
- if (amdgpu_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT))
- amdgpu_panel_mode_fixup(encoder, adjusted_mode);
-diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
-index f357058..2e832fa 100644
---- a/drivers/gpu/drm/i915/i915_drv.c
-+++ b/drivers/gpu/drm/i915/i915_drv.c
-@@ -797,7 +797,7 @@ static int i915_drm_resume(struct drm_device *dev)
- static int i915_drm_resume_early(struct drm_device *dev)
- {
- struct drm_i915_private *dev_priv = dev->dev_private;
-- int ret = 0;
-+ int ret;
-
- /*
- * We have a resume ordering issue with the snd-hda driver also
-@@ -808,6 +808,36 @@ static int i915_drm_resume_early(struct drm_device *dev)
- * FIXME: This should be solved with a special hdmi sink device or
- * similar so that power domains can be employed.
- */
-+
-+ /*
-+ * Note that we need to set the power state explicitly, since we
-+ * powered off the device during freeze and the PCI core won't power
-+ * it back up for us during thaw. Powering off the device during
-+ * freeze is not a hard requirement though, and during the
-+ * suspend/resume phases the PCI core makes sure we get here with the
-+ * device powered on. So in case we change our freeze logic and keep
-+ * the device powered we can also remove the following set power state
-+ * call.
-+ */
-+ ret = pci_set_power_state(dev->pdev, PCI_D0);
-+ if (ret) {
-+ DRM_ERROR("failed to set PCI D0 power state (%d)\n", ret);
-+ goto out;
-+ }
-+
-+ /*
-+ * Note that pci_enable_device() first enables any parent bridge
-+ * device and only then sets the power state for this device. The
-+ * bridge enabling is a nop though, since bridge devices are resumed
-+ * first. The order of enabling power and enabling the device is
-+ * imposed by the PCI core as described above, so here we preserve the
-+ * same order for the freeze/thaw phases.
-+ *
-+ * TODO: eventually we should remove pci_disable_device() /
-+ * pci_enable_enable_device() from suspend/resume. Due to how they
-+ * depend on the device enable refcount we can't anyway depend on them
-+ * disabling/enabling the device.
-+ */
- if (pci_enable_device(dev->pdev)) {
- ret = -EIO;
- goto out;
-diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
-index 4897728..9b6737c 100644
---- a/drivers/gpu/drm/i915/i915_reg.h
-+++ b/drivers/gpu/drm/i915/i915_reg.h
-@@ -2898,7 +2898,14 @@ enum skl_disp_power_wells {
- #define GEN6_RP_STATE_CAP _MMIO(MCHBAR_MIRROR_BASE_SNB + 0x5998)
- #define BXT_RP_STATE_CAP _MMIO(0x138170)
-
--#define INTERVAL_1_28_US(us) (((us) * 100) >> 7)
-+/*
-+ * Make these a multiple of magic 25 to avoid SNB (eg. Dell XPS
-+ * 8300) freezing up around GPU hangs. Looks as if even
-+ * scheduling/timer interrupts start misbehaving if the RPS
-+ * EI/thresholds are "bad", leading to a very sluggish or even
-+ * frozen machine.
-+ */
-+#define INTERVAL_1_28_US(us) roundup(((us) * 100) >> 7, 25)
- #define INTERVAL_1_33_US(us) (((us) * 3) >> 2)
- #define INTERVAL_0_833_US(us) (((us) * 6) / 5)
- #define GT_INTERVAL_FROM_US(dev_priv, us) (IS_GEN9(dev_priv) ? \
-diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
-index 084d558..33b8e0a 100644
---- a/drivers/gpu/drm/i915/intel_ddi.c
-+++ b/drivers/gpu/drm/i915/intel_ddi.c
-@@ -464,9 +464,17 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
- } else if (IS_BROADWELL(dev)) {
- ddi_translations_fdi = bdw_ddi_translations_fdi;
- ddi_translations_dp = bdw_ddi_translations_dp;
-- ddi_translations_edp = bdw_ddi_translations_edp;
-+
-+ if (dev_priv->edp_low_vswing) {
-+ ddi_translations_edp = bdw_ddi_translations_edp;
-+ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
-+ } else {
-+ ddi_translations_edp = bdw_ddi_translations_dp;
-+ n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
-+ }
-+
- ddi_translations_hdmi = bdw_ddi_translations_hdmi;
-- n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
-+
- n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
- n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
- hdmi_default_entry = 7;
-@@ -3260,12 +3268,6 @@ void intel_ddi_get_config(struct intel_encoder *encoder,
- intel_ddi_clock_get(encoder, pipe_config);
- }
-
--static void intel_ddi_destroy(struct drm_encoder *encoder)
--{
-- /* HDMI has nothing special to destroy, so we can go with this. */
-- intel_dp_encoder_destroy(encoder);
--}
--
- static bool intel_ddi_compute_config(struct intel_encoder *encoder,
- struct intel_crtc_state *pipe_config)
- {
-@@ -3284,7 +3286,8 @@ static bool intel_ddi_compute_config(struct intel_encoder *encoder,
- }
-
- static const struct drm_encoder_funcs intel_ddi_funcs = {
-- .destroy = intel_ddi_destroy,
-+ .reset = intel_dp_encoder_reset,
-+ .destroy = intel_dp_encoder_destroy,
- };
-
- static struct intel_connector *
-@@ -3356,6 +3359,7 @@ void intel_ddi_init(struct drm_device *dev, enum port port)
- intel_encoder->post_disable = intel_ddi_post_disable;
- intel_encoder->get_hw_state = intel_ddi_get_hw_state;
- intel_encoder->get_config = intel_ddi_get_config;
-+ intel_encoder->suspend = intel_dp_encoder_suspend;
-
- intel_dig_port->port = port;
- intel_dig_port->saved_port_bits = I915_READ(DDI_BUF_CTL(port)) &
-diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index a9c3513..c023a04 100644
---- a/drivers/gpu/drm/i915/intel_display.c
-+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -13429,6 +13429,9 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
- }
-
- for_each_crtc_in_state(state, crtc, crtc_state, i) {
-+ if (state->legacy_cursor_update)
-+ continue;
-+
- ret = intel_crtc_wait_for_pending_flips(crtc);
- if (ret)
- return ret;
-diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
-index cdc2c15..3cd4996 100644
---- a/drivers/gpu/drm/i915/intel_dp.c
-+++ b/drivers/gpu/drm/i915/intel_dp.c
-@@ -4905,7 +4905,7 @@ void intel_dp_encoder_destroy(struct drm_encoder *encoder)
- kfree(intel_dig_port);
- }
-
--static void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
-+void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder)
- {
- struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
-
-@@ -4947,7 +4947,7 @@ static void intel_edp_panel_vdd_sanitize(struct intel_dp *intel_dp)
- edp_panel_vdd_schedule_off(intel_dp);
- }
-
--static void intel_dp_encoder_reset(struct drm_encoder *encoder)
-+void intel_dp_encoder_reset(struct drm_encoder *encoder)
- {
- struct intel_dp *intel_dp;
-
-diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
-index df7f3cb..3ce3bee 100644
---- a/drivers/gpu/drm/i915/intel_drv.h
-+++ b/drivers/gpu/drm/i915/intel_drv.h
-@@ -1234,6 +1234,8 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
- void intel_dp_start_link_train(struct intel_dp *intel_dp);
- void intel_dp_stop_link_train(struct intel_dp *intel_dp);
- void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
-+void intel_dp_encoder_reset(struct drm_encoder *encoder);
-+void intel_dp_encoder_suspend(struct intel_encoder *intel_encoder);
- void intel_dp_encoder_destroy(struct drm_encoder *encoder);
- int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
- bool intel_dp_compute_config(struct intel_encoder *encoder,
-diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
-index 616108c..43fdae8 100644
---- a/drivers/gpu/drm/i915/intel_hdmi.c
-+++ b/drivers/gpu/drm/i915/intel_hdmi.c
-@@ -1407,8 +1407,16 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
- hdmi_to_dig_port(intel_hdmi));
- }
-
-- if (!live_status)
-- DRM_DEBUG_KMS("Live status not up!");
-+ if (!live_status) {
-+ DRM_DEBUG_KMS("HDMI live status down\n");
-+ /*
-+ * Live status register is not reliable on all intel platforms.
-+ * So consider live_status only for certain platforms, for
-+ * others, read EDID to determine presence of sink.
-+ */
-+ if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv))
-+ live_status = true;
-+ }
-
- intel_hdmi_unset_edid(connector);
-
-diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c
-index 6104d7d..9de6503 100644
---- a/drivers/gpu/drm/radeon/atombios_encoders.c
-+++ b/drivers/gpu/drm/radeon/atombios_encoders.c
-@@ -310,6 +310,10 @@ static bool radeon_atom_mode_fixup(struct drm_encoder *encoder,
- && (mode->crtc_vsync_start < (mode->crtc_vdisplay + 2)))
- adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vdisplay + 2;
-
-+ /* vertical FP must be at least 1 */
-+ if (mode->crtc_vsync_start == mode->crtc_vdisplay)
-+ adjusted_mode->crtc_vsync_start++;
-+
- /* get the native mode for scaling */
- if (radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) {
- radeon_panel_mode_fixup(encoder, adjusted_mode);
-diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
-index e00db3f..abb98c7 100644
---- a/drivers/gpu/ipu-v3/ipu-common.c
-+++ b/drivers/gpu/ipu-v3/ipu-common.c
-@@ -1068,7 +1068,6 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
- goto err_register;
- }
-
-- pdev->dev.of_node = of_node;
- pdev->dev.parent = dev;
-
- ret = platform_device_add_data(pdev, &reg->pdata,
-@@ -1079,6 +1078,12 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
- platform_device_put(pdev);
- goto err_register;
- }
-+
-+ /*
-+ * Set of_node only after calling platform_device_add. Otherwise
-+ * the platform:imx-ipuv3-crtc modalias won't be used.
-+ */
-+ pdev->dev.of_node = of_node;
- }
-
- return 0;
-diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
-index b6ff6e7..14c14c8 100644
---- a/drivers/hid/hid-ids.h
-+++ b/drivers/hid/hid-ids.h
-@@ -255,6 +255,7 @@
- #define USB_DEVICE_ID_CORSAIR_K90 0x1b02
-
- #define USB_VENDOR_ID_CREATIVELABS 0x041e
-+#define USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51 0x322c
- #define USB_DEVICE_ID_PRODIKEYS_PCMIDI 0x2801
-
- #define USB_VENDOR_ID_CVTOUCH 0x1ff7
-diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
-index 7dd0953..dc8e6ad 100644
---- a/drivers/hid/usbhid/hid-quirks.c
-+++ b/drivers/hid/usbhid/hid-quirks.c
-@@ -70,6 +70,7 @@ static const struct hid_blacklist {
- { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_3AXIS_5BUTTON_STICK, HID_QUIRK_NOGET },
- { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
- { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL },
-+ { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51, HID_QUIRK_NOGET },
- { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
- { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT },
- { USB_VENDOR_ID_ELAN, HID_ANY_ID, HID_QUIRK_ALWAYS_POLL },
-diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
-index 94a8875..f71187aa 100644
---- a/drivers/hid/wacom_wac.c
-+++ b/drivers/hid/wacom_wac.c
-@@ -3378,6 +3378,10 @@ static const struct wacom_features wacom_features_0x33E =
- { "Wacom Intuos PT M 2", 21600, 13500, 2047, 63,
- INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
- .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
-+static const struct wacom_features wacom_features_0x343 =
-+ { "Wacom DTK1651", 34616, 19559, 1023, 0,
-+ DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
-+ WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
-
- static const struct wacom_features wacom_features_HID_ANY_ID =
- { "Wacom HID", .type = HID_GENERIC };
-@@ -3543,6 +3547,7 @@ const struct hid_device_id wacom_ids[] = {
- { USB_DEVICE_WACOM(0x33C) },
- { USB_DEVICE_WACOM(0x33D) },
- { USB_DEVICE_WACOM(0x33E) },
-+ { USB_DEVICE_WACOM(0x343) },
- { USB_DEVICE_WACOM(0x4001) },
- { USB_DEVICE_WACOM(0x4004) },
- { USB_DEVICE_WACOM(0x5000) },
-diff --git a/drivers/hv/ring_buffer.c b/drivers/hv/ring_buffer.c
-index b53702c..e35560b 100644
---- a/drivers/hv/ring_buffer.c
-+++ b/drivers/hv/ring_buffer.c
-@@ -103,15 +103,29 @@ static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi)
- * there is room for the producer to send the pending packet.
- */
-
--static bool hv_need_to_signal_on_read(u32 prev_write_sz,
-- struct hv_ring_buffer_info *rbi)
-+static bool hv_need_to_signal_on_read(struct hv_ring_buffer_info *rbi)
- {
- u32 cur_write_sz;
- u32 r_size;
-- u32 write_loc = rbi->ring_buffer->write_index;
-+ u32 write_loc;
- u32 read_loc = rbi->ring_buffer->read_index;
-- u32 pending_sz = rbi->ring_buffer->pending_send_sz;
-+ u32 pending_sz;
-
-+ /*
-+ * Issue a full memory barrier before making the signaling decision.
-+ * Here is the reason for having this barrier:
-+ * If the reading of the pend_sz (in this function)
-+ * were to be reordered and read before we commit the new read
-+ * index (in the calling function) we could
-+ * have a problem. If the host were to set the pending_sz after we
-+ * have sampled pending_sz and go to sleep before we commit the
-+ * read index, we could miss sending the interrupt. Issue a full
-+ * memory barrier to address this.
-+ */
-+ mb();
-+
-+ pending_sz = rbi->ring_buffer->pending_send_sz;
-+ write_loc = rbi->ring_buffer->write_index;
- /* If the other end is not blocked on write don't bother. */
- if (pending_sz == 0)
- return false;
-@@ -120,7 +134,7 @@ static bool hv_need_to_signal_on_read(u32 prev_write_sz,
- cur_write_sz = write_loc >= read_loc ? r_size - (write_loc - read_loc) :
- read_loc - write_loc;
-
-- if ((prev_write_sz < pending_sz) && (cur_write_sz >= pending_sz))
-+ if (cur_write_sz >= pending_sz)
- return true;
-
- return false;
-@@ -458,7 +472,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info,
- /* Update the read index */
- hv_set_next_read_location(inring_info, next_read_location);
-
-- *signal = hv_need_to_signal_on_read(bytes_avail_towrite, inring_info);
-+ *signal = hv_need_to_signal_on_read(inring_info);
-
- out_unlock:
- spin_unlock_irqrestore(&inring_info->ring_lock, flags);
-diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
-index b13936d..f2a7f72 100644
---- a/drivers/iio/magnetometer/ak8975.c
-+++ b/drivers/iio/magnetometer/ak8975.c
-@@ -462,6 +462,8 @@ static int ak8975_setup_irq(struct ak8975_data *data)
- int rc;
- int irq;
-
-+ init_waitqueue_head(&data->data_ready_queue);
-+ clear_bit(0, &data->flags);
- if (client->irq)
- irq = client->irq;
- else
-@@ -477,8 +479,6 @@ static int ak8975_setup_irq(struct ak8975_data *data)
- return rc;
- }
-
-- init_waitqueue_head(&data->data_ready_queue);
-- clear_bit(0, &data->flags);
- data->eoc_irq = irq;
-
- return rc;
-@@ -732,7 +732,7 @@ static int ak8975_probe(struct i2c_client *client,
- int eoc_gpio;
- int err;
- const char *name = NULL;
-- enum asahi_compass_chipset chipset;
-+ enum asahi_compass_chipset chipset = AK_MAX_TYPE;
-
- /* Grab and set up the supplied GPIO. */
- if (client->dev.platform_data)
-diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
-index cf21df4..4e94cff 100644
---- a/drivers/infiniband/hw/cxgb4/cq.c
-+++ b/drivers/infiniband/hw/cxgb4/cq.c
-@@ -162,7 +162,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
- cq->bar2_va = c4iw_bar2_addrs(rdev, cq->cqid, T4_BAR2_QTYPE_INGRESS,
- &cq->bar2_qid,
- user ? &cq->bar2_pa : NULL);
-- if (user && !cq->bar2_va) {
-+ if (user && !cq->bar2_pa) {
- pr_warn(MOD "%s: cqid %u not in BAR2 range.\n",
- pci_name(rdev->lldi.pdev), cq->cqid);
- ret = -EINVAL;
-diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
-index e99345e..8ff690b 100644
---- a/drivers/infiniband/hw/cxgb4/qp.c
-+++ b/drivers/infiniband/hw/cxgb4/qp.c
-@@ -185,6 +185,10 @@ void __iomem *c4iw_bar2_addrs(struct c4iw_rdev *rdev, unsigned int qid,
-
- if (pbar2_pa)
- *pbar2_pa = (rdev->bar2_pa + bar2_qoffset) & PAGE_MASK;
-+
-+ if (is_t4(rdev->lldi.adapter_type))
-+ return NULL;
-+
- return rdev->bar2_kva + bar2_qoffset;
- }
-
-@@ -270,7 +274,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
- /*
- * User mode must have bar2 access.
- */
-- if (user && (!wq->sq.bar2_va || !wq->rq.bar2_va)) {
-+ if (user && (!wq->sq.bar2_pa || !wq->rq.bar2_pa)) {
- pr_warn(MOD "%s: sqid %u or rqid %u not in BAR2 range.\n",
- pci_name(rdev->lldi.pdev), wq->sq.qid, wq->rq.qid);
- goto free_dma;
-diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
-index 9bbadaa..7b3845a 100644
---- a/drivers/input/touchscreen/zforce_ts.c
-+++ b/drivers/input/touchscreen/zforce_ts.c
-@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
- point.coord_x = point.coord_y = 0;
- }
-
-- point.state = payload[9 * i + 5] & 0x03;
-- point.id = (payload[9 * i + 5] & 0xfc) >> 2;
-+ point.state = payload[9 * i + 5] & 0x0f;
-+ point.id = (payload[9 * i + 5] & 0xf0) >> 4;
-
- /* determine touch major, minor and orientation */
- point.area_major = max(payload[9 * i + 6],
-diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
-index 307db1e..b7ddfb3 100644
---- a/drivers/lightnvm/rrpc.c
-+++ b/drivers/lightnvm/rrpc.c
-@@ -499,12 +499,21 @@ static void rrpc_gc_queue(struct work_struct *work)
- struct rrpc *rrpc = gcb->rrpc;
- struct rrpc_block *rblk = gcb->rblk;
- struct nvm_lun *lun = rblk->parent->lun;
-+ struct nvm_block *blk = rblk->parent;
- struct rrpc_lun *rlun = &rrpc->luns[lun->id - rrpc->lun_offset];
-
- spin_lock(&rlun->lock);
- list_add_tail(&rblk->prio, &rlun->prio_list);
- spin_unlock(&rlun->lock);
-
-+ spin_lock(&lun->lock);
-+ lun->nr_open_blocks--;
-+ lun->nr_closed_blocks++;
-+ blk->state &= ~NVM_BLK_ST_OPEN;
-+ blk->state |= NVM_BLK_ST_CLOSED;
-+ list_move_tail(&rblk->list, &rlun->closed_list);
-+ spin_unlock(&lun->lock);
-+
- mempool_free(gcb, rrpc->gcb_pool);
- pr_debug("nvm: block '%lu' is full, allow GC (sched)\n",
- rblk->parent->id);
-@@ -668,20 +677,8 @@ static void rrpc_end_io_write(struct rrpc *rrpc, struct rrpc_rq *rrqd,
- lun = rblk->parent->lun;
-
- cmnt_size = atomic_inc_return(&rblk->data_cmnt_size);
-- if (unlikely(cmnt_size == rrpc->dev->pgs_per_blk)) {
-- struct nvm_block *blk = rblk->parent;
-- struct rrpc_lun *rlun = rblk->rlun;
--
-- spin_lock(&lun->lock);
-- lun->nr_open_blocks--;
-- lun->nr_closed_blocks++;
-- blk->state &= ~NVM_BLK_ST_OPEN;
-- blk->state |= NVM_BLK_ST_CLOSED;
-- list_move_tail(&rblk->list, &rlun->closed_list);
-- spin_unlock(&lun->lock);
--
-+ if (unlikely(cmnt_size == rrpc->dev->pgs_per_blk))
- rrpc_run_gc(rrpc, rblk);
-- }
- }
- }
-
-diff --git a/drivers/md/md.c b/drivers/md/md.c
-index e55e6cf..7551278 100644
---- a/drivers/md/md.c
-+++ b/drivers/md/md.c
-@@ -284,6 +284,8 @@ static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
- * go away inside make_request
- */
- sectors = bio_sectors(bio);
-+ /* bio could be mergeable after passing to underlayer */
-+ bio->bi_rw &= ~REQ_NOMERGE;
- mddev->pers->make_request(mddev, bio);
-
- cpu = part_stat_lock();
-diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
-index 1743788..1bbbe87 100644
---- a/drivers/mfd/intel-lpss.c
-+++ b/drivers/mfd/intel-lpss.c
-@@ -453,6 +453,7 @@ int intel_lpss_probe(struct device *dev,
- err_remove_ltr:
- intel_lpss_debugfs_remove(lpss);
- intel_lpss_ltr_hide(lpss);
-+ intel_lpss_unregister_clock(lpss);
-
- err_clk_register:
- ida_simple_remove(&intel_lpss_devid_ida, lpss->devid);
-diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
-index 1545a94..b86fe50 100644
---- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
-+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
-@@ -423,6 +423,10 @@ static int handle_hca_cap_atomic(struct mlx5_core_dev *dev)
- HCA_CAP_OPMOD_GET_CUR);
- if (err)
- return err;
-+ err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC,
-+ HCA_CAP_OPMOD_GET_MAX);
-+ if (err)
-+ return err;
- } else {
- return 0;
- }
-diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
-index 91afa3a..a192d45 100644
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2143,11 +2143,7 @@ EXPORT_SYMBOL(ath10k_htt_t2h_msg_handler);
- void ath10k_htt_rx_pktlog_completion_handler(struct ath10k *ar,
- struct sk_buff *skb)
- {
-- struct ath10k_pktlog_10_4_hdr *hdr =
-- (struct ath10k_pktlog_10_4_hdr *)skb->data;
--
-- trace_ath10k_htt_pktlog(ar, hdr->payload,
-- sizeof(*hdr) + __le16_to_cpu(hdr->size));
-+ trace_ath10k_htt_pktlog(ar, skb->data, skb->len);
- dev_kfree_skb_any(skb);
- }
- EXPORT_SYMBOL(ath10k_htt_rx_pktlog_completion_handler);
-diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-index 8f87930..1b271b9 100644
---- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
-@@ -274,6 +274,9 @@ void ar5008_hw_cmn_spur_mitigate(struct ath_hw *ah,
- };
- static const int inc[4] = { 0, 100, 0, 0 };
-
-+ memset(&mask_m, 0, sizeof(int8_t) * 123);
-+ memset(&mask_p, 0, sizeof(int8_t) * 123);
-+
- cur_bin = -6000;
- upper = bin + 100;
- lower = bin - 100;
-@@ -424,14 +427,9 @@ static void ar5008_hw_spur_mitigate(struct ath_hw *ah,
- int tmp, new;
- int i;
-
-- int8_t mask_m[123];
-- int8_t mask_p[123];
- int cur_bb_spur;
- bool is2GHz = IS_CHAN_2GHZ(chan);
-
-- memset(&mask_m, 0, sizeof(int8_t) * 123);
-- memset(&mask_p, 0, sizeof(int8_t) * 123);
--
- for (i = 0; i < AR_EEPROM_MODAL_SPURS; i++) {
- cur_bb_spur = ah->eep_ops->get_spur_channel(ah, i, is2GHz);
- if (AR_NO_SPUR == cur_bb_spur)
-diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
-index db66245..53d7445 100644
---- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c
-+++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c
-@@ -178,14 +178,9 @@ static void ar9002_hw_spur_mitigate(struct ath_hw *ah,
- int i;
- struct chan_centers centers;
-
-- int8_t mask_m[123];
-- int8_t mask_p[123];
- int cur_bb_spur;
- bool is2GHz = IS_CHAN_2GHZ(chan);
-
-- memset(&mask_m, 0, sizeof(int8_t) * 123);
-- memset(&mask_p, 0, sizeof(int8_t) * 123);
--
- ath9k_hw_get_channel_centers(ah, chan, &centers);
- freq = centers.synth_center;
-
-diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
-index 6a4fc5d..d7db6f2 100644
---- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
-+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
-@@ -314,6 +314,7 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss,
- mwifiex_dbg(adapter, ERROR,
- "Attempt to reconnect on csa closed chan(%d)\n",
- bss_desc->channel);
-+ ret = -1;
- goto done;
- }
-
-diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
-index 28f7010..1aca777 100644
---- a/drivers/net/wireless/realtek/rtlwifi/rc.c
-+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
-@@ -41,7 +41,7 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv,
- struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
- struct rtl_phy *rtlphy = &(rtlpriv->phy);
- struct rtl_sta_info *sta_entry = NULL;
-- u8 wireless_mode = 0;
-+ u16 wireless_mode = 0;
-
- /*
- *this rate is no use for true rate, firmware
-@@ -99,7 +99,7 @@ static void _rtl_rc_rate_set_series(struct rtl_priv *rtlpriv,
- {
- struct rtl_mac *mac = rtl_mac(rtlpriv);
- struct rtl_sta_info *sta_entry = NULL;
-- u8 wireless_mode = 0;
-+ u16 wireless_mode = 0;
- u8 sgi_20 = 0, sgi_40 = 0, sgi_80 = 0;
-
- if (sta) {
-diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
-index bbb789f..5e5719b 100644
---- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
-+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
-@@ -3855,7 +3855,7 @@ void rtl8821ae_update_channel_access_setting(struct ieee80211_hw *hw)
- {
- struct rtl_priv *rtlpriv = rtl_priv(hw);
- struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
-- u8 wireless_mode = mac->mode;
-+ u16 wireless_mode = mac->mode;
- u8 sifs_timer, r2t_sifs;
-
- rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME,
-diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
-index 4544752..84397b1 100644
---- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
-+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
-@@ -1323,14 +1323,13 @@ struct rtl_tid_data {
-
- struct rtl_sta_info {
- struct list_head list;
-- u8 ratr_index;
-- u8 wireless_mode;
-- u8 mimo_ps;
-- u8 mac_addr[ETH_ALEN];
- struct rtl_tid_data tids[MAX_TID_COUNT];
--
- /* just used for ap adhoc or mesh*/
- struct rssi_sta rssi_stat;
-+ u16 wireless_mode;
-+ u8 ratr_index;
-+ u8 mimo_ps;
-+ u8 mac_addr[ETH_ALEN];
- } __packed;
-
- struct rtl_priv;
-diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c
-index c964054..4b59f67 100644
---- a/drivers/net/wireless/ti/wlcore/event.c
-+++ b/drivers/net/wireless/ti/wlcore/event.c
-@@ -38,7 +38,7 @@
-
- int wlcore_event_fw_logger(struct wl1271 *wl)
- {
-- u32 ret;
-+ int ret;
- struct fw_logger_information fw_log;
- u8 *buffer;
- u32 internal_fw_addrbase = WL18XX_DATA_RAM_BASE_ADDRESS;
-diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
-index 544b802a..02c574f 100644
---- a/drivers/nvdimm/pmem.c
-+++ b/drivers/nvdimm/pmem.c
-@@ -314,9 +314,16 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn)
- * implementation will limit the pfns advertised through
- * ->direct_access() to those that are included in the memmap.
- */
-- if (nd_pfn->mode == PFN_MODE_PMEM)
-- offset = ALIGN(SZ_8K + 64 * npfns, nd_pfn->align);
-- else if (nd_pfn->mode == PFN_MODE_RAM)
-+ if (nd_pfn->mode == PFN_MODE_PMEM) {
-+ unsigned long memmap_size;
-+
-+ /*
-+ * vmemmap_populate_hugepages() allocates the memmap array in
-+ * HPAGE_SIZE chunks.
-+ */
-+ memmap_size = ALIGN(64 * npfns, PMD_SIZE);
-+ offset = ALIGN(SZ_8K + memmap_size, nd_pfn->align);
-+ } else if (nd_pfn->mode == PFN_MODE_RAM)
- offset = ALIGN(SZ_8K, nd_pfn->align);
- else
- goto err;
-diff --git a/drivers/nvmem/mxs-ocotp.c b/drivers/nvmem/mxs-ocotp.c
-index 8ba19bb..2bb3c57 100644
---- a/drivers/nvmem/mxs-ocotp.c
-+++ b/drivers/nvmem/mxs-ocotp.c
-@@ -94,7 +94,7 @@ static int mxs_ocotp_read(void *context, const void *reg, size_t reg_size,
- if (ret)
- goto close_banks;
-
-- while (val_size) {
-+ while (val_size >= reg_size) {
- if ((offset < OCOTP_DATA_OFFSET) || (offset % 16)) {
- /* fill up non-data register */
- *buf = 0;
-@@ -103,7 +103,7 @@ static int mxs_ocotp_read(void *context, const void *reg, size_t reg_size,
- }
-
- buf++;
-- val_size--;
-+ val_size -= reg_size;
- offset += reg_size;
- }
-
-diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
-index 826634e..e0679eb 100644
---- a/drivers/pwm/pwm-omap-dmtimer.c
-+++ b/drivers/pwm/pwm-omap-dmtimer.c
-@@ -31,6 +31,7 @@
- #include <linux/time.h>
-
- #define DM_TIMER_LOAD_MIN 0xfffffffe
-+#define DM_TIMER_MAX 0xffffffff
-
- struct pwm_omap_dmtimer_chip {
- struct pwm_chip chip;
-@@ -46,13 +47,9 @@ to_pwm_omap_dmtimer_chip(struct pwm_chip *chip)
- return container_of(chip, struct pwm_omap_dmtimer_chip, chip);
- }
-
--static int pwm_omap_dmtimer_calc_value(unsigned long clk_rate, int ns)
-+static u32 pwm_omap_dmtimer_get_clock_cycles(unsigned long clk_rate, int ns)
- {
-- u64 c = (u64)clk_rate * ns;
--
-- do_div(c, NSEC_PER_SEC);
--
-- return DM_TIMER_LOAD_MIN - c;
-+ return DIV_ROUND_CLOSEST_ULL((u64)clk_rate * ns, NSEC_PER_SEC);
- }
-
- static void pwm_omap_dmtimer_start(struct pwm_omap_dmtimer_chip *omap)
-@@ -99,7 +96,8 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip,
- int duty_ns, int period_ns)
- {
- struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip);
-- int load_value, match_value;
-+ u32 period_cycles, duty_cycles;
-+ u32 load_value, match_value;
- struct clk *fclk;
- unsigned long clk_rate;
- bool timer_active;
-@@ -117,15 +115,13 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip,
- fclk = omap->pdata->get_fclk(omap->dm_timer);
- if (!fclk) {
- dev_err(chip->dev, "invalid pmtimer fclk\n");
-- mutex_unlock(&omap->mutex);
-- return -EINVAL;
-+ goto err_einval;
- }
-
- clk_rate = clk_get_rate(fclk);
- if (!clk_rate) {
- dev_err(chip->dev, "invalid pmtimer fclk rate\n");
-- mutex_unlock(&omap->mutex);
-- return -EINVAL;
-+ goto err_einval;
- }
-
- dev_dbg(chip->dev, "clk rate: %luHz\n", clk_rate);
-@@ -133,11 +129,45 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip,
- /*
- * Calculate the appropriate load and match values based on the
- * specified period and duty cycle. The load value determines the
-- * cycle time and the match value determines the duty cycle.
-+ * period time and the match value determines the duty time.
-+ *
-+ * The period lasts for (DM_TIMER_MAX-load_value+1) clock cycles.
-+ * Similarly, the active time lasts (match_value-load_value+1) cycles.
-+ * The non-active time is the remainder: (DM_TIMER_MAX-match_value)
-+ * clock cycles.
-+ *
-+ * NOTE: It is required that: load_value <= match_value < DM_TIMER_MAX
-+ *
-+ * References:
-+ * OMAP4430/60/70 TRM sections 22.2.4.10 and 22.2.4.11
-+ * AM335x Sitara TRM sections 20.1.3.5 and 20.1.3.6
- */
-- load_value = pwm_omap_dmtimer_calc_value(clk_rate, period_ns);
-- match_value = pwm_omap_dmtimer_calc_value(clk_rate,
-- period_ns - duty_ns);
-+ period_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, period_ns);
-+ duty_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, duty_ns);
-+
-+ if (period_cycles < 2) {
-+ dev_info(chip->dev,
-+ "period %d ns too short for clock rate %lu Hz\n",
-+ period_ns, clk_rate);
-+ goto err_einval;
-+ }
-+
-+ if (duty_cycles < 1) {
-+ dev_dbg(chip->dev,
-+ "duty cycle %d ns is too short for clock rate %lu Hz\n",
-+ duty_ns, clk_rate);
-+ dev_dbg(chip->dev, "using minimum of 1 clock cycle\n");
-+ duty_cycles = 1;
-+ } else if (duty_cycles >= period_cycles) {
-+ dev_dbg(chip->dev,
-+ "duty cycle %d ns is too long for period %d ns at clock rate %lu Hz\n",
-+ duty_ns, period_ns, clk_rate);
-+ dev_dbg(chip->dev, "using maximum of 1 clock cycle less than period\n");
-+ duty_cycles = period_cycles - 1;
-+ }
-+
-+ load_value = (DM_TIMER_MAX - period_cycles) + 1;
-+ match_value = load_value + duty_cycles - 1;
-
- /*
- * We MUST stop the associated dual-mode timer before attempting to
-@@ -166,6 +196,11 @@ static int pwm_omap_dmtimer_config(struct pwm_chip *chip,
- mutex_unlock(&omap->mutex);
-
- return 0;
-+
-+err_einval:
-+ mutex_unlock(&omap->mutex);
-+
-+ return -EINVAL;
- }
-
- static int pwm_omap_dmtimer_set_polarity(struct pwm_chip *chip,
-diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
-index a544366..f57d02c 100644
---- a/drivers/scsi/lpfc/lpfc_init.c
-+++ b/drivers/scsi/lpfc/lpfc_init.c
-@@ -2860,7 +2860,7 @@ lpfc_online(struct lpfc_hba *phba)
- }
-
- vports = lpfc_create_vport_work_array(phba);
-- if (vports != NULL)
-+ if (vports != NULL) {
- for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
- struct Scsi_Host *shost;
- shost = lpfc_shost_from_vport(vports[i]);
-@@ -2877,7 +2877,8 @@ lpfc_online(struct lpfc_hba *phba)
- }
- spin_unlock_irq(shost->host_lock);
- }
-- lpfc_destroy_vport_work_array(phba, vports);
-+ }
-+ lpfc_destroy_vport_work_array(phba, vports);
-
- lpfc_unblock_mgmt_io(phba);
- return 0;
-diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
-index 534c589..4a65c5b 100644
---- a/drivers/soc/rockchip/pm_domains.c
-+++ b/drivers/soc/rockchip/pm_domains.c
-@@ -419,6 +419,7 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
- if (error) {
- dev_err(dev, "failed to handle node %s: %d\n",
- node->name, error);
-+ of_node_put(node);
- goto err_out;
- }
- }
-diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c
-index 14718a9..460c855 100644
---- a/drivers/usb/core/port.c
-+++ b/drivers/usb/core/port.c
-@@ -249,18 +249,12 @@ static int usb_port_runtime_suspend(struct device *dev)
-
- return retval;
- }
--
--static int usb_port_prepare(struct device *dev)
--{
-- return 1;
--}
- #endif
-
- static const struct dev_pm_ops usb_port_pm_ops = {
- #ifdef CONFIG_PM
- .runtime_suspend = usb_port_runtime_suspend,
- .runtime_resume = usb_port_runtime_resume,
-- .prepare = usb_port_prepare,
- #endif
- };
-
-diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
-index ebb29ca..77e4c9b 100644
---- a/drivers/usb/core/usb.c
-+++ b/drivers/usb/core/usb.c
-@@ -311,13 +311,7 @@ static int usb_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
-
- static int usb_dev_prepare(struct device *dev)
- {
-- struct usb_device *udev = to_usb_device(dev);
--
-- /* Return 0 if the current wakeup setting is wrong, otherwise 1 */
-- if (udev->do_remote_wakeup != device_may_wakeup(dev))
-- return 0;
--
-- return 1;
-+ return 0; /* Implement eventually? */
- }
-
- static void usb_dev_complete(struct device *dev)
-diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
-index 9bc0e09..a543cdc 100644
---- a/drivers/usb/serial/cp210x.c
-+++ b/drivers/usb/serial/cp210x.c
-@@ -109,6 +109,7 @@ static const struct usb_device_id id_table[] = {
- { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */
- { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */
- { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */
-+ { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */
- { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
- { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
- { USB_DEVICE(0x10C4, 0x8382) }, /* Cygnal Integrated Products, Inc. */
-@@ -118,6 +119,7 @@ static const struct usb_device_id id_table[] = {
- { USB_DEVICE(0x10C4, 0x8418) }, /* IRZ Automation Teleport SG-10 GSM/GPRS Modem */
- { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */
- { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
-+ { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */
- { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
- { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
- { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
-@@ -141,6 +143,8 @@ static const struct usb_device_id id_table[] = {
- { USB_DEVICE(0x10C4, 0xF004) }, /* Elan Digital Systems USBcount50 */
- { USB_DEVICE(0x10C5, 0xEA61) }, /* Silicon Labs MobiData GPRS USB Modem */
- { USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */
-+ { USB_DEVICE(0x12B8, 0xEC60) }, /* Link G4 ECU */
-+ { USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */
- { USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
- { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */
- { USB_DEVICE(0x166A, 0x0201) }, /* Clipsal 5500PACA C-Bus Pascal Automation Controller */
-diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
-index 12eab50..364bc44 100644
---- a/drivers/xen/balloon.c
-+++ b/drivers/xen/balloon.c
-@@ -152,6 +152,8 @@ static DECLARE_WAIT_QUEUE_HEAD(balloon_wq);
- static void balloon_process(struct work_struct *work);
- static DECLARE_DELAYED_WORK(balloon_worker, balloon_process);
-
-+static void release_memory_resource(struct resource *resource);
-+
- /* When ballooning out (allocating memory to return to Xen) we don't really
- want the kernel to try too hard since that can trigger the oom killer. */
- #define GFP_BALLOON \
-@@ -268,6 +270,20 @@ static struct resource *additional_memory_resource(phys_addr_t size)
- return NULL;
- }
-
-+#ifdef CONFIG_SPARSEMEM
-+ {
-+ unsigned long limit = 1UL << (MAX_PHYSMEM_BITS - PAGE_SHIFT);
-+ unsigned long pfn = res->start >> PAGE_SHIFT;
-+
-+ if (pfn > limit) {
-+ pr_err("New System RAM resource outside addressable RAM (%lu > %lu)\n",
-+ pfn, limit);
-+ release_memory_resource(res);
-+ return NULL;
-+ }
-+ }
-+#endif
-+
- return res;
- }
-
-diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
-index 38272ad..f4edd6df 100644
---- a/drivers/xen/evtchn.c
-+++ b/drivers/xen/evtchn.c
-@@ -316,7 +316,6 @@ static int evtchn_resize_ring(struct per_user_data *u)
- {
- unsigned int new_size;
- evtchn_port_t *new_ring, *old_ring;
-- unsigned int p, c;
-
- /*
- * Ensure the ring is large enough to capture all possible
-@@ -346,20 +345,17 @@ static int evtchn_resize_ring(struct per_user_data *u)
- /*
- * Copy the old ring contents to the new ring.
- *
-- * If the ring contents crosses the end of the current ring,
-- * it needs to be copied in two chunks.
-+ * To take care of wrapping, a full ring, and the new index
-+ * pointing into the second half, simply copy the old contents
-+ * twice.
- *
- * +---------+ +------------------+
-- * |34567 12| -> | 1234567 |
-- * +-----p-c-+ +------------------+
-+ * |34567 12| -> |34567 1234567 12|
-+ * +-----p-c-+ +-------c------p---+
- */
-- p = evtchn_ring_offset(u, u->ring_prod);
-- c = evtchn_ring_offset(u, u->ring_cons);
-- if (p < c) {
-- memcpy(new_ring + c, u->ring + c, (u->ring_size - c) * sizeof(*u->ring));
-- memcpy(new_ring + u->ring_size, u->ring, p * sizeof(*u->ring));
-- } else
-- memcpy(new_ring + c, u->ring + c, (p - c) * sizeof(*u->ring));
-+ memcpy(new_ring, old_ring, u->ring_size * sizeof(*u->ring));
-+ memcpy(new_ring + u->ring_size, old_ring,
-+ u->ring_size * sizeof(*u->ring));
-
- u->ring = new_ring;
- u->ring_size = new_size;
-diff --git a/fs/pnode.c b/fs/pnode.c
-index c524fdd..9989970 100644
---- a/fs/pnode.c
-+++ b/fs/pnode.c
-@@ -198,7 +198,7 @@ static struct mount *next_group(struct mount *m, struct mount *origin)
-
- /* all accesses are serialized by namespace_sem */
- static struct user_namespace *user_ns;
--static struct mount *last_dest, *last_source, *dest_master;
-+static struct mount *last_dest, *first_source, *last_source, *dest_master;
- static struct mountpoint *mp;
- static struct hlist_head *list;
-
-@@ -221,20 +221,22 @@ static int propagate_one(struct mount *m)
- type = CL_MAKE_SHARED;
- } else {
- struct mount *n, *p;
-+ bool done;
- for (n = m; ; n = p) {
- p = n->mnt_master;
-- if (p == dest_master || IS_MNT_MARKED(p)) {
-- while (last_dest->mnt_master != p) {
-- last_source = last_source->mnt_master;
-- last_dest = last_source->mnt_parent;
-- }
-- if (!peers(n, last_dest)) {
-- last_source = last_source->mnt_master;
-- last_dest = last_source->mnt_parent;
-- }
-+ if (p == dest_master || IS_MNT_MARKED(p))
- break;
-- }
- }
-+ do {
-+ struct mount *parent = last_source->mnt_parent;
-+ if (last_source == first_source)
-+ break;
-+ done = parent->mnt_master == p;
-+ if (done && peers(n, parent))
-+ break;
-+ last_source = last_source->mnt_master;
-+ } while (!done);
-+
- type = CL_SLAVE;
- /* beginning of peer group among the slaves? */
- if (IS_MNT_SHARED(m))
-@@ -286,6 +288,7 @@ int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp,
- */
- user_ns = current->nsproxy->mnt_ns->user_ns;
- last_dest = dest_mnt;
-+ first_source = source_mnt;
- last_source = source_mnt;
- mp = dest_mp;
- list = tree_list;
-diff --git a/fs/proc/base.c b/fs/proc/base.c
-index 4f764c2..45f2162 100644
---- a/fs/proc/base.c
-+++ b/fs/proc/base.c
-@@ -955,7 +955,8 @@ static ssize_t environ_read(struct file *file, char __user *buf,
- struct mm_struct *mm = file->private_data;
- unsigned long env_start, env_end;
-
-- if (!mm)
-+ /* Ensure the process spawned far enough to have an environment. */
-+ if (!mm || !mm->env_end)
- return 0;
-
- page = (char *)__get_free_page(GFP_TEMPORARY);
-diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
-index 1143e38..408a60d 100644
---- a/include/linux/clk-provider.h
-+++ b/include/linux/clk-provider.h
-@@ -385,6 +385,7 @@ struct clk_divider {
- #define CLK_DIVIDER_MAX_AT_ZERO BIT(6)
-
- extern const struct clk_ops clk_divider_ops;
-+extern const struct clk_ops clk_divider_ro_ops;
-
- unsigned long divider_recalc_rate(struct clk_hw *hw, unsigned long parent_rate,
- unsigned int val, const struct clk_div_table *table,
-diff --git a/include/linux/hash.h b/include/linux/hash.h
-index 1afde47..79c52fa 100644
---- a/include/linux/hash.h
-+++ b/include/linux/hash.h
-@@ -32,12 +32,28 @@
- #error Wordsize not 32 or 64
- #endif
-
-+/*
-+ * The above primes are actively bad for hashing, since they are
-+ * too sparse. The 32-bit one is mostly ok, the 64-bit one causes
-+ * real problems. Besides, the "prime" part is pointless for the
-+ * multiplicative hash.
-+ *
-+ * Although a random odd number will do, it turns out that the golden
-+ * ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice
-+ * properties.
-+ *
-+ * These are the negative, (1 - phi) = (phi^2) = (3 - sqrt(5))/2.
-+ * (See Knuth vol 3, section 6.4, exercise 9.)
-+ */
-+#define GOLDEN_RATIO_32 0x61C88647
-+#define GOLDEN_RATIO_64 0x61C8864680B583EBull
-+
- static __always_inline u64 hash_64(u64 val, unsigned int bits)
- {
- u64 hash = val;
-
--#if defined(CONFIG_ARCH_HAS_FAST_MULTIPLIER) && BITS_PER_LONG == 64
-- hash = hash * GOLDEN_RATIO_PRIME_64;
-+#if BITS_PER_LONG == 64
-+ hash = hash * GOLDEN_RATIO_64;
- #else
- /* Sigh, gcc can't optimise this alone like it does for 32 bits. */
- u64 n = hash;
-diff --git a/include/linux/swap.h b/include/linux/swap.h
-index d18b65c..5fa4aa4 100644
---- a/include/linux/swap.h
-+++ b/include/linux/swap.h
-@@ -533,6 +533,10 @@ static inline swp_entry_t get_swap_page(void)
- #ifdef CONFIG_MEMCG
- static inline int mem_cgroup_swappiness(struct mem_cgroup *memcg)
- {
-+ /* Cgroup2 doesn't have per-cgroup swappiness */
-+ if (cgroup_subsys_on_dfl(memory_cgrp_subsys))
-+ return vm_swappiness;
-+
- /* root ? */
- if (mem_cgroup_disabled() || !memcg->css.parent)
- return vm_swappiness;
-diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
-index 0816c87..a6cc576 100644
---- a/include/net/ip_vs.h
-+++ b/include/net/ip_vs.h
-@@ -1588,6 +1588,23 @@ static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
- }
- #endif /* CONFIG_IP_VS_NFCT */
-
-+/* Really using conntrack? */
-+static inline bool ip_vs_conn_uses_conntrack(struct ip_vs_conn *cp,
-+ struct sk_buff *skb)
-+{
-+#ifdef CONFIG_IP_VS_NFCT
-+ enum ip_conntrack_info ctinfo;
-+ struct nf_conn *ct;
-+
-+ if (!(cp->flags & IP_VS_CONN_F_NFCT))
-+ return false;
-+ ct = nf_ct_get(skb, &ctinfo);
-+ if (ct && !nf_ct_is_untracked(ct))
-+ return true;
-+#endif
-+ return false;
-+}
-+
- static inline int
- ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
- {
-diff --git a/include/xen/page.h b/include/xen/page.h
-index 96294ac..9dc46cb 100644
---- a/include/xen/page.h
-+++ b/include/xen/page.h
-@@ -15,9 +15,9 @@
- */
-
- #define xen_pfn_to_page(xen_pfn) \
-- ((pfn_to_page(((unsigned long)(xen_pfn) << XEN_PAGE_SHIFT) >> PAGE_SHIFT)))
-+ (pfn_to_page((unsigned long)(xen_pfn) >> (PAGE_SHIFT - XEN_PAGE_SHIFT)))
- #define page_to_xen_pfn(page) \
-- (((page_to_pfn(page)) << PAGE_SHIFT) >> XEN_PAGE_SHIFT)
-+ ((page_to_pfn(page)) << (PAGE_SHIFT - XEN_PAGE_SHIFT))
-
- #define XEN_PFN_PER_PAGE (PAGE_SIZE / XEN_PAGE_SIZE)
-
-diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
-index 05ddc08..6f96586 100644
---- a/kernel/trace/trace_events.c
-+++ b/kernel/trace/trace_events.c
-@@ -2095,8 +2095,13 @@ event_create_dir(struct dentry *parent, struct trace_event_file *file)
- trace_create_file("filter", 0644, file->dir, file,
- &ftrace_event_filter_fops);
-
-- trace_create_file("trigger", 0644, file->dir, file,
-- &event_trigger_fops);
-+ /*
-+ * Only event directories that can be enabled should have
-+ * triggers.
-+ */
-+ if (!(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE))
-+ trace_create_file("trigger", 0644, file->dir, file,
-+ &event_trigger_fops);
-
- trace_create_file("format", 0444, file->dir, call,
- &ftrace_event_format_fops);
-diff --git a/mm/compaction.c b/mm/compaction.c
-index 585de54..29fb269 100644
---- a/mm/compaction.c
-+++ b/mm/compaction.c
-@@ -880,16 +880,8 @@ isolate_migratepages_range(struct compact_control *cc, unsigned long start_pfn,
- pfn = isolate_migratepages_block(cc, pfn, block_end_pfn,
- ISOLATE_UNEVICTABLE);
-
-- /*
-- * In case of fatal failure, release everything that might
-- * have been isolated in the previous iteration, and signal
-- * the failure back to caller.
-- */
-- if (!pfn) {
-- putback_movable_pages(&cc->migratepages);
-- cc->nr_migratepages = 0;
-+ if (!pfn)
- break;
-- }
-
- if (cc->nr_migratepages == COMPACT_CLUSTER_MAX)
- break;
-diff --git a/mm/page-writeback.c b/mm/page-writeback.c
-index 6fe7d15..62bbf35 100644
---- a/mm/page-writeback.c
-+++ b/mm/page-writeback.c
-@@ -1909,7 +1909,8 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
- if (gdtc->dirty > gdtc->bg_thresh)
- return true;
-
-- if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(gdtc))
-+ if (wb_stat(wb, WB_RECLAIMABLE) >
-+ wb_calc_thresh(gdtc->wb, gdtc->bg_thresh))
- return true;
-
- if (mdtc) {
-@@ -1923,7 +1924,8 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb)
- if (mdtc->dirty > mdtc->bg_thresh)
- return true;
-
-- if (wb_stat(wb, WB_RECLAIMABLE) > __wb_calc_thresh(mdtc))
-+ if (wb_stat(wb, WB_RECLAIMABLE) >
-+ wb_calc_thresh(mdtc->wb, mdtc->bg_thresh))
- return true;
- }
-
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 9d9044e..629ce64 100644
---- a/mm/page_alloc.c
-+++ b/mm/page_alloc.c
-@@ -6214,7 +6214,7 @@ int __meminit init_per_zone_wmark_min(void)
- setup_per_zone_inactive_ratio();
- return 0;
- }
--module_init(init_per_zone_wmark_min)
-+core_initcall(init_per_zone_wmark_min)
-
- /*
- * min_free_kbytes_sysctl_handler - just a wrapper around proc_dointvec() so
-diff --git a/mm/zswap.c b/mm/zswap.c
-index bf14508..3402619 100644
---- a/mm/zswap.c
-+++ b/mm/zswap.c
-@@ -170,6 +170,8 @@ static struct zswap_tree *zswap_trees[MAX_SWAPFILES];
- static LIST_HEAD(zswap_pools);
- /* protects zswap_pools list modification */
- static DEFINE_SPINLOCK(zswap_pools_lock);
-+/* pool counter to provide unique names to zpool */
-+static atomic_t zswap_pools_count = ATOMIC_INIT(0);
-
- /* used by param callback function */
- static bool zswap_init_started;
-@@ -565,6 +567,7 @@ static struct zswap_pool *zswap_pool_find_get(char *type, char *compressor)
- static struct zswap_pool *zswap_pool_create(char *type, char *compressor)
- {
- struct zswap_pool *pool;
-+ char name[38]; /* 'zswap' + 32 char (max) num + \0 */
- gfp_t gfp = __GFP_NORETRY | __GFP_NOWARN | __GFP_KSWAPD_RECLAIM;
-
- pool = kzalloc(sizeof(*pool), GFP_KERNEL);
-@@ -573,7 +576,10 @@ static struct zswap_pool *zswap_pool_create(char *type, char *compressor)
- return NULL;
- }
-
-- pool->zpool = zpool_create_pool(type, "zswap", gfp, &zswap_zpool_ops);
-+ /* unique name for each pool specifically required by zsmalloc */
-+ snprintf(name, 38, "zswap%x", atomic_inc_return(&zswap_pools_count));
-+
-+ pool->zpool = zpool_create_pool(type, name, gfp, &zswap_zpool_ops);
- if (!pool->zpool) {
- pr_err("%s zpool not available\n", type);
- goto error;
-diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
-index a49c705..5f19133 100644
---- a/net/batman-adv/distributed-arp-table.c
-+++ b/net/batman-adv/distributed-arp-table.c
-@@ -553,6 +553,7 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
- * be sent to
- * @bat_priv: the bat priv with all the soft interface information
- * @ip_dst: ipv4 to look up in the DHT
-+ * @vid: VLAN identifier
- *
- * An originator O is selected if and only if its DHT_ID value is one of three
- * closest values (from the LEFT, with wrap around if needed) then the hash
-@@ -561,7 +562,8 @@ static void batadv_choose_next_candidate(struct batadv_priv *bat_priv,
- * Returns the candidate array of size BATADV_DAT_CANDIDATE_NUM.
- */
- static struct batadv_dat_candidate *
--batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
-+batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst,
-+ unsigned short vid)
- {
- int select;
- batadv_dat_addr_t last_max = BATADV_DAT_ADDR_MAX, ip_key;
-@@ -577,7 +579,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
- return NULL;
-
- dat.ip = ip_dst;
-- dat.vid = 0;
-+ dat.vid = vid;
- ip_key = (batadv_dat_addr_t)batadv_hash_dat(&dat,
- BATADV_DAT_ADDR_MAX);
-
-@@ -597,6 +599,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
- * @bat_priv: the bat priv with all the soft interface information
- * @skb: payload to send
- * @ip: the DHT key
-+ * @vid: VLAN identifier
- * @packet_subtype: unicast4addr packet subtype to use
- *
- * This function copies the skb with pskb_copy() and is sent as unicast packet
-@@ -607,7 +610,7 @@ batadv_dat_select_candidates(struct batadv_priv *bat_priv, __be32 ip_dst)
- */
- static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
- struct sk_buff *skb, __be32 ip,
-- int packet_subtype)
-+ unsigned short vid, int packet_subtype)
- {
- int i;
- bool ret = false;
-@@ -616,7 +619,7 @@ static bool batadv_dat_send_data(struct batadv_priv *bat_priv,
- struct sk_buff *tmp_skb;
- struct batadv_dat_candidate *cand;
-
-- cand = batadv_dat_select_candidates(bat_priv, ip);
-+ cand = batadv_dat_select_candidates(bat_priv, ip, vid);
- if (!cand)
- goto out;
-
-@@ -1004,7 +1007,7 @@ bool batadv_dat_snoop_outgoing_arp_request(struct batadv_priv *bat_priv,
- ret = true;
- } else {
- /* Send the request to the DHT */
-- ret = batadv_dat_send_data(bat_priv, skb, ip_dst,
-+ ret = batadv_dat_send_data(bat_priv, skb, ip_dst, vid,
- BATADV_P_DAT_DHT_GET);
- }
- out:
-@@ -1132,8 +1135,8 @@ void batadv_dat_snoop_outgoing_arp_reply(struct batadv_priv *bat_priv,
- /* Send the ARP reply to the candidates for both the IP addresses that
- * the node obtained from the ARP reply
- */
-- batadv_dat_send_data(bat_priv, skb, ip_src, BATADV_P_DAT_DHT_PUT);
-- batadv_dat_send_data(bat_priv, skb, ip_dst, BATADV_P_DAT_DHT_PUT);
-+ batadv_dat_send_data(bat_priv, skb, ip_src, vid, BATADV_P_DAT_DHT_PUT);
-+ batadv_dat_send_data(bat_priv, skb, ip_dst, vid, BATADV_P_DAT_DHT_PUT);
- }
-
- /**
-diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
-index e4f2646..43d15d6 100644
---- a/net/batman-adv/routing.c
-+++ b/net/batman-adv/routing.c
-@@ -104,6 +104,15 @@ static void _batadv_update_route(struct batadv_priv *bat_priv,
- neigh_node = NULL;
-
- spin_lock_bh(&orig_node->neigh_list_lock);
-+ /* curr_router used earlier may not be the current orig_ifinfo->router
-+ * anymore because it was dereferenced outside of the neigh_list_lock
-+ * protected region. After the new best neighbor has replace the current
-+ * best neighbor the reference counter needs to decrease. Consequently,
-+ * the code needs to ensure the curr_router variable contains a pointer
-+ * to the replaced best neighbor.
-+ */
-+ curr_router = rcu_dereference_protected(orig_ifinfo->router, true);
-+
- rcu_assign_pointer(orig_ifinfo->router, neigh_node);
- spin_unlock_bh(&orig_node->neigh_list_lock);
- batadv_orig_ifinfo_free_ref(orig_ifinfo);
-diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c
-index 782fa33..45bfdef 100644
---- a/net/batman-adv/send.c
-+++ b/net/batman-adv/send.c
-@@ -629,6 +629,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
-
- if (pending) {
- hlist_del(&forw_packet->list);
-+ if (!forw_packet->own)
-+ atomic_inc(&bat_priv->bcast_queue_left);
-+
- batadv_forw_packet_free(forw_packet);
- }
- }
-@@ -656,6 +659,9 @@ batadv_purge_outstanding_packets(struct batadv_priv *bat_priv,
-
- if (pending) {
- hlist_del(&forw_packet->list);
-+ if (!forw_packet->own)
-+ atomic_inc(&bat_priv->batman_queue_left);
-+
- batadv_forw_packet_free(forw_packet);
- }
- }
-diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
-index ac4d08d..720f1a5 100644
---- a/net/batman-adv/soft-interface.c
-+++ b/net/batman-adv/soft-interface.c
-@@ -407,11 +407,17 @@ void batadv_interface_rx(struct net_device *soft_iface,
- */
- nf_reset(skb);
-
-+ if (unlikely(!pskb_may_pull(skb, ETH_HLEN)))
-+ goto dropped;
-+
- vid = batadv_get_vid(skb, 0);
- ethhdr = eth_hdr(skb);
-
- switch (ntohs(ethhdr->h_proto)) {
- case ETH_P_8021Q:
-+ if (!pskb_may_pull(skb, VLAN_ETH_HLEN))
-+ goto dropped;
-+
- vhdr = (struct vlan_ethhdr *)skb->data;
-
- if (vhdr->h_vlan_encapsulated_proto != ethertype)
-@@ -423,8 +429,6 @@ void batadv_interface_rx(struct net_device *soft_iface,
- }
-
- /* skb->dev & skb->pkt_type are set here */
-- if (unlikely(!pskb_may_pull(skb, ETH_HLEN)))
-- goto dropped;
- skb->protocol = eth_type_trans(skb, soft_iface);
-
- /* should not be necessary anymore as we use skb_pull_rcsum()
-diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
-index 7a2b791..bcb0a1b 100644
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -1750,7 +1750,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
-
- ret = dev_alloc_name(ndev, ndev->name);
- if (ret < 0) {
-- free_netdev(ndev);
-+ ieee80211_if_free(ndev);
- return ret;
- }
-
-@@ -1836,7 +1836,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
-
- ret = register_netdevice(ndev);
- if (ret) {
-- free_netdev(ndev);
-+ ieee80211_if_free(ndev);
- return ret;
- }
- }
-diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
-index f57b4dc..4da5600 100644
---- a/net/netfilter/ipvs/ip_vs_core.c
-+++ b/net/netfilter/ipvs/ip_vs_core.c
-@@ -1757,15 +1757,34 @@ ip_vs_in(struct netns_ipvs *ipvs, unsigned int hooknum, struct sk_buff *skb, int
- cp = pp->conn_in_get(ipvs, af, skb, &iph);
-
- conn_reuse_mode = sysctl_conn_reuse_mode(ipvs);
-- if (conn_reuse_mode && !iph.fragoffs &&
-- is_new_conn(skb, &iph) && cp &&
-- ((unlikely(sysctl_expire_nodest_conn(ipvs)) && cp->dest &&
-- unlikely(!atomic_read(&cp->dest->weight))) ||
-- unlikely(is_new_conn_expected(cp, conn_reuse_mode)))) {
-- if (!atomic_read(&cp->n_control))
-- ip_vs_conn_expire_now(cp);
-- __ip_vs_conn_put(cp);
-- cp = NULL;
-+ if (conn_reuse_mode && !iph.fragoffs && is_new_conn(skb, &iph) && cp) {
-+ bool uses_ct = false, resched = false;
-+
-+ if (unlikely(sysctl_expire_nodest_conn(ipvs)) && cp->dest &&
-+ unlikely(!atomic_read(&cp->dest->weight))) {
-+ resched = true;
-+ uses_ct = ip_vs_conn_uses_conntrack(cp, skb);
-+ } else if (is_new_conn_expected(cp, conn_reuse_mode)) {
-+ uses_ct = ip_vs_conn_uses_conntrack(cp, skb);
-+ if (!atomic_read(&cp->n_control)) {
-+ resched = true;
-+ } else {
-+ /* Do not reschedule controlling connection
-+ * that uses conntrack while it is still
-+ * referenced by controlled connection(s).
-+ */
-+ resched = !uses_ct;
-+ }
-+ }
-+
-+ if (resched) {
-+ if (!atomic_read(&cp->n_control))
-+ ip_vs_conn_expire_now(cp);
-+ __ip_vs_conn_put(cp);
-+ if (uses_ct)
-+ return NF_DROP;
-+ cp = NULL;
-+ }
- }
-
- if (unlikely(!cp)) {
-diff --git a/net/netfilter/ipvs/ip_vs_pe_sip.c b/net/netfilter/ipvs/ip_vs_pe_sip.c
-index 1b8d594..0a6eb5c 100644
---- a/net/netfilter/ipvs/ip_vs_pe_sip.c
-+++ b/net/netfilter/ipvs/ip_vs_pe_sip.c
-@@ -70,10 +70,10 @@ ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb)
- const char *dptr;
- int retc;
-
-- ip_vs_fill_iph_skb(p->af, skb, false, &iph);
-+ retc = ip_vs_fill_iph_skb(p->af, skb, false, &iph);
-
- /* Only useful with UDP */
-- if (iph.protocol != IPPROTO_UDP)
-+ if (!retc || iph.protocol != IPPROTO_UDP)
- return -EINVAL;
- /* todo: IPv6 fragments:
- * I think this only should be done for the first fragment. /HS
-@@ -88,7 +88,7 @@ ip_vs_sip_fill_param(struct ip_vs_conn_param *p, struct sk_buff *skb)
- dptr = skb->data + dataoff;
- datalen = skb->len - dataoff;
-
-- if (get_callid(dptr, dataoff, datalen, &matchoff, &matchlen))
-+ if (get_callid(dptr, 0, datalen, &matchoff, &matchlen))
- return -EINVAL;
-
- /* N.B: pe_data is only set on success,
-diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
-index 161dd0d..a915507 100644
---- a/scripts/mod/file2alias.c
-+++ b/scripts/mod/file2alias.c
-@@ -371,6 +371,49 @@ static void do_usb_table(void *symval, unsigned long size,
- do_usb_entry_multi(symval + i, mod);
- }
-
-+static void do_of_entry_multi(void *symval, struct module *mod)
-+{
-+ char alias[500];
-+ int len;
-+ char *tmp;
-+
-+ DEF_FIELD_ADDR(symval, of_device_id, name);
-+ DEF_FIELD_ADDR(symval, of_device_id, type);
-+ DEF_FIELD_ADDR(symval, of_device_id, compatible);
-+
-+ len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
-+ (*type)[0] ? *type : "*");
-+
-+ if (compatible[0])
-+ sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
-+ *compatible);
-+
-+ /* Replace all whitespace with underscores */
-+ for (tmp = alias; tmp && *tmp; tmp++)
-+ if (isspace(*tmp))
-+ *tmp = '_';
-+
-+ buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias);
-+ strcat(alias, "C");
-+ add_wildcard(alias);
-+ buf_printf(&mod->dev_table_buf, "MODULE_ALIAS(\"%s\");\n", alias);
-+}
-+
-+static void do_of_table(void *symval, unsigned long size,
-+ struct module *mod)
-+{
-+ unsigned int i;
-+ const unsigned long id_size = SIZE_of_device_id;
-+
-+ device_id_check(mod->name, "of", size, id_size, symval);
-+
-+ /* Leave last one: it's the terminator. */
-+ size -= id_size;
-+
-+ for (i = 0; i < size; i += id_size)
-+ do_of_entry_multi(symval + i, mod);
-+}
-+
- /* Looks like: hid:bNvNpN */
- static int do_hid_entry(const char *filename,
- void *symval, char *alias)
-@@ -684,30 +727,6 @@ static int do_pcmcia_entry(const char *filename,
- }
- ADD_TO_DEVTABLE("pcmcia", pcmcia_device_id, do_pcmcia_entry);
-
--static int do_of_entry (const char *filename, void *symval, char *alias)
--{
-- int len;
-- char *tmp;
-- DEF_FIELD_ADDR(symval, of_device_id, name);
-- DEF_FIELD_ADDR(symval, of_device_id, type);
-- DEF_FIELD_ADDR(symval, of_device_id, compatible);
--
-- len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
-- (*type)[0] ? *type : "*");
--
-- if (compatible[0])
-- sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
-- *compatible);
--
-- /* Replace all whitespace with underscores */
-- for (tmp = alias; tmp && *tmp; tmp++)
-- if (isspace (*tmp))
-- *tmp = '_';
--
-- return 1;
--}
--ADD_TO_DEVTABLE("of", of_device_id, do_of_entry);
--
- static int do_vio_entry(const char *filename, void *symval,
- char *alias)
- {
-@@ -1348,6 +1367,8 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
- /* First handle the "special" cases */
- if (sym_is(name, namelen, "usb"))
- do_usb_table(symval, sym->st_size, mod);
-+ if (sym_is(name, namelen, "of"))
-+ do_of_table(symval, sym->st_size, mod);
- else if (sym_is(name, namelen, "pnp"))
- do_pnp_device_entry(symval, sym->st_size, mod);
- else if (sym_is(name, namelen, "pnp_card"))
diff --git a/4.5.4/0000_README b/4.5.5/0000_README
index d196de1..2a257db 100644
--- a/4.5.4/0000_README
+++ b/4.5.5/0000_README
@@ -2,11 +2,7 @@ README
-----------------------------------------------------------------------------
Individual Patch Descriptions:
-----------------------------------------------------------------------------
-Patch: 1003_linux-4.5.4.patch
-From: http://www.kernel.org
-Desc: Linux 4.5.4
-
-Patch: 4420_grsecurity-3.1-4.5.4-201605131918.patch
+Patch: 4420_grsecurity-3.1-4.5.5-201605202102.patch
From: http://www.grsecurity.net
Desc: hardened-sources base patch from upstream grsecurity
diff --git a/4.5.4/4420_grsecurity-3.1-4.5.4-201605131918.patch b/4.5.5/4420_grsecurity-3.1-4.5.5-201605202102.patch
index 4d957ee..668dc23 100644
--- a/4.5.4/4420_grsecurity-3.1-4.5.4-201605131918.patch
+++ b/4.5.5/4420_grsecurity-3.1-4.5.5-201605202102.patch
@@ -408,7 +408,7 @@ index a93b414..f50a50b 100644
A toggle value indicating if modules are allowed to be loaded
diff --git a/Makefile b/Makefile
-index d64eade..46c76c5 100644
+index a23df41..314f8da 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,9 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
@@ -34587,6 +34587,27 @@ index e945fed..bffe686 100644
const void *space = s387->st_space;
int ret;
int offset = (S387->ftop & 7) * 10, other = 80 - offset;
+diff --git a/arch/x86/math-emu/fpu_etc.c b/arch/x86/math-emu/fpu_etc.c
+index 233e5af5..dd82ff0 100644
+--- a/arch/x86/math-emu/fpu_etc.c
++++ b/arch/x86/math-emu/fpu_etc.c
+@@ -119,9 +119,14 @@ static void fxam(FPU_REG *st0_ptr, u_char st0tag)
+ setcc(c);
+ }
+
++static void FPU_ST0_illegal(FPU_REG *st0_ptr, u_char st0_tag)
++{
++ FPU_illegal();
++}
++
+ static FUNC_ST0 const fp_etc_table[] = {
+- fchs, fabs, (FUNC_ST0) FPU_illegal, (FUNC_ST0) FPU_illegal,
+- ftst_, fxam, (FUNC_ST0) FPU_illegal, (FUNC_ST0) FPU_illegal
++ fchs, fabs, FPU_ST0_illegal, FPU_ST0_illegal,
++ ftst_, fxam, FPU_ST0_illegal, FPU_ST0_illegal
+ };
+
+ void FPU_etc(void)
diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h
index 5e044d5..d342fce 100644
--- a/arch/x86/math-emu/fpu_system.h
@@ -34600,6 +34621,75 @@ index 5e044d5..d342fce 100644
#define FPU_info (I387->soft.info)
#define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs))
+diff --git a/arch/x86/math-emu/fpu_trig.c b/arch/x86/math-emu/fpu_trig.c
+index ecd0668..4b4c664 100644
+--- a/arch/x86/math-emu/fpu_trig.c
++++ b/arch/x86/math-emu/fpu_trig.c
+@@ -432,13 +432,13 @@ static void fxtract(FPU_REG *st0_ptr, u_char st0_tag)
+ #endif /* PARANOID */
+ }
+
+-static void fdecstp(void)
++static void fdecstp(FPU_REG *st0_ptr, u_char st0_tag)
+ {
+ clear_C1();
+ top--;
+ }
+
+-static void fincstp(void)
++static void fincstp(FPU_REG *st0_ptr, u_char st0_tag)
+ {
+ clear_C1();
+ top++;
+@@ -607,6 +607,11 @@ static int fsin(FPU_REG *st0_ptr, u_char tag)
+ }
+ }
+
++static void _fsin(FPU_REG *st0_ptr, u_char tag)
++{
++ fsin(st0_ptr, tag);
++}
++
+ static int f_cos(FPU_REG *st0_ptr, u_char tag)
+ {
+ u_char st0_sign;
+@@ -1625,7 +1630,7 @@ static void fscale(FPU_REG *st0_ptr, u_char st0_tag)
+
+ static FUNC_ST0 const trig_table_a[] = {
+ f2xm1, fyl2x, fptan, fpatan,
+- fxtract, fprem1, (FUNC_ST0) fdecstp, (FUNC_ST0) fincstp
++ fxtract, fprem1, fdecstp, fincstp
+ };
+
+ void FPU_triga(void)
+@@ -1634,7 +1639,7 @@ void FPU_triga(void)
+ }
+
+ static FUNC_ST0 const trig_table_b[] = {
+- fprem, fyl2xp1, fsqrt_, fsincos, frndint_, fscale, (FUNC_ST0) fsin, fcos
++ fprem, fyl2xp1, fsqrt_, fsincos, frndint_, fscale, _fsin, fcos
+ };
+
+ void FPU_trigb(void)
+diff --git a/arch/x86/math-emu/reg_constant.c b/arch/x86/math-emu/reg_constant.c
+index 0054835..a3bd671 100644
+--- a/arch/x86/math-emu/reg_constant.c
++++ b/arch/x86/math-emu/reg_constant.c
+@@ -107,8 +107,13 @@ static void fldz(int rc)
+
+ typedef void (*FUNC_RC) (int);
+
++static void FPU_RC_illegal(int rc)
++{
++ FPU_illegal();
++}
++
+ static FUNC_RC constants_table[] = {
+- fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, (FUNC_RC) FPU_illegal
++ fld1, fldl2t, fldl2e, fldpi, fldlg2, fldln2, fldz, FPU_RC_illegal
+ };
+
+ void fconst(void)
diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile
index f9d38a4..556175f 100644
--- a/arch/x86/mm/Makefile
@@ -44039,7 +44129,7 @@ index e78a1d7..f6ef8aa 100644
struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev);
diff --git a/drivers/crypto/qat/qat_common/adf_sriov.c b/drivers/crypto/qat/qat_common/adf_sriov.c
-index 1117a8b..6f9dd73 100644
+index 38a0415..fc27277 100644
--- a/drivers/crypto/qat/qat_common/adf_sriov.c
+++ b/drivers/crypto/qat/qat_common/adf_sriov.c
@@ -93,7 +93,7 @@ static void adf_iov_send_resp(struct work_struct *work)
@@ -44051,7 +44141,7 @@ index 1117a8b..6f9dd73 100644
{
struct adf_accel_vf_info *vf_info = (struct adf_accel_vf_info *)data;
struct adf_pf2vf_resp *pf2vf_resp;
-@@ -131,7 +131,7 @@ static int adf_enable_sriov(struct adf_accel_dev *accel_dev)
+@@ -126,7 +126,7 @@ static int adf_enable_sriov(struct adf_accel_dev *accel_dev)
vf_info->vf_nr = i;
tasklet_init(&vf_info->vf2pf_bh_tasklet,
@@ -46590,10 +46680,10 @@ index fa8afa7..0bac957 100644
/**
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
-index c023a04..bebd4e4 100644
+index 39b00b9..aa9fc8a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
-@@ -15109,13 +15109,13 @@ struct intel_quirk {
+@@ -15111,13 +15111,13 @@ struct intel_quirk {
int subsystem_vendor;
int subsystem_device;
void (*hook)(struct drm_device *dev);
@@ -46609,7 +46699,7 @@ index c023a04..bebd4e4 100644
static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
{
-@@ -15123,18 +15123,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
+@@ -15125,18 +15125,20 @@ static int intel_dmi_reverse_brightness(const struct dmi_system_id *id)
return 1;
}
@@ -51994,6 +52084,28 @@ index 9600cd7..86ca5a3 100644
l1p->b_ch[1].b_if.ifc.priv = (void *) &l1p->b_ch[1];
l1p->b_ch[1].l1p = hw->l1 + i;
l1p->b_ch[1].bchan = 2;
+diff --git a/drivers/isdn/hisax/hfc_2bds0.c b/drivers/isdn/hisax/hfc_2bds0.c
+index a756e5c..e4789ba 100644
+--- a/drivers/isdn/hisax/hfc_2bds0.c
++++ b/drivers/isdn/hisax/hfc_2bds0.c
+@@ -1014,7 +1014,7 @@ setstack_hfcd(struct PStack *st, struct IsdnCardState *cs)
+ }
+
+ static void
+-hfc_dbusy_timer(struct IsdnCardState *cs)
++hfc_dbusy_timer(unsigned long _cs)
+ {
+ }
+
+@@ -1073,7 +1073,7 @@ set_cs_func(struct IsdnCardState *cs)
+ cs->writeisacfifo = &dummyf;
+ cs->BC_Read_Reg = &ReadReg;
+ cs->BC_Write_Reg = &WriteReg;
+- cs->dbusytimer.function = (void *) hfc_dbusy_timer;
++ cs->dbusytimer.function = hfc_dbusy_timer;
+ cs->dbusytimer.data = (long) cs;
+ init_timer(&cs->dbusytimer);
+ INIT_WORK(&cs->tqueue, hfcd_bh);
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
index 90449e1..9a5394c 100644
--- a/drivers/isdn/hisax/hfc_pci.c
@@ -52125,6 +52237,31 @@ index 678bd52..1c4f12a 100644
/* init the background machinery for control requests */
hfc->ctrl_read.bRequestType = 0xc0;
+diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c
+index 394da64..85f5f63 100644
+--- a/drivers/isdn/hisax/hfcscard.c
++++ b/drivers/isdn/hisax/hfcscard.c
+@@ -41,8 +41,10 @@ hfcs_interrupt(int intno, void *dev_id)
+ }
+
+ static void
+-hfcs_Timer(struct IsdnCardState *cs)
++hfcs_Timer(unsigned long _cs)
+ {
++ struct IsdnCardState *cs = (struct IsdnCardState *)_cs;
++
+ cs->hw.hfcD.timer.expires = jiffies + 75;
+ /* WD RESET */
+ /* WriteReg(cs, HFCD_DATA, HFCD_CTMT, cs->hw.hfcD.ctmt | 0x80);
+@@ -253,7 +255,7 @@ int setup_hfcs(struct IsdnCard *card)
+ outb(0x57, cs->hw.hfcD.addr | 1);
+ }
+ set_cs_func(cs);
+- cs->hw.hfcD.timer.function = (void *) hfcs_Timer;
++ cs->hw.hfcD.timer.function = hfcs_Timer;
+ cs->hw.hfcD.timer.data = (long) cs;
+ init_timer(&cs->hw.hfcD.timer);
+ cs->cardmsg = &hfcs_card_msg;
diff --git a/drivers/isdn/hisax/icc.c b/drivers/isdn/hisax/icc.c
index 96d1df0..77a05ee 100644
--- a/drivers/isdn/hisax/icc.c
@@ -52253,6 +52390,54 @@ index c754706..8b1ffd5 100644
t->tl.data = (long) t;
init_timer(&t->tl);
}
+diff --git a/drivers/isdn/hisax/saphir.c b/drivers/isdn/hisax/saphir.c
+index 6b2d0ec..4bf5a9e 100644
+--- a/drivers/isdn/hisax/saphir.c
++++ b/drivers/isdn/hisax/saphir.c
+@@ -159,8 +159,9 @@ Start_ISAC:
+ }
+
+ static void
+-SaphirWatchDog(struct IsdnCardState *cs)
++SaphirWatchDog(unsigned long _cs)
+ {
++ struct IsdnCardState *cs = (struct IsdnCardState *)_cs;
+ u_long flags;
+
+ spin_lock_irqsave(&cs->lock, flags);
+@@ -268,7 +269,7 @@ int setup_saphir(struct IsdnCard *card)
+ cs->irq, cs->hw.saphir.cfg_reg);
+
+ setup_isac(cs);
+- cs->hw.saphir.timer.function = (void *) SaphirWatchDog;
++ cs->hw.saphir.timer.function = SaphirWatchDog;
+ cs->hw.saphir.timer.data = (long) cs;
+ init_timer(&cs->hw.saphir.timer);
+ cs->hw.saphir.timer.expires = jiffies + 4 * HZ;
+diff --git a/drivers/isdn/hisax/teleint.c b/drivers/isdn/hisax/teleint.c
+index bf64754..e2a3709 100644
+--- a/drivers/isdn/hisax/teleint.c
++++ b/drivers/isdn/hisax/teleint.c
+@@ -179,8 +179,9 @@ Start_ISAC:
+ }
+
+ static void
+-TeleInt_Timer(struct IsdnCardState *cs)
++TeleInt_Timer(unsigned long _cs)
+ {
++ struct IsdnCardState *cs = (struct IsdnCardState *)_cs;
+ int stat = 0;
+ u_long flags;
+
+@@ -278,7 +279,7 @@ int setup_TeleInt(struct IsdnCard *card)
+ cs->bcs[0].hw.hfc.send = NULL;
+ cs->bcs[1].hw.hfc.send = NULL;
+ cs->hw.hfc.fifosize = 7 * 1024 + 512;
+- cs->hw.hfc.timer.function = (void *) TeleInt_Timer;
++ cs->hw.hfc.timer.function = TeleInt_Timer;
+ cs->hw.hfc.timer.data = (long) cs;
+ init_timer(&cs->hw.hfc.timer);
+ if (!request_region(cs->hw.hfc.addr, 2, "TeleInt isdn")) {
diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c
index a858955..908285b 100644
--- a/drivers/isdn/hisax/w6692.c
@@ -54448,6 +54633,30 @@ index 4ab6586..e1c352e 100644
int p2m_jiffies;
unsigned int p2m_timeouts;
+diff --git a/drivers/media/pci/sta2x11/sta2x11_vip.c b/drivers/media/pci/sta2x11/sta2x11_vip.c
+index 753411c..e3498f8 100644
+--- a/drivers/media/pci/sta2x11/sta2x11_vip.c
++++ b/drivers/media/pci/sta2x11/sta2x11_vip.c
+@@ -786,8 +786,9 @@ static struct video_device video_dev_template = {
+ *
+ * IRQ_HANDLED, interrupt done.
+ */
+-static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip)
++static irqreturn_t vip_irq(int irq, void *_vip)
+ {
++ struct sta2x11_vip *vip = _vip;
+ unsigned int status;
+
+ status = reg_read(vip, DVP_ITS);
+@@ -1079,7 +1080,7 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
+ spin_lock_init(&vip->slock);
+
+ ret = request_irq(pdev->irq,
+- (irq_handler_t) vip_irq,
++ vip_irq,
+ IRQF_SHARED, KBUILD_MODNAME, vip);
+ if (ret) {
+ dev_err(&pdev->dev, "request_irq failed\n");
diff --git a/drivers/media/pci/tw68/tw68-core.c b/drivers/media/pci/tw68/tw68-core.c
index 4e77618..e6f33c8 100644
--- a/drivers/media/pci/tw68/tw68-core.c
@@ -60341,7 +60550,7 @@ index 7ace07d..b9eab92 100644
struct pxa168_eth_private *pep = netdev_priv(dev);
struct net_device_stats *stats = &dev->stats;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
-index 41440b2..0ccefa2 100644
+index 03ef9ac..48664b9 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -61,7 +61,7 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv,
@@ -60354,10 +60563,10 @@ index 41440b2..0ccefa2 100644
if (likely(page))
break;
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
-index e0946ab..308403f 100644
+index 0debb61..964bc54 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c
-@@ -477,8 +477,8 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
+@@ -479,8 +479,8 @@ static bool mlx4_en_process_tx_cq(struct net_device *dev,
wmb();
/* we want to dirty this cache line once */
@@ -61093,6 +61302,19 @@ index 0bf7edd..7fc5d06 100644
.kind = "geneve",
.maxtype = IFLA_GENEVE_MAX,
.policy = geneve_policy,
+diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
+index 72c9f1f..98f72c8 100644
+--- a/drivers/net/hamradio/baycom_epp.c
++++ b/drivers/net/hamradio/baycom_epp.c
+@@ -768,7 +768,7 @@ static void epp_bh(struct work_struct *work)
+ * ===================== network driver interface =========================
+ */
+
+-static int baycom_send_packet(struct sk_buff *skb, struct net_device *dev)
++static netdev_tx_t baycom_send_packet(struct sk_buff *skb, struct net_device *dev)
+ {
+ struct baycom_state *bc = netdev_priv(dev);
+
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
index fcb92c0..a900f7d 100644
--- a/drivers/net/hyperv/hyperv_net.h
@@ -65498,6 +65720,19 @@ index a28414c..26c8768 100644
spin_lock_init(&hwsim_radio_lock);
INIT_LIST_HEAD(&hwsim_radios);
+diff --git a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+index 1efef3b..dc49c3d 100644
+--- a/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
++++ b/drivers/net/wireless/marvell/mwifiex/11n_aggr.c
+@@ -184,7 +184,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv,
+
+ tx_info_src = MWIFIEX_SKB_TXCB(skb_src);
+ skb_aggr = mwifiex_alloc_dma_align_buf(adapter->tx_buf_size,
+- GFP_ATOMIC | GFP_DMA);
++ GFP_ATOMIC);
+ if (!skb_aggr) {
+ spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock,
+ ra_list_flags);
diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c
index 79c16de..efdebed 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
@@ -65511,6 +65746,70 @@ index 79c16de..efdebed 100644
mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
+diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c
+index 6d0dc40..d059ff7 100644
+--- a/drivers/net/wireless/marvell/mwifiex/pcie.c
++++ b/drivers/net/wireless/marvell/mwifiex/pcie.c
+@@ -510,7 +510,7 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter *adapter)
+ for (i = 0; i < MWIFIEX_MAX_TXRX_BD; i++) {
+ /* Allocate skb here so that firmware can DMA data from it */
+ skb = mwifiex_alloc_dma_align_buf(MWIFIEX_RX_DATA_BUF_SIZE,
+- GFP_KERNEL | GFP_DMA);
++ GFP_KERNEL);
+ if (!skb) {
+ mwifiex_dbg(adapter, ERROR,
+ "Unable to allocate skb for RX ring.\n");
+@@ -1322,7 +1322,7 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
+ }
+
+ skb_tmp = mwifiex_alloc_dma_align_buf(MWIFIEX_RX_DATA_BUF_SIZE,
+- GFP_KERNEL | GFP_DMA);
++ GFP_KERNEL);
+ if (!skb_tmp) {
+ mwifiex_dbg(adapter, ERROR,
+ "Unable to allocate skb.\n");
+diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c
+index 4c8cae6..87eed3c 100644
+--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
++++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
+@@ -1119,8 +1119,7 @@ static void mwifiex_deaggr_sdio_pkt(struct mwifiex_adapter *adapter,
+ __func__, pkt_len, blk_size);
+ break;
+ }
+- skb_deaggr = mwifiex_alloc_dma_align_buf(pkt_len,
+- GFP_KERNEL | GFP_DMA);
++ skb_deaggr = mwifiex_alloc_dma_align_buf(pkt_len, GFP_KERNEL);
+ if (!skb_deaggr)
+ break;
+ skb_put(skb_deaggr, pkt_len);
+@@ -1366,8 +1365,7 @@ static int mwifiex_sdio_card_to_host_mp_aggr(struct mwifiex_adapter *adapter,
+
+ /* copy pkt to deaggr buf */
+ skb_deaggr = mwifiex_alloc_dma_align_buf(len_arr[pind],
+- GFP_KERNEL |
+- GFP_DMA);
++ GFP_KERNEL);
+ if (!skb_deaggr) {
+ mwifiex_dbg(adapter, ERROR, "skb allocation failure\t"
+ "drop pkt len=%d type=%d\n",
+@@ -1409,7 +1407,7 @@ rx_curr_single:
+ mwifiex_dbg(adapter, INFO, "info: RX: port: %d, rx_len: %d\n",
+ port, rx_len);
+
+- skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA);
++ skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL);
+ if (!skb) {
+ mwifiex_dbg(adapter, ERROR,
+ "single skb allocated fail,\t"
+@@ -1514,7 +1512,7 @@ static int mwifiex_process_int_status(struct mwifiex_adapter *adapter)
+ rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
+ mwifiex_dbg(adapter, INFO, "info: rx_len = %d\n", rx_len);
+
+- skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL | GFP_DMA);
++ skb = mwifiex_alloc_dma_align_buf(rx_len, GFP_KERNEL);
+ if (!skb)
+ return -1;
+
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
index 155f343..5db43e7 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
@@ -74230,7 +74529,7 @@ index 54fe9d7..47110ad 100644
struct wilc_vif *vif;
struct tx_complete_data *tx_data = NULL;
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
-index 86de50c..812eb42 100644
+index b3d6541..812eb42 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -20,6 +20,7 @@
@@ -74241,15 +74540,6 @@ index 86de50c..812eb42 100644
#include "wilc_wlan_if.h"
#include "wilc_wlan.h"
#include "wilc_wfi_netdevice.h"
-@@ -120,8 +121,6 @@ static u8 crc7(u8 crc, const u8 *buffer, u32 len)
-
- #define USE_SPI_DMA 0
-
--static const struct wilc1000_ops wilc1000_spi_ops;
--
- static int wilc_bus_probe(struct spi_device *spi)
- {
- int ret, gpio;
diff --git a/drivers/staging/wilc1000/wilc_wlan.h b/drivers/staging/wilc1000/wilc_wlan.h
index 2edd744..908a222 100644
--- a/drivers/staging/wilc1000/wilc_wlan.h
@@ -94522,10 +94812,10 @@ index 826b164..690322d 100644
else if (whole->bd_holder != NULL)
return false; /* is a partition of a held device */
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
-index 769e0ff..0f57508 100644
+index dea6486..32f1db9 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
-@@ -357,7 +357,7 @@ static inline void tree_mod_log_write_unlock(struct btrfs_fs_info *fs_info)
+@@ -358,7 +358,7 @@ static inline void tree_mod_log_write_unlock(struct btrfs_fs_info *fs_info)
*/
static inline u64 btrfs_inc_tree_mod_seq(struct btrfs_fs_info *fs_info)
{
@@ -94534,7 +94824,7 @@ index 769e0ff..0f57508 100644
}
/*
-@@ -1182,9 +1182,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
+@@ -1183,9 +1183,12 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
free_extent_buffer(buf);
add_root_to_dirty_list(root);
} else {
@@ -94551,7 +94841,7 @@ index 769e0ff..0f57508 100644
WARN_ON(trans->transid != btrfs_header_generation(parent));
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
-index bfe4a33..1bd2b22 100644
+index 6661ad8..11c47b3 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1618,7 +1618,7 @@ struct btrfs_fs_info {
@@ -94648,10 +94938,10 @@ index 914ac13..6a872f7 100644
/* first set the basic ref node struct up */
atomic_set(&ref->refs, 1);
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
-index d8d68af..2524afc0 100644
+index ae6e3e3..ed0fc87 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
-@@ -1271,7 +1271,7 @@ static void __setup_root(u32 nodesize, u32 sectorsize, u32 stripesize,
+@@ -1279,7 +1279,7 @@ static void __setup_root(u32 nodesize, u32 sectorsize, u32 stripesize,
atomic_set(&root->log_commit[0], 0);
atomic_set(&root->log_commit[1], 0);
atomic_set(&root->log_writers, 0);
@@ -94660,7 +94950,7 @@ index d8d68af..2524afc0 100644
atomic_set(&root->orphan_inodes, 0);
atomic_set(&root->refs, 1);
atomic_set(&root->will_be_snapshoted, 0);
-@@ -2603,7 +2603,7 @@ int open_ctree(struct super_block *sb,
+@@ -2611,7 +2611,7 @@ int open_ctree(struct super_block *sb,
atomic_set(&fs_info->nr_async_bios, 0);
atomic_set(&fs_info->defrag_running, 0);
atomic_set(&fs_info->qgroup_op_seq, 0);
@@ -94696,7 +94986,7 @@ index 84fb56d..ee0fe69 100644
RB_CLEAR_NODE(&merge->rb_node);
em->mod_len = (merge->mod_start + merge->mod_len) - em->mod_start;
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
-index 9a30ca6..830e945 100644
+index 5d956b8..38741ed 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1910,7 +1910,7 @@ int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
@@ -94930,7 +95220,7 @@ index b6031ce..5d53523 100644
spin_lock_init(&cur_trans->delayed_refs.lock);
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
-index 849a30a..f7563af 100644
+index 58ae0a2..94e8de6 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -172,7 +172,7 @@ static int start_log_trans(struct btrfs_trans_handle *trans,
@@ -94970,7 +95260,7 @@ index 849a30a..f7563af 100644
index2 = log_root_tree->log_transid % 2;
diff --git a/fs/btrfs/tree-log.h b/fs/btrfs/tree-log.h
-index 6916a78..4598936 100644
+index a9f1b75..0df211d 100644
--- a/fs/btrfs/tree-log.h
+++ b/fs/btrfs/tree-log.h
@@ -45,7 +45,7 @@ static inline void btrfs_init_log_ctx(struct btrfs_log_ctx *ctx)
@@ -101434,7 +101724,7 @@ index 14db05d..687f6d8 100644
#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
diff --git a/fs/namei.c b/fs/namei.c
-index 9c590e0..654baa99 100644
+index 7824bfb..bddd8a4 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -336,17 +336,32 @@ int generic_permission(struct inode *inode, int mask)
@@ -101691,7 +101981,7 @@ index 9c590e0..654baa99 100644
return 0;
}
-@@ -3045,6 +3159,21 @@ static int lookup_open(struct nameidata *nd, struct path *path,
+@@ -3033,6 +3147,21 @@ static int lookup_open(struct nameidata *nd, struct path *path,
/* Negative dentry, just create the file */
if (!dentry->d_inode && (op->open_flag & O_CREAT)) {
umode_t mode = op->mode;
@@ -101713,7 +102003,7 @@ index 9c590e0..654baa99 100644
if (!IS_POSIXACL(dir->d_inode))
mode &= ~current_umask();
/*
-@@ -3066,6 +3195,8 @@ static int lookup_open(struct nameidata *nd, struct path *path,
+@@ -3054,6 +3183,8 @@ static int lookup_open(struct nameidata *nd, struct path *path,
nd->flags & LOOKUP_EXCL);
if (error)
goto out_dput;
@@ -101722,7 +102012,7 @@ index 9c590e0..654baa99 100644
}
out_no_open:
path->dentry = dentry;
-@@ -3171,11 +3302,24 @@ retry_lookup:
+@@ -3159,11 +3290,24 @@ retry_lookup:
goto finish_open_created;
}
@@ -101748,7 +102038,7 @@ index 9c590e0..654baa99 100644
/*
* If atomic_open() acquired write access it is dropped now due to
-@@ -3228,6 +3372,21 @@ finish_open:
+@@ -3216,6 +3360,21 @@ finish_open:
path_put(&save_parent);
return error;
}
@@ -101770,7 +102060,7 @@ index 9c590e0..654baa99 100644
audit_inode(nd->name, nd->path.dentry, 0);
if (unlikely(d_is_symlink(nd->path.dentry)) && !(open_flag & O_PATH)) {
error = -ELOOP;
-@@ -3503,9 +3662,11 @@ static struct dentry *filename_create(int dfd, struct filename *name,
+@@ -3491,9 +3650,11 @@ static struct dentry *filename_create(int dfd, struct filename *name,
goto unlock;
error = -EEXIST;
@@ -101784,7 +102074,7 @@ index 9c590e0..654baa99 100644
/*
* Special case - lookup gave negative, but... we had foo/bar/
* From the vfs_mknod() POV we just have a negative dentry -
-@@ -3559,6 +3720,20 @@ inline struct dentry *user_path_create(int dfd, const char __user *pathname,
+@@ -3547,6 +3708,20 @@ inline struct dentry *user_path_create(int dfd, const char __user *pathname,
}
EXPORT_SYMBOL(user_path_create);
@@ -101805,7 +102095,7 @@ index 9c590e0..654baa99 100644
int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
{
int error = may_create(dir, dentry);
-@@ -3622,6 +3797,17 @@ retry:
+@@ -3610,6 +3785,17 @@ retry:
if (!IS_POSIXACL(path.dentry->d_inode))
mode &= ~current_umask();
@@ -101823,7 +102113,7 @@ index 9c590e0..654baa99 100644
error = security_path_mknod(&path, dentry, mode, dev);
if (error)
goto out;
-@@ -3637,6 +3823,8 @@ retry:
+@@ -3625,6 +3811,8 @@ retry:
error = vfs_mknod(path.dentry->d_inode,dentry,mode,0);
break;
}
@@ -101832,7 +102122,7 @@ index 9c590e0..654baa99 100644
out:
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
-@@ -3691,9 +3879,16 @@ retry:
+@@ -3679,9 +3867,16 @@ retry:
if (!IS_POSIXACL(path.dentry->d_inode))
mode &= ~current_umask();
@@ -101849,7 +102139,7 @@ index 9c590e0..654baa99 100644
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
-@@ -3726,7 +3921,7 @@ void dentry_unhash(struct dentry *dentry)
+@@ -3714,7 +3909,7 @@ void dentry_unhash(struct dentry *dentry)
{
shrink_dcache_parent(dentry);
spin_lock(&dentry->d_lock);
@@ -101858,7 +102148,7 @@ index 9c590e0..654baa99 100644
__d_drop(dentry);
spin_unlock(&dentry->d_lock);
}
-@@ -3779,6 +3974,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
+@@ -3767,6 +3962,8 @@ static long do_rmdir(int dfd, const char __user *pathname)
struct path path;
struct qstr last;
int type;
@@ -101867,7 +102157,7 @@ index 9c590e0..654baa99 100644
unsigned int lookup_flags = 0;
retry:
name = user_path_parent(dfd, pathname,
-@@ -3811,10 +4008,20 @@ retry:
+@@ -3799,10 +3996,20 @@ retry:
error = -ENOENT;
goto exit3;
}
@@ -101888,7 +102178,7 @@ index 9c590e0..654baa99 100644
exit3:
dput(dentry);
exit2:
-@@ -3909,6 +4116,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
+@@ -3897,6 +4104,8 @@ static long do_unlinkat(int dfd, const char __user *pathname)
int type;
struct inode *inode = NULL;
struct inode *delegated_inode = NULL;
@@ -101897,7 +102187,7 @@ index 9c590e0..654baa99 100644
unsigned int lookup_flags = 0;
retry:
name = user_path_parent(dfd, pathname,
-@@ -3935,10 +4144,21 @@ retry_deleg:
+@@ -3923,10 +4132,21 @@ retry_deleg:
if (d_is_negative(dentry))
goto slashes;
ihold(inode);
@@ -101919,7 +102209,7 @@ index 9c590e0..654baa99 100644
exit2:
dput(dentry);
}
-@@ -4027,9 +4247,17 @@ retry:
+@@ -4015,9 +4235,17 @@ retry:
if (IS_ERR(dentry))
goto out_putname;
@@ -101937,7 +102227,7 @@ index 9c590e0..654baa99 100644
done_path_create(&path, dentry);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
-@@ -4133,6 +4361,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
+@@ -4121,6 +4349,7 @@ SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
struct dentry *new_dentry;
struct path old_path, new_path;
struct inode *delegated_inode = NULL;
@@ -101945,7 +102235,7 @@ index 9c590e0..654baa99 100644
int how = 0;
int error;
-@@ -4156,7 +4385,7 @@ retry:
+@@ -4144,7 +4373,7 @@ retry:
if (error)
return error;
@@ -101954,7 +102244,7 @@ index 9c590e0..654baa99 100644
(how & LOOKUP_REVAL));
error = PTR_ERR(new_dentry);
if (IS_ERR(new_dentry))
-@@ -4168,11 +4397,26 @@ retry:
+@@ -4156,11 +4385,26 @@ retry:
error = may_linkat(&old_path);
if (unlikely(error))
goto out_dput;
@@ -101981,7 +102271,7 @@ index 9c590e0..654baa99 100644
done_path_create(&new_path, new_dentry);
if (delegated_inode) {
error = break_deleg_wait(&delegated_inode);
-@@ -4487,6 +4731,20 @@ retry_deleg:
+@@ -4479,6 +4723,20 @@ retry_deleg:
if (new_dentry == trap)
goto exit5;
@@ -102002,7 +102292,7 @@ index 9c590e0..654baa99 100644
error = security_path_rename(&old_path, old_dentry,
&new_path, new_dentry, flags);
if (error)
-@@ -4494,6 +4752,9 @@ retry_deleg:
+@@ -4486,6 +4744,9 @@ retry_deleg:
error = vfs_rename(old_path.dentry->d_inode, old_dentry,
new_path.dentry->d_inode, new_dentry,
&delegated_inode, flags);
@@ -102012,7 +102302,7 @@ index 9c590e0..654baa99 100644
exit5:
dput(new_dentry);
exit4:
-@@ -4550,14 +4811,24 @@ EXPORT_SYMBOL(vfs_whiteout);
+@@ -4542,14 +4803,24 @@ EXPORT_SYMBOL(vfs_whiteout);
int readlink_copy(char __user *buffer, int buflen, const char *link)
{
@@ -110604,7 +110894,7 @@ index faa1365..ded3cff 100644
/* Copy the blockcheck stats from the superblock probe */
osb->osb_ecc_stats = *stats;
diff --git a/fs/open.c b/fs/open.c
-index 17cb6b1..d64c63e 100644
+index 081d3d6..c1b8284a 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -32,6 +32,8 @@
@@ -110708,7 +110998,7 @@ index 17cb6b1..d64c63e 100644
retry_deleg:
newattrs.ia_valid = ATTR_CTIME;
if (user != (uid_t) -1) {
-@@ -1024,6 +1061,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
+@@ -1020,6 +1057,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
} else {
fsnotify_open(f);
fd_install(fd, f);
@@ -127332,7 +127622,7 @@ index 653589e..4ef254a 100644
return c | 0x20;
}
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
-index 03dda7b..430d42c 100644
+index 96c1a2d..dc7bc21 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -123,6 +123,9 @@ struct dentry {
@@ -130078,7 +130368,7 @@ index 2696c1f..9320d41 100644
static inline int
vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
diff --git a/include/linux/mm.h b/include/linux/mm.h
-index a6c240e..c25ac8d 100644
+index e4e59f9..e23d329 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -155,6 +155,11 @@ extern unsigned int kobjsize(const void *objp);
@@ -130112,7 +130402,7 @@ index a6c240e..c25ac8d 100644
struct mmu_gather;
struct inode;
-@@ -1179,8 +1185,8 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
+@@ -1188,8 +1194,8 @@ int follow_pfn(struct vm_area_struct *vma, unsigned long address,
unsigned long *pfn);
int follow_phys(struct vm_area_struct *vma, unsigned long address,
unsigned int flags, unsigned long *prot, resource_size_t *phys);
@@ -130123,7 +130413,7 @@ index a6c240e..c25ac8d 100644
static inline void unmap_shared_mapping_range(struct address_space *mapping,
loff_t const holebegin, loff_t const holelen)
-@@ -1221,9 +1227,9 @@ static inline int fixup_user_fault(struct task_struct *tsk,
+@@ -1230,9 +1236,9 @@ static inline int fixup_user_fault(struct task_struct *tsk,
}
#endif
@@ -130136,7 +130426,7 @@ index a6c240e..c25ac8d 100644
long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
unsigned long start, unsigned long nr_pages,
-@@ -1314,39 +1320,11 @@ int clear_page_dirty_for_io(struct page *page);
+@@ -1323,39 +1329,11 @@ int clear_page_dirty_for_io(struct page *page);
int get_cmdline(struct task_struct *task, char *buffer, int buflen);
@@ -130176,7 +130466,7 @@ index a6c240e..c25ac8d 100644
int vma_is_stack_for_task(struct vm_area_struct *vma, struct task_struct *t);
extern unsigned long move_page_tables(struct vm_area_struct *vma,
-@@ -1491,8 +1469,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
+@@ -1500,8 +1478,15 @@ static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd,
{
return 0;
}
@@ -130192,7 +130482,7 @@ index a6c240e..c25ac8d 100644
#endif
#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
-@@ -1502,6 +1487,12 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
+@@ -1511,6 +1496,12 @@ static inline int __pmd_alloc(struct mm_struct *mm, pud_t *pud,
return 0;
}
@@ -130205,7 +130495,7 @@ index a6c240e..c25ac8d 100644
static inline void mm_nr_pmds_init(struct mm_struct *mm) {}
static inline unsigned long mm_nr_pmds(struct mm_struct *mm)
-@@ -1514,6 +1505,7 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {}
+@@ -1523,6 +1514,7 @@ static inline void mm_dec_nr_pmds(struct mm_struct *mm) {}
#else
int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address);
@@ -130213,7 +130503,7 @@ index a6c240e..c25ac8d 100644
static inline void mm_nr_pmds_init(struct mm_struct *mm)
{
-@@ -1551,11 +1543,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a
+@@ -1560,11 +1552,23 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long a
NULL: pud_offset(pgd, address);
}
@@ -130237,7 +130527,7 @@ index a6c240e..c25ac8d 100644
#endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */
#if USE_SPLIT_PTE_PTLOCKS
-@@ -1938,12 +1942,23 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
+@@ -1947,12 +1951,23 @@ extern struct vm_area_struct *copy_vma(struct vm_area_struct **,
bool *need_rmap_locks);
extern void exit_mmap(struct mm_struct *);
@@ -130261,7 +130551,7 @@ index a6c240e..c25ac8d 100644
if (rlim < RLIM_INFINITY) {
if (((new - start) + (end_data - start_data)) > rlim)
return -ENOSPC;
-@@ -1978,6 +1993,7 @@ extern unsigned long do_mmap(struct file *file, unsigned long addr,
+@@ -1987,6 +2002,7 @@ extern unsigned long do_mmap(struct file *file, unsigned long addr,
unsigned long len, unsigned long prot, unsigned long flags,
vm_flags_t vm_flags, unsigned long pgoff, unsigned long *populate);
extern int do_munmap(struct mm_struct *, unsigned long, size_t);
@@ -130269,7 +130559,7 @@ index a6c240e..c25ac8d 100644
static inline unsigned long
do_mmap_pgoff(struct file *file, unsigned long addr,
-@@ -2014,10 +2030,11 @@ struct vm_unmapped_area_info {
+@@ -2023,10 +2039,11 @@ struct vm_unmapped_area_info {
unsigned long high_limit;
unsigned long align_mask;
unsigned long align_offset;
@@ -130283,7 +130573,7 @@ index a6c240e..c25ac8d 100644
/*
* Search for an unmapped address range.
-@@ -2029,7 +2046,7 @@ extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
+@@ -2038,7 +2055,7 @@ extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
* - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
*/
static inline unsigned long
@@ -130292,7 +130582,7 @@ index a6c240e..c25ac8d 100644
{
if (info->flags & VM_UNMAPPED_AREA_TOPDOWN)
return unmapped_area_topdown(info);
-@@ -2089,6 +2106,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add
+@@ -2098,6 +2115,10 @@ extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long add
extern struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
struct vm_area_struct **pprev);
@@ -130303,7 +130593,7 @@ index a6c240e..c25ac8d 100644
/* Look up the first VMA which intersects the interval start_addr..end_addr-1,
NULL if none. Assume start_addr < end_addr. */
static inline struct vm_area_struct * find_vma_intersection(struct mm_struct * mm, unsigned long start_addr, unsigned long end_addr)
-@@ -2118,10 +2139,10 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
+@@ -2127,10 +2148,10 @@ static inline struct vm_area_struct *find_exact_vma(struct mm_struct *mm,
}
#ifdef CONFIG_MMU
@@ -130316,7 +130606,7 @@ index a6c240e..c25ac8d 100644
{
return __pgprot(0);
}
-@@ -2286,7 +2307,7 @@ extern int get_hwpoison_page(struct page *page);
+@@ -2295,7 +2316,7 @@ extern int get_hwpoison_page(struct page *page);
extern int sysctl_memory_failure_early_kill;
extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
@@ -130325,7 +130615,7 @@ index a6c240e..c25ac8d 100644
extern int soft_offline_page(struct page *page, int flags);
-@@ -2371,5 +2392,11 @@ void __init setup_nr_node_ids(void);
+@@ -2380,5 +2401,11 @@ void __init setup_nr_node_ids(void);
static inline void setup_nr_node_ids(void) {}
#endif
@@ -130702,7 +130992,7 @@ index f3f302f..a001305 100644
/* Helper routines for sys_msgsnd and sys_msgrcv */
extern long do_msgsnd(int msqid, long mtype, void __user *mtext,
diff --git a/include/linux/net.h b/include/linux/net.h
-index 0b4ac7d..d4dc945 100644
+index 25ef630..fc83c44 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -195,7 +195,7 @@ struct net_proto_family {
@@ -134606,7 +134896,7 @@ index 35512ac..edbd85b 100644
#define SNMP_INC_STATS(mib, field) \
this_cpu_inc(mib->mibs[field])
diff --git a/include/net/sock.h b/include/net/sock.h
-index f5ea148..196f663 100644
+index 3c688ca..9d0e259 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -188,7 +188,7 @@ struct sock_common {
@@ -134627,7 +134917,7 @@ index f5ea148..196f663 100644
int sk_rcvbuf;
struct sk_filter __rcu *sk_filter;
-@@ -1037,7 +1037,7 @@ struct proto {
+@@ -1041,7 +1041,7 @@ struct proto {
atomic_t socks;
#endif
int (*diag_destroy)(struct sock *sk, int err);
@@ -134636,7 +134926,7 @@ index f5ea148..196f663 100644
int proto_register(struct proto *prot, int alloc_slab);
void proto_unregister(struct proto *prot);
-@@ -1124,7 +1124,7 @@ static inline long sk_prot_mem_limits(const struct sock *sk, int index)
+@@ -1128,7 +1128,7 @@ static inline long sk_prot_mem_limits(const struct sock *sk, int index)
return sk->sk_prot->sysctl_mem[index];
}
@@ -134645,7 +134935,7 @@ index f5ea148..196f663 100644
sk_memory_allocated(const struct sock *sk)
{
return atomic_long_read(sk->sk_prot->memory_allocated);
-@@ -1683,7 +1683,7 @@ static inline bool sk_check_csum_caps(struct sock *sk)
+@@ -1687,7 +1687,7 @@ static inline bool sk_check_csum_caps(struct sock *sk)
}
static inline int skb_do_copy_data_nocache(struct sock *sk, struct sk_buff *skb,
@@ -134654,7 +134944,7 @@ index f5ea148..196f663 100644
int copy, int offset)
{
if (skb->ip_summed == CHECKSUM_NONE) {
-@@ -1928,7 +1928,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
+@@ -1932,7 +1932,7 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
}
}
@@ -134663,7 +134953,7 @@ index f5ea148..196f663 100644
bool force_schedule);
/**
-@@ -2004,7 +2004,7 @@ struct sock_skb_cb {
+@@ -2008,7 +2008,7 @@ struct sock_skb_cb {
static inline void
sock_skb_set_dropcount(const struct sock *sk, struct sk_buff *skb)
{
@@ -136351,10 +136641,10 @@ index 972d9a8..367b6a1 100644
bpf_int_jit_compile(fp);
bpf_prog_lock_ro(fp);
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
-index 6373970..a4e1c851 100644
+index aa5f3977..d9f3f3e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
-@@ -731,8 +731,16 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
+@@ -747,8 +747,16 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
union bpf_attr attr = {};
int err;
@@ -136372,18 +136662,6 @@ index 6373970..a4e1c851 100644
if (!access_ok(VERIFY_READ, uattr, 1))
return -EFAULT;
-diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
-index 2e7f7ab..7520d73 100644
---- a/kernel/bpf/verifier.c
-+++ b/kernel/bpf/verifier.c
-@@ -2003,7 +2003,6 @@ static int replace_map_fd_with_map_ptr(struct verifier_env *env)
- if (IS_ERR(map)) {
- verbose("fd %d is not pointing to valid bpf_map\n",
- insn->imm);
-- fdput(f);
- return PTR_ERR(map);
- }
-
diff --git a/kernel/capability.c b/kernel/capability.c
index 45432b5..988f1e4 100644
--- a/kernel/capability.c
@@ -143136,7 +143414,7 @@ index 9acb29f..6fe517c 100644
.thread_should_run = watchdog_should_run,
.thread_fn = watchdog,
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
-index 9e82d04..72c5756 100644
+index f48c80e..43b9e4b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1950,9 +1950,8 @@ static void pool_mayday_timeout(unsigned long __pool)
@@ -143161,7 +143439,7 @@ index 9e82d04..72c5756 100644
{
struct pool_workqueue *pwq = get_work_pwq(work);
struct worker_pool *pool = worker->pool;
-@@ -4590,7 +4588,7 @@ static void rebind_workers(struct worker_pool *pool)
+@@ -4601,7 +4599,7 @@ static void rebind_workers(struct worker_pool *pool)
WARN_ON_ONCE(!(worker_flags & WORKER_UNBOUND));
worker_flags |= WORKER_REBOUND;
worker_flags &= ~WORKER_UNBOUND;
@@ -144999,7 +145277,7 @@ index ac595e7..78fa945 100644
/*
* free pages are specially detected outside this table:
diff --git a/mm/memory.c b/mm/memory.c
-index 3345dcf..291e077 100644
+index c1aa0e4..a987b41 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -416,6 +416,7 @@ static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
@@ -145328,7 +145606,7 @@ index 3345dcf..291e077 100644
/* Free the old page.. */
new_page = old_page;
page_copied = 1;
-@@ -2625,6 +2851,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2631,6 +2857,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
if (mem_cgroup_swap_full(page) ||
(vma->vm_flags & VM_LOCKED) || PageMlocked(page))
try_to_free_swap(page);
@@ -145340,7 +145618,7 @@ index 3345dcf..291e077 100644
unlock_page(page);
if (page != swapcache) {
/*
-@@ -2648,6 +2879,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2654,6 +2885,11 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, address, page_table);
@@ -145352,7 +145630,7 @@ index 3345dcf..291e077 100644
unlock:
pte_unmap_unlock(page_table, ptl);
out:
-@@ -2667,40 +2903,6 @@ out_release:
+@@ -2673,40 +2909,6 @@ out_release:
}
/*
@@ -145393,7 +145671,7 @@ index 3345dcf..291e077 100644
* We enter with non-exclusive mmap_sem (to exclude vma changes,
* but allow concurrent faults), and pte mapped but not yet locked.
* We return with mmap_sem still held, but pte unmapped and unlocked.
-@@ -2710,25 +2912,22 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2716,25 +2918,22 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
unsigned int flags)
{
struct mem_cgroup *memcg;
@@ -145425,7 +145703,7 @@ index 3345dcf..291e077 100644
if (!pte_none(*page_table))
goto unlock;
/* Deliver the page fault to userland, check inside PT lock */
-@@ -2741,6 +2940,8 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2747,6 +2946,8 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
}
/* Allocate our own private page. */
@@ -145434,7 +145712,7 @@ index 3345dcf..291e077 100644
if (unlikely(anon_vma_prepare(vma)))
goto oom;
page = alloc_zeroed_user_highpage_movable(vma, address);
-@@ -2774,6 +2975,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -2780,6 +2981,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
VM_UFFD_MISSING);
}
@@ -145446,7 +145724,7 @@ index 3345dcf..291e077 100644
inc_mm_counter_fast(mm, MM_ANONPAGES);
page_add_new_anon_rmap(page, vma, address, false);
mem_cgroup_commit_charge(page, memcg, false, false);
-@@ -2783,6 +2989,12 @@ setpte:
+@@ -2789,6 +2995,12 @@ setpte:
/* No need to invalidate - it was non-present before */
update_mmu_cache(vma, address, page_table);
@@ -145459,7 +145737,7 @@ index 3345dcf..291e077 100644
unlock:
pte_unmap_unlock(page_table, ptl);
return 0;
-@@ -3017,6 +3229,11 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3023,6 +3235,11 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
return ret;
}
do_set_pte(vma, address, fault_page, pte, false, false);
@@ -145471,7 +145749,7 @@ index 3345dcf..291e077 100644
unlock_page(fault_page);
unlock_out:
pte_unmap_unlock(pte, ptl);
-@@ -3068,7 +3285,18 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3074,7 +3291,18 @@ static int do_cow_fault(struct mm_struct *mm, struct vm_area_struct *vma,
}
goto uncharge_out;
}
@@ -145490,7 +145768,7 @@ index 3345dcf..291e077 100644
mem_cgroup_commit_charge(new_page, memcg, false, false);
lru_cache_add_active_or_unevictable(new_page, vma);
pte_unmap_unlock(pte, ptl);
-@@ -3126,6 +3354,11 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3132,6 +3360,11 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
return ret;
}
do_set_pte(vma, address, fault_page, pte, true, false);
@@ -145502,7 +145780,7 @@ index 3345dcf..291e077 100644
pte_unmap_unlock(pte, ptl);
if (set_page_dirty(fault_page))
-@@ -3378,6 +3611,12 @@ static int handle_pte_fault(struct mm_struct *mm,
+@@ -3384,6 +3617,12 @@ static int handle_pte_fault(struct mm_struct *mm,
if (flags & FAULT_FLAG_WRITE)
flush_tlb_fix_spurious_fault(vma, address);
}
@@ -145515,7 +145793,7 @@ index 3345dcf..291e077 100644
unlock:
pte_unmap_unlock(pte, ptl);
return 0;
-@@ -3397,9 +3636,41 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
+@@ -3403,9 +3642,41 @@ static int __handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
pmd_t *pmd;
pte_t *pte;
@@ -145557,7 +145835,7 @@ index 3345dcf..291e077 100644
pgd = pgd_offset(mm, address);
pud = pud_alloc(mm, pgd, address);
if (!pud)
-@@ -3533,6 +3804,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
+@@ -3539,6 +3810,23 @@ int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address)
spin_unlock(&mm->page_table_lock);
return 0;
}
@@ -145581,7 +145859,7 @@ index 3345dcf..291e077 100644
#endif /* __PAGETABLE_PUD_FOLDED */
#ifndef __PAGETABLE_PMD_FOLDED
-@@ -3565,6 +3853,32 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
+@@ -3571,6 +3859,32 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
spin_unlock(&mm->page_table_lock);
return 0;
}
@@ -145614,7 +145892,7 @@ index 3345dcf..291e077 100644
#endif /* __PAGETABLE_PMD_FOLDED */
static int __follow_pte(struct mm_struct *mm, unsigned long address,
-@@ -3674,8 +3988,8 @@ out:
+@@ -3680,8 +3994,8 @@ out:
return ret;
}
@@ -145625,7 +145903,7 @@ index 3345dcf..291e077 100644
{
resource_size_t phys_addr;
unsigned long prot = 0;
-@@ -3701,8 +4015,8 @@ EXPORT_SYMBOL_GPL(generic_access_phys);
+@@ -3707,8 +4021,8 @@ EXPORT_SYMBOL_GPL(generic_access_phys);
* Access another process' address space as given in mm. If non-NULL, use the
* given task for page fault accounting.
*/
@@ -145636,7 +145914,7 @@ index 3345dcf..291e077 100644
{
struct vm_area_struct *vma;
void *old_buf = buf;
-@@ -3710,7 +4024,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
+@@ -3716,7 +4030,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
down_read(&mm->mmap_sem);
/* ignore errors, just check how much was successfully transferred */
while (len) {
@@ -145645,7 +145923,7 @@ index 3345dcf..291e077 100644
void *maddr;
struct page *page = NULL;
-@@ -3771,8 +4085,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
+@@ -3777,8 +4091,8 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
*
* The caller must hold a reference on @mm.
*/
@@ -145656,7 +145934,7 @@ index 3345dcf..291e077 100644
{
return __access_remote_vm(NULL, mm, addr, buf, len, write);
}
-@@ -3782,11 +4096,11 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
+@@ -3788,11 +4102,11 @@ int access_remote_vm(struct mm_struct *mm, unsigned long addr,
* Source/target buffer must be kernel space,
* Do not walk the page table directly, use get_user_pages
*/
@@ -149281,7 +149559,7 @@ index 09fe5e9..be5ad5b 100644
}
diff --git a/mm/swapfile.c b/mm/swapfile.c
-index d2c3736..bf79426 100644
+index 954fd8f..4d2eb9b 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -84,7 +84,7 @@ static DEFINE_MUTEX(swapon_mutex);
@@ -149293,7 +149571,7 @@ index d2c3736..bf79426 100644
static inline unsigned char swap_count(unsigned char ent)
{
-@@ -1972,7 +1972,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
+@@ -1973,7 +1973,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
spin_unlock(&swap_lock);
err = 0;
@@ -149302,7 +149580,7 @@ index d2c3736..bf79426 100644
wake_up_interruptible(&proc_poll_wait);
out_dput:
-@@ -1989,8 +1989,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
+@@ -1990,8 +1990,8 @@ static unsigned swaps_poll(struct file *file, poll_table *wait)
poll_wait(file, &proc_poll_wait, wait);
@@ -149313,7 +149591,7 @@ index d2c3736..bf79426 100644
return POLLIN | POLLRDNORM | POLLERR | POLLPRI;
}
-@@ -2088,7 +2088,7 @@ static int swaps_open(struct inode *inode, struct file *file)
+@@ -2089,7 +2089,7 @@ static int swaps_open(struct inode *inode, struct file *file)
return ret;
seq = file->private_data;
@@ -149322,7 +149600,7 @@ index d2c3736..bf79426 100644
return 0;
}
-@@ -2537,7 +2537,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
+@@ -2538,7 +2538,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
(frontswap_map) ? "FS" : "");
mutex_unlock(&swapon_mutex);
@@ -151377,7 +151655,7 @@ index 1474cfd..961bc9f 100644
pr_warn("cannot create /proc/net/%s\n", PG_PROC_DIR);
return -ENODEV;
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
-index 215e613..893522a 100644
+index 482c371..b02a761 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -61,7 +61,7 @@ struct rtnl_link {
@@ -151415,7 +151693,7 @@ index 215e613..893522a 100644
}
EXPORT_SYMBOL_GPL(__rtnl_link_unregister);
-@@ -1235,7 +1238,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
+@@ -1237,7 +1240,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
(dev->ifalias &&
nla_put_string(skb, IFLA_IFALIAS, dev->ifalias)) ||
nla_put_u32(skb, IFLA_CARRIER_CHANGES,
@@ -151424,7 +151702,7 @@ index 215e613..893522a 100644
nla_put_u8(skb, IFLA_PROTO_DOWN, dev->proto_down))
goto nla_put_failure;
-@@ -3395,7 +3398,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
+@@ -3397,7 +3400,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
__rtnl_unlock();
rtnl = net->rtnl;
{
@@ -151486,7 +151764,7 @@ index 2696aef..dbd5807 100644
if (!err)
err = put_user(SCM_RIGHTS, &cm->cmsg_type);
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
-index 8616d11..8b30348 100644
+index 9835d9a..d49237a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -971,7 +971,8 @@ static void skb_headers_offset_update(struct sk_buff *skb, int off)
@@ -152090,10 +152368,10 @@ index 0212591..329a13a 100644
#endif
if (dflt != &ipv4_devconf_dflt)
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
-index 8a9246d..d4f958b 100644
+index 63566ec..82e85abc8 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
-@@ -1135,12 +1135,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
+@@ -1139,12 +1139,12 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
#ifdef CONFIG_IP_ROUTE_MULTIPATH
fib_sync_up(dev, RTNH_F_DEAD);
#endif
@@ -152108,7 +152386,7 @@ index 8a9246d..d4f958b 100644
if (!ifa->ifa_dev->ifa_list) {
/* Last address was deleted from this interface.
* Disable IP.
-@@ -1180,7 +1180,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
+@@ -1184,7 +1184,7 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo
#ifdef CONFIG_IP_ROUTE_MULTIPATH
fib_sync_up(dev, RTNH_F_DEAD);
#endif
@@ -152118,7 +152396,7 @@ index 8a9246d..d4f958b 100644
break;
case NETDEV_DOWN:
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
-index d97268e..6ee80d4 100644
+index 2b68418..fb7bee8 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -913,7 +913,7 @@ __be32 fib_info_update_nh_saddr(struct net *net, struct fib_nh *nh)
@@ -152274,7 +152552,7 @@ index 187c6fc..f4a802c 100644
return -ENOMEM;
}
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
-index 41ba68d..599331a 100644
+index d0c1e77..6ba345a 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -116,7 +116,7 @@ static bool log_ecn_error = true;
@@ -152286,7 +152564,7 @@ index 41ba68d..599331a 100644
static int ipgre_tunnel_init(struct net_device *dev);
static int ipgre_net_id __read_mostly;
-@@ -1189,7 +1189,7 @@ static const struct nla_policy ipgre_policy[IFLA_GRE_MAX + 1] = {
+@@ -1194,7 +1194,7 @@ static const struct nla_policy ipgre_policy[IFLA_GRE_MAX + 1] = {
[IFLA_GRE_COLLECT_METADATA] = { .type = NLA_FLAG },
};
@@ -152295,7 +152573,7 @@ index 41ba68d..599331a 100644
.kind = "gre",
.maxtype = IFLA_GRE_MAX,
.policy = ipgre_policy,
-@@ -1204,7 +1204,7 @@ static struct rtnl_link_ops ipgre_link_ops __read_mostly = {
+@@ -1209,7 +1209,7 @@ static struct rtnl_link_ops ipgre_link_ops __read_mostly = {
.get_link_net = ip_tunnel_get_link_net,
};
@@ -152984,7 +153262,7 @@ index 7113bae..0e9e9a6 100644
static int raw_seq_show(struct seq_file *seq, void *v)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
-index 02c6229..68cc2a6 100644
+index b050cf9..3b7fc47 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -232,7 +232,7 @@ static const struct seq_operations rt_cache_seq_ops = {
@@ -153041,7 +153319,7 @@ index 02c6229..68cc2a6 100644
}
EXPORT_SYMBOL(ip_idents_reserve);
-@@ -2755,34 +2755,34 @@ static struct ctl_table ipv4_route_flush_table[] = {
+@@ -2767,34 +2767,34 @@ static struct ctl_table ipv4_route_flush_table[] = {
.maxlen = sizeof(int),
.mode = 0200,
.proc_handler = ipv4_sysctl_rtcache_flush,
@@ -153084,7 +153362,7 @@ index 02c6229..68cc2a6 100644
err_dup:
return -ENOMEM;
}
-@@ -2805,8 +2805,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
+@@ -2817,8 +2817,8 @@ static __net_initdata struct pernet_operations sysctl_route_ops = {
static __net_init int rt_genid_init(struct net *net)
{
@@ -153095,7 +153373,7 @@ index 02c6229..68cc2a6 100644
get_random_bytes(&net->ipv4.dev_addr_genid,
sizeof(net->ipv4.dev_addr_genid));
return 0;
-@@ -2850,11 +2850,7 @@ int __init ip_rt_init(void)
+@@ -2862,11 +2862,7 @@ int __init ip_rt_init(void)
int rc = 0;
int cpu;
@@ -153393,7 +153671,7 @@ index a4730a2..1a92c3a 100644
syn_set ? 0 : icsk->icsk_user_timeout, syn_set)) {
/* Has it gone just too far? */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
-index eb8933b..21e9109 100644
+index 56218ff..99f35ce 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -87,6 +87,7 @@
@@ -153415,7 +153693,7 @@ index eb8933b..21e9109 100644
struct udp_table udp_table __read_mostly;
EXPORT_SYMBOL(udp_table);
-@@ -691,6 +696,9 @@ static inline bool __udp_is_mcast_sock(struct net *net, struct sock *sk,
+@@ -696,6 +701,9 @@ static inline bool __udp_is_mcast_sock(struct net *net, struct sock *sk,
return true;
}
@@ -153425,7 +153703,7 @@ index eb8933b..21e9109 100644
/*
* This routine is called by the ICMP module when it gets some
* sort of error condition. If err < 0 then the socket should
-@@ -1029,9 +1037,18 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
+@@ -1034,9 +1042,18 @@ int udp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
dport = usin->sin_port;
if (dport == 0)
return -EINVAL;
@@ -153444,7 +153722,7 @@ index eb8933b..21e9109 100644
daddr = inet->inet_daddr;
dport = inet->inet_dport;
/* Open fast path for connected socket.
-@@ -1288,7 +1305,7 @@ static unsigned int first_packet_length(struct sock *sk)
+@@ -1293,7 +1310,7 @@ static unsigned int first_packet_length(struct sock *sk)
IS_UDPLITE(sk));
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
IS_UDPLITE(sk));
@@ -153453,7 +153731,7 @@ index eb8933b..21e9109 100644
__skb_unlink(skb, rcvq);
__skb_queue_tail(&list_kill, skb);
}
-@@ -1369,6 +1386,10 @@ try_again:
+@@ -1374,6 +1391,10 @@ try_again:
if (!skb)
goto out;
@@ -153464,7 +153742,7 @@ index eb8933b..21e9109 100644
ulen = skb->len - sizeof(struct udphdr);
copied = len;
if (copied > ulen)
-@@ -1402,7 +1423,7 @@ try_again:
+@@ -1407,7 +1428,7 @@ try_again:
if (unlikely(err)) {
trace_kfree_skb(skb, udp_recvmsg);
if (!peeked) {
@@ -153473,7 +153751,7 @@ index eb8933b..21e9109 100644
UDP_INC_STATS_USER(sock_net(sk),
UDP_MIB_INERRORS, is_udplite);
}
-@@ -1704,7 +1725,7 @@ csum_error:
+@@ -1709,7 +1730,7 @@ csum_error:
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
drop:
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
@@ -153482,7 +153760,7 @@ index eb8933b..21e9109 100644
kfree_skb(skb);
return -1;
}
-@@ -1722,7 +1743,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
+@@ -1727,7 +1748,7 @@ static void flush_stack(struct sock **stack, unsigned int count,
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
if (!skb1) {
@@ -153491,7 +153769,7 @@ index eb8933b..21e9109 100644
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
IS_UDPLITE(sk));
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
-@@ -1928,6 +1949,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
+@@ -1933,6 +1954,9 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
goto csum_error;
UDP_INC_STATS_BH(net, UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE);
@@ -153501,7 +153779,7 @@ index eb8933b..21e9109 100644
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
/*
-@@ -2536,7 +2560,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
+@@ -2541,7 +2565,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)),
0, sock_i_ino(sp),
atomic_read(&sp->sk_refcnt), sp,
@@ -154367,10 +154645,10 @@ index fa59dd7..d9d9c9d 100644
return 0;
default:
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
-index 18f3498..74cbfc9 100644
+index e2ea311..6f07106 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
-@@ -630,12 +630,11 @@ static struct ctl_table ip6_frags_ctl_table[] = {
+@@ -628,12 +628,11 @@ static struct ctl_table ip6_frags_ctl_table[] = {
static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
{
@@ -154385,7 +154663,7 @@ index 18f3498..74cbfc9 100644
if (!table)
goto err_alloc;
-@@ -649,9 +648,10 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
+@@ -647,9 +646,10 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
/* Don't export sysctls to unprivileged users */
if (net->user_ns != &init_user_ns)
table[0].procname = NULL;
@@ -154398,7 +154676,7 @@ index 18f3498..74cbfc9 100644
if (!hdr)
goto err_reg;
-@@ -659,8 +659,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
+@@ -657,8 +657,7 @@ static int __net_init ip6_frags_ns_sysctl_register(struct net *net)
return 0;
err_reg:
@@ -154409,10 +154687,10 @@ index 18f3498..74cbfc9 100644
return -ENOMEM;
}
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
-index ed44663..fa4d1d9 100644
+index 18e29e2..3b8eab0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
-@@ -3523,7 +3523,7 @@ struct ctl_table ipv6_route_table_template[] = {
+@@ -3525,7 +3525,7 @@ struct ctl_table ipv6_route_table_template[] = {
struct ctl_table * __net_init ipv6_route_sysctl_init(struct net *net)
{
@@ -156206,7 +156484,7 @@ index 45da11a..ef3e5dc 100644
table = kmemdup(acct_sysctl_table, sizeof(acct_sysctl_table),
GFP_KERNEL);
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
-index f60b4fd..739155b 100644
+index 6b94f0b..bb0cc8b 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1581,7 +1581,7 @@ void *nf_ct_alloc_hashtable(unsigned int *sizep, int nulls)
@@ -156218,26 +156496,12 @@ index f60b4fd..739155b 100644
{
int i, bucket, rc;
unsigned int hashsize, old_size;
-@@ -1778,6 +1778,10 @@ void nf_conntrack_init_end(void)
- #define DYING_NULLS_VAL ((1<<30)+1)
- #define TEMPLATE_NULLS_VAL ((1<<30)+2)
-
-+#ifdef CONFIG_GRKERNSEC_HIDESYM
-+static atomic_unchecked_t conntrack_cache_id = ATOMIC_INIT(0);
-+#endif
-+
- int nf_conntrack_init_net(struct net *net)
- {
- int ret = -ENOMEM;
-@@ -1802,7 +1806,11 @@ int nf_conntrack_init_net(struct net *net)
- if (!net->ct.stat)
+@@ -1804,7 +1804,7 @@ int nf_conntrack_init_net(struct net *net)
goto err_pcpu_lists;
-+#ifdef CONFIG_GRKERNSEC_HIDESYM
-+ net->ct.slabname = kasprintf(GFP_KERNEL, "nf_conntrack_%08x", atomic_inc_return_unchecked(&conntrack_cache_id));
-+#else
- net->ct.slabname = kasprintf(GFP_KERNEL, "nf_conntrack_%p", net);
-+#endif
+ net->ct.slabname = kasprintf(GFP_KERNEL, "nf_conntrack_%llu",
+- (u64)atomic64_inc_return(&unique_id));
++ (u64)atomic64_inc_return_unchecked(&unique_id));
if (!net->ct.slabname)
goto err_slabname;
@@ -156974,7 +157238,7 @@ index ec76398..81d562c 100644
};
diff --git a/net/openvswitch/vport-netdev.c b/net/openvswitch/vport-netdev.c
-index 6a6adf3..055fe97 100644
+index 4e39723..50265d9 100644
--- a/net/openvswitch/vport-netdev.c
+++ b/net/openvswitch/vport-netdev.c
@@ -204,11 +204,16 @@ struct vport *ovs_netdev_get_vport(struct net_device *dev)
@@ -157019,7 +157283,7 @@ index 5eb7694..58d8f08 100644
static int __init ovs_vxlan_tnl_init(void)
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
-index da1ae0e1..3eb11c3 100644
+index 9cc7b51..3eb11c3 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -278,7 +278,7 @@ static int packet_direct_xmit(struct sk_buff *skb)
@@ -157074,15 +157338,7 @@ index da1ae0e1..3eb11c3 100644
spin_unlock(&sk->sk_receive_queue.lock);
drop_n_restore:
-@@ -3436,6 +3436,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq_max *mreq)
- i->ifindex = mreq->mr_ifindex;
- i->alen = mreq->mr_alen;
- memcpy(i->addr, mreq->mr_address, i->alen);
-+ memset(i->addr + i->alen, 0, sizeof(i->addr) - i->alen);
- i->count = 1;
- i->next = po->mclist;
- po->mclist = i;
-@@ -3765,7 +3766,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3766,7 +3766,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
case PACKET_HDRLEN:
if (len > sizeof(int))
len = sizeof(int);
@@ -157091,7 +157347,7 @@ index da1ae0e1..3eb11c3 100644
return -EFAULT;
switch (val) {
case TPACKET_V1:
-@@ -3800,9 +3801,9 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3801,9 +3801,9 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
case PACKET_ROLLOVER_STATS:
if (!po->rollover)
return -EINVAL;
@@ -157104,7 +157360,7 @@ index da1ae0e1..3eb11c3 100644
data = &rstats;
lv = sizeof(rstats);
break;
-@@ -3820,7 +3821,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
+@@ -3821,7 +3821,7 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
len = lv;
if (put_user(len, optlen))
return -EFAULT;
@@ -157649,10 +157905,10 @@ index d7a9ab5..3b6d126 100644
ret = kernel_sendmsg(conn->trans->local->socket, &msg, iov, 3, len);
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
-index 16bc83b..a7df216b 100644
+index aa47250..cbfe1bf 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
-@@ -349,7 +349,7 @@ void netif_carrier_on(struct net_device *dev)
+@@ -352,7 +352,7 @@ void netif_carrier_on(struct net_device *dev)
if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
if (dev->reg_state == NETREG_UNINITIALIZED)
return;
@@ -157661,7 +157917,7 @@ index 16bc83b..a7df216b 100644
linkwatch_fire_event(dev);
if (netif_running(dev))
__netdev_watchdog_up(dev);
-@@ -368,7 +368,7 @@ void netif_carrier_off(struct net_device *dev)
+@@ -371,7 +371,7 @@ void netif_carrier_off(struct net_device *dev)
if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) {
if (dev->reg_state == NETREG_UNINITIALIZED)
return;
@@ -157671,28 +157927,28 @@ index 16bc83b..a7df216b 100644
}
}
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c
-index a4afde1..030ed2c 100644
+index c2fbde7..fedcaf4 100644
--- a/net/sched/sch_tbf.c
+++ b/net/sched/sch_tbf.c
-@@ -160,7 +160,8 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
- struct tbf_sched_data *q = qdisc_priv(sch);
+@@ -161,7 +161,8 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
struct sk_buff *segs, *nskb;
netdev_features_t features = netif_skb_features(skb);
+ unsigned int len = 0, prev_len = qdisc_pkt_len(skb);
- int ret, nb;
+ int ret;
+ unsigned int nb;
segs = skb_gso_segment(skb, features & ~NETIF_F_GSO_MASK);
-@@ -182,8 +183,10 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
+@@ -184,8 +185,10 @@ static int tbf_segment(struct sk_buff *skb, struct Qdisc *sch)
segs = nskb;
}
sch->q.qlen += nb;
- if (nb > 1)
-- qdisc_tree_decrease_qlen(sch, 1 - nb);
+- qdisc_tree_reduce_backlog(sch, 1 - nb, prev_len - len);
+ if (nb > 1) {
+ nb--;
-+ qdisc_tree_decrease_qlen(sch, -nb);
++ qdisc_tree_reduce_backlog(sch, -nb, prev_len - len);
+ }
consume_skb(skb);
return nb > 0 ? NET_XMIT_SUCCESS : NET_XMIT_DROP;
@@ -185422,10 +185678,10 @@ index 0000000..4098952
+}
diff --git a/tools/gcc/size_overflow_plugin/size_overflow_hash.data b/tools/gcc/size_overflow_plugin/size_overflow_hash.data
new file mode 100644
-index 0000000..5364a49
+index 0000000..cbb8a80
--- /dev/null
+++ b/tools/gcc/size_overflow_plugin/size_overflow_hash.data
-@@ -0,0 +1,21644 @@
+@@ -0,0 +1,21645 @@
+enable_so_recv_ctrl_pipe_us_data_0 recv_ctrl_pipe us_data 0 0 NULL
+enable_so___earlyonly_bootmem_alloc_fndecl_3 __earlyonly_bootmem_alloc fndecl 2-3-4 3 NULL
+enable_so_v9fs_xattr_get_acl_fndecl_4 v9fs_xattr_get_acl fndecl 5 4 NULL
@@ -194031,6 +194287,7 @@ index 0000000..5364a49
+enable_so_mmc_test_area_map_fndecl_25839 mmc_test_area_map fndecl 2-4 25839 NULL
+enable_so_start_cxgb4_range_25845 start cxgb4_range 0 25845 NULL
+enable_so_ric_ies_len_cfg80211_ft_event_params_25853 ric_ies_len cfg80211_ft_event_params 0 25853 NULL
++enable_so_do_tune_cpucache_fndecl_25855 do_tune_cpucache fndecl 2-3-4 25855 NULL
+enable_so_table_size_drm_ati_pcigart_info_25856 table_size drm_ati_pcigart_info 0 25856 NULL
+enable_so_num_sg_lists_vardecl_25860 num_sg_lists vardecl 0 25860 NULL
+enable_so_asize_mypriv_25864 asize mypriv 0 25864 NULL
diff --git a/4.5.4/4425_grsec_remove_EI_PAX.patch b/4.5.5/4425_grsec_remove_EI_PAX.patch
index 2a1aa6c..2a1aa6c 100644
--- a/4.5.4/4425_grsec_remove_EI_PAX.patch
+++ b/4.5.5/4425_grsec_remove_EI_PAX.patch
diff --git a/4.5.4/4427_force_XATTR_PAX_tmpfs.patch b/4.5.5/4427_force_XATTR_PAX_tmpfs.patch
index aa2a091..aa2a091 100644
--- a/4.5.4/4427_force_XATTR_PAX_tmpfs.patch
+++ b/4.5.5/4427_force_XATTR_PAX_tmpfs.patch
diff --git a/4.5.4/4430_grsec-remove-localversion-grsec.patch b/4.5.5/4430_grsec-remove-localversion-grsec.patch
index 31cf878..31cf878 100644
--- a/4.5.4/4430_grsec-remove-localversion-grsec.patch
+++ b/4.5.5/4430_grsec-remove-localversion-grsec.patch
diff --git a/4.5.4/4435_grsec-mute-warnings.patch b/4.5.5/4435_grsec-mute-warnings.patch
index b7564e4..b7564e4 100644
--- a/4.5.4/4435_grsec-mute-warnings.patch
+++ b/4.5.5/4435_grsec-mute-warnings.patch
diff --git a/4.5.4/4440_grsec-remove-protected-paths.patch b/4.5.5/4440_grsec-remove-protected-paths.patch
index 741546d..741546d 100644
--- a/4.5.4/4440_grsec-remove-protected-paths.patch
+++ b/4.5.5/4440_grsec-remove-protected-paths.patch
diff --git a/4.5.4/4450_grsec-kconfig-default-gids.patch b/4.5.5/4450_grsec-kconfig-default-gids.patch
index 79a866b..79a866b 100644
--- a/4.5.4/4450_grsec-kconfig-default-gids.patch
+++ b/4.5.5/4450_grsec-kconfig-default-gids.patch
diff --git a/4.5.4/4465_selinux-avc_audit-log-curr_ip.patch b/4.5.5/4465_selinux-avc_audit-log-curr_ip.patch
index 7248385..7248385 100644
--- a/4.5.4/4465_selinux-avc_audit-log-curr_ip.patch
+++ b/4.5.5/4465_selinux-avc_audit-log-curr_ip.patch
diff --git a/4.5.4/4470_disable-compat_vdso.patch b/4.5.5/4470_disable-compat_vdso.patch
index 4aba080..4aba080 100644
--- a/4.5.4/4470_disable-compat_vdso.patch
+++ b/4.5.5/4470_disable-compat_vdso.patch
diff --git a/4.5.4/4475_emutramp_default_on.patch b/4.5.5/4475_emutramp_default_on.patch
index afd6019..afd6019 100644
--- a/4.5.4/4475_emutramp_default_on.patch
+++ b/4.5.5/4475_emutramp_default_on.patch