summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--0001-efi-prune-invalid-memory-map-entries.patch141
-rw-r--r--Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch15
-rw-r--r--arm64-mm-Fix-memmap-to-be-initialized-for-the-entire-section.patch93
-rw-r--r--bcm283x-vc4-fixes.patch43
-rw-r--r--kernel.spec18
-rw-r--r--sources2
6 files changed, 113 insertions, 199 deletions
diff --git a/0001-efi-prune-invalid-memory-map-entries.patch b/0001-efi-prune-invalid-memory-map-entries.patch
deleted file mode 100644
index 4b65ef504..000000000
--- a/0001-efi-prune-invalid-memory-map-entries.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-From c7c7030a020405d5826c03839e38986e0f78f2ea Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones@redhat.com>
-Date: Tue, 13 Dec 2016 10:25:10 +0000
-Subject: [PATCH] efi: prune invalid memory map entries
-
-Some machines, such as the Lenovo ThinkPad W541 with firmware GNET80WW
-(2.28), include memory map entries with phys_addr=0x0 and num_pages=0.
-
-Currently the log output for this case (with efi=debug) looks like:
-
-[ 0.000000] efi: mem45: [Reserved | | | | | | | | | | | | ] range=[0x0000000000000000-0xffffffffffffffff] (0MB)
-
-This is clearly wrong, and also not as informative as it could be. This
-patch changes it so that if we find obviously invalid memory map
-entries, we print an error and those entries. It also detects the
-display of the address range calculation overflow, so the new output is:
-
-[ 0.000000] efi: [Firmware Bug]: Invalid EFI memory map entries:
-[ 0.000000] efi: mem45: [Reserved | | | | | | | | | | | | ] range=[0x0000000000000000-0x0000000000000000] (invalid)
-
-It also detects memory map sizes that would overflow the physical
-address, for example phys_addr=0xfffffffffffff000 and
-num_pages=0x0200000000000001, and prints:
-
-[ 0.000000] efi: [Firmware Bug]: Invalid EFI memory map entries:
-[ 0.000000] efi: mem45: [Reserved | | | | | | | | | | | | ] range=[phys_addr=0xfffffffffffff000-0x20ffffffffffffffff] (invalid)
-
-It then removes these entries from the memory map.
-
-Cc: Matt Fleming <matt@codeblueprint.co.uk>
-Signed-off-by: Peter Jones <pjones@redhat.com>
-[ardb: refactor for clarity with no functional changes, avoid PAGE_SHIFT]
-Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
----
- arch/x86/platform/efi/efi.c | 70 +++++++++++++++++++++++++++++++++++++++++++++
- include/linux/efi.h | 1 +
- 2 files changed, 71 insertions(+)
-
-diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
-index bf99aa7..0a1550b 100644
---- a/arch/x86/platform/efi/efi.c
-+++ b/arch/x86/platform/efi/efi.c
-@@ -210,6 +210,74 @@ int __init efi_memblock_x86_reserve_range(void)
- return 0;
- }
-
-+#define OVERFLOW_ADDR_SHIFT (64 - EFI_PAGE_SHIFT)
-+#define OVERFLOW_ADDR_MASK (U64_MAX << OVERFLOW_ADDR_SHIFT)
-+#define U64_HIGH_BIT (~(U64_MAX >> 1))
-+
-+static bool __init efi_memmap_entry_valid(const efi_memory_desc_t *md, int i)
-+{
-+ static __initdata bool once = true;
-+ u64 end = (md->num_pages << EFI_PAGE_SHIFT) + md->phys_addr - 1;
-+ u64 end_hi = 0;
-+ char buf[64];
-+
-+ if (md->num_pages == 0) {
-+ end = 0;
-+ } else if (md->num_pages > EFI_PAGES_MAX ||
-+ EFI_PAGES_MAX - md->num_pages <
-+ (md->phys_addr >> EFI_PAGE_SHIFT)) {
-+ end_hi = (md->num_pages & OVERFLOW_ADDR_MASK)
-+ >> OVERFLOW_ADDR_SHIFT;
-+
-+ if ((md->phys_addr & U64_HIGH_BIT) && !(end & U64_HIGH_BIT))
-+ end_hi += 1;
-+ } else {
-+ return true;
-+ }
-+
-+ if (once) {
-+ pr_warn(FW_BUG "Invalid EFI memory map entries:\n");
-+ once = false;
-+ }
-+
-+ if (end_hi) {
-+ pr_warn("mem%02u: %s range=[0x%016llx-0x%llx%016llx] (invalid)\n",
-+ i, efi_md_typeattr_format(buf, sizeof(buf), md),
-+ md->phys_addr, end_hi, end);
-+ } else {
-+ pr_warn("mem%02u: %s range=[0x%016llx-0x%016llx] (invalid)\n",
-+ i, efi_md_typeattr_format(buf, sizeof(buf), md),
-+ md->phys_addr, end);
-+ }
-+ return false;
-+}
-+
-+static void __init efi_clean_memmap(void)
-+{
-+ efi_memory_desc_t *out = efi.memmap.map;
-+ const efi_memory_desc_t *in = out;
-+ const efi_memory_desc_t *end = efi.memmap.map_end;
-+ int i, n_removal;
-+
-+ for (i = n_removal = 0; in < end; i++) {
-+ if (efi_memmap_entry_valid(in, i)) {
-+ if (out != in)
-+ memcpy(out, in, efi.memmap.desc_size);
-+ out = (void *)out + efi.memmap.desc_size;
-+ } else {
-+ n_removal++;
-+ }
-+ in = (void *)in + efi.memmap.desc_size;
-+ }
-+
-+ if (n_removal > 0) {
-+ u64 size = efi.memmap.nr_map - n_removal;
-+
-+ pr_warn("Removing %d invalid memory map entries.\n", n_removal);
-+ efi_memmap_install(efi.memmap.phys_map, size);
-+ }
-+}
-+
- void __init efi_print_memmap(void)
- {
- efi_memory_desc_t *md;
-@@ -472,6 +540,8 @@ void __init efi_init(void)
- }
- }
-
-+ efi_clean_memmap();
-+
- if (efi_enabled(EFI_DBG))
- efi_print_memmap();
- }
-diff --git a/include/linux/efi.h b/include/linux/efi.h
-index 4c1b3ea..712a3aa 100644
---- a/include/linux/efi.h
-+++ b/include/linux/efi.h
-@@ -103,6 +103,7 @@ typedef struct {
-
- #define EFI_PAGE_SHIFT 12
- #define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT)
-+#define EFI_PAGES_MAX (U64_MAX >> EFI_PAGE_SHIFT)
-
- typedef struct {
- u32 type;
---
-2.9.3
-
diff --git a/Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch b/Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch
index 24f1d5b5d..48e88a767 100644
--- a/Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch
+++ b/Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch
@@ -1,4 +1,4 @@
-From 9f31204f829da97f99f7aacf30f0ddc26e456df7 Mon Sep 17 00:00:00 2001
+From 12e2c6926a6b03e070fc58271cf41a482de06467 Mon Sep 17 00:00:00 2001
From: Matthew Garrett <matthew.garrett@nebula.com>
Date: Fri, 9 Mar 2012 09:28:15 -0500
Subject: [PATCH 06/20] Restrict /dev/mem and /dev/kmem when module loading is
@@ -8,16 +8,17 @@ Allowing users to write to address space makes it possible for the kernel
to be subverted, avoiding module loading restrictions. Prevent this when
any restrictions have been imposed on loading modules.
+[labbott: Rebased again]
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
---
drivers/char/mem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
-index 7f1a7ab5850d..d6a6f05fbc1c 100644
+index 6d9cc2d39d22..bda271d022a0 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
-@@ -164,6 +164,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
+@@ -163,6 +163,9 @@ static ssize_t write_mem(struct file *file, const char __user *buf,
if (p != *ppos)
return -EFBIG;
@@ -27,9 +28,9 @@ index 7f1a7ab5850d..d6a6f05fbc1c 100644
if (!valid_phys_addr_range(p, count))
return -EFAULT;
-@@ -516,6 +519,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
- if (!pfn_valid(PFN_DOWN(p)))
- return -EIO;
+@@ -513,6 +516,9 @@ static ssize_t write_kmem(struct file *file, const char __user *buf,
+ char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */
+ int err = 0;
+ if (secure_modules())
+ return -EPERM;
@@ -38,5 +39,5 @@ index 7f1a7ab5850d..d6a6f05fbc1c 100644
unsigned long to_write = min_t(unsigned long, count,
(unsigned long)high_memory - p);
--
-2.9.3
+2.11.0
diff --git a/arm64-mm-Fix-memmap-to-be-initialized-for-the-entire-section.patch b/arm64-mm-Fix-memmap-to-be-initialized-for-the-entire-section.patch
new file mode 100644
index 000000000..eaf809d53
--- /dev/null
+++ b/arm64-mm-Fix-memmap-to-be-initialized-for-the-entire-section.patch
@@ -0,0 +1,93 @@
+From patchwork Thu Oct 6 09:52:07 2016
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: arm64: mm: Fix memmap to be initialized for the entire section
+From: Robert Richter <rrichter@cavium.com>
+X-Patchwork-Id: 9364537
+Message-Id: <1475747527-32387-1-git-send-email-rrichter@cavium.com>
+To: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon
+ <will.deacon@arm.com>
+Cc: Mark Rutland <mark.rutland@arm.com>, linux-efi@vger.kernel.org,
+ David Daney <david.daney@cavium.com>,
+ Ard Biesheuvel <ard.biesheuvel@linaro.org>,
+ linux-kernel@vger.kernel.org, Robert Richter <rrichter@cavium.com>,
+ Hanjun Guo <hanjun.guo@linaro.org>, linux-arm-kernel@lists.infradead.org
+Date: Thu, 6 Oct 2016 11:52:07 +0200
+
+There is a memory setup problem on ThunderX systems with certain
+memory configurations. The symptom is
+
+ kernel BUG at mm/page_alloc.c:1848!
+
+This happens for some configs with 64k page size enabled. The bug
+triggers for page zones with some pages in the zone not assigned to
+this particular zone. In my case some pages that are marked as nomap
+were not reassigned to the new zone of node 1, so those are still
+assigned to node 0.
+
+The reason for the mis-configuration is a change in pfn_valid() which
+reports pages marked nomap as invalid:
+
+ 68709f45385a arm64: only consider memblocks with NOMAP cleared for linear mapping
+
+This causes pages marked as nomap being no long reassigned to the new
+zone in memmap_init_zone() by calling __init_single_pfn().
+
+Fixing this by restoring the old behavior of pfn_valid() to use
+memblock_is_memory(). Also changing users of pfn_valid() in arm64 code
+to use memblock_is_map_memory() where necessary. This only affects
+code in ioremap.c. The code in mmu.c still can use the new version of
+pfn_valid().
+
+Should be marked stable v4.5..
+
+Signed-off-by: Robert Richter <rrichter@cavium.com>
+---
+ arch/arm64/mm/init.c | 2 +-
+ arch/arm64/mm/ioremap.c | 5 +++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
+index bbb7ee76e319..25b8659c2a9f 100644
+--- a/arch/arm64/mm/init.c
++++ b/arch/arm64/mm/init.c
+@@ -147,7 +147,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
+ #ifdef CONFIG_HAVE_ARCH_PFN_VALID
+ int pfn_valid(unsigned long pfn)
+ {
+- return memblock_is_map_memory(pfn << PAGE_SHIFT);
++ return memblock_is_memory(pfn << PAGE_SHIFT);
+ }
+ EXPORT_SYMBOL(pfn_valid);
+ #endif
+diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
+index 01e88c8bcab0..c17c220b0c48 100644
+--- a/arch/arm64/mm/ioremap.c
++++ b/arch/arm64/mm/ioremap.c
+@@ -21,6 +21,7 @@
+ */
+
+ #include <linux/export.h>
++#include <linux/memblock.h>
+ #include <linux/mm.h>
+ #include <linux/vmalloc.h>
+ #include <linux/io.h>
+@@ -55,7 +56,7 @@ static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
+ /*
+ * Don't allow RAM to be mapped.
+ */
+- if (WARN_ON(pfn_valid(__phys_to_pfn(phys_addr))))
++ if (WARN_ON(memblock_is_map_memory(phys_addr)))
+ return NULL;
+
+ area = get_vm_area_caller(size, VM_IOREMAP, caller);
+@@ -96,7 +97,7 @@ EXPORT_SYMBOL(__iounmap);
+ void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
+ {
+ /* For normal memory we already have a cacheable mapping. */
+- if (pfn_valid(__phys_to_pfn(phys_addr)))
++ if (memblock_is_map_memory(phys_addr))
+ return (void __iomem *)__phys_to_virt(phys_addr);
+
+ return __ioremap_caller(phys_addr, size, __pgprot(PROT_NORMAL),
diff --git a/bcm283x-vc4-fixes.patch b/bcm283x-vc4-fixes.patch
deleted file mode 100644
index d42ceb62a..000000000
--- a/bcm283x-vc4-fixes.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 30772942cc1095c3129eecfa182e2c568e566b9d Mon Sep 17 00:00:00 2001
-From: Dan Carpenter <dan.carpenter@oracle.com>
-Date: Thu, 13 Oct 2016 11:54:31 +0300
-Subject: [PATCH] drm/vc4: Fix a couple error codes in vc4_cl_lookup_bos()
-
-If the allocation fails the current code returns success. If
-copy_from_user() fails it returns the number of bytes remaining instead
-of -EFAULT.
-
-Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.")
-Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
-Reviewed-by: Eric Anholt <eric@anholt.net>
----
- drivers/gpu/drm/vc4/vc4_gem.c | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
-index ae1609e..4050540 100644
---- a/drivers/gpu/drm/vc4/vc4_gem.c
-+++ b/drivers/gpu/drm/vc4/vc4_gem.c
-@@ -548,14 +548,15 @@ vc4_cl_lookup_bos(struct drm_device *dev,
-
- handles = drm_malloc_ab(exec->bo_count, sizeof(uint32_t));
- if (!handles) {
-+ ret = -ENOMEM;
- DRM_ERROR("Failed to allocate incoming GEM handles\n");
- goto fail;
- }
-
-- ret = copy_from_user(handles,
-- (void __user *)(uintptr_t)args->bo_handles,
-- exec->bo_count * sizeof(uint32_t));
-- if (ret) {
-+ if (copy_from_user(handles,
-+ (void __user *)(uintptr_t)args->bo_handles,
-+ exec->bo_count * sizeof(uint32_t))) {
-+ ret = -EFAULT;
- DRM_ERROR("Failed to copy in GEM handles\n");
- goto fail;
- }
---
-2.9.3
-
diff --git a/kernel.spec b/kernel.spec
index a43e7d027..e47f6f4a4 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -59,7 +59,7 @@ Summary: The Linux kernel
# Do we have a -stable update to apply?
-%define stable_update 4
+%define stable_update 5
# Set rpm version accordingly
%if 0%{?stable_update}
%define stablerev %{stable_update}
@@ -540,8 +540,6 @@ Patch430: ARM-tegra-usb-no-reset.patch
Patch431: bcm2837-initial-support.patch
-Patch432: bcm283x-vc4-fixes.patch
-
Patch433: bcm283x-fixes.patch
# http://www.spinics.net/lists/linux-mmc/msg41151.html
@@ -643,9 +641,6 @@ Patch665: netfilter-x_tables-deal-with-bogus-nextoffset-values.patch
#ongoing complaint, full discussion delayed until ksummit/plumbers
Patch849: 0001-iio-Use-event-header-from-kernel-tree.patch
-# Work around thinkpad firmware memory layout issues and efi_mem_reserve()
-Patch850: 0001-efi-prune-invalid-memory-map-entries.patch
-
# Request from dwalsh
Patch851: selinux-namespace-fix.patch
@@ -2184,7 +2179,16 @@ fi
#
#
%changelog
-* Thu Jan 12 2017 Laura Abbott <labbott@fedoraproject.org> - 4.9.4-100
+* Fri Jan 20 2017 Laura Abbott <labbott@redhat.com> - 4.9.5-100
+- Linux v4.9.5
+
+* Tue Jan 17 2017 Laura Abbott <labbott@fedoraproject.org>
+- Fix kubernetes networking issue (rhbz 1414068)
+
+* Tue Jan 17 2017 Laura Abbott <labbott@fedoraproject.org> - 4.9.4-100
+- Add possible ATI fixes
+
+* Thu Jan 12 2017 Laura Abbott <labbott@fedoraproject.org>
- Linux v4.9.4 rebase
- Minor updates for Raspberry Pi 3 support (thanks pbrobinson)
diff --git a/sources b/sources
index a60ea42a6..d6f35536e 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (linux-4.9.tar.xz) = bf67ff812cc3cb7e5059e82cc5db0d9a7c5637f7ed9a42e4730c715bf7047c81ed3a571225f92a33ef0b6d65f35595bc32d773356646df2627da55e9bc7f1f1a
SHA512 (perf-man-4.9.tar.gz) = d23bb3da1eadd6623fddbf4696948de7675f3dcf57c711a7427dd7ae111394f58d8f42752938bbea7cd219f1e7f6f116fc67a1c74f769711063940a065f37b99
-SHA512 (patch-4.9.4.xz) = d6a81ef416068a92bfa5a6a6156cfc50e9c4c44ac6343c076551376f0ce5be486147abf7aa1eed48c3f10ef5d97d3880924c56b70ff4b92faae106d994a25e48
+SHA512 (patch-4.9.5.xz) = 1da3b136478103eeabcdc02fae60ba75f3ff0a07835e47a5fbf033761fcaab2400e85184083f883b3c652f031e6834533c63c9c2b46bbe09a81ed0baa1369765