A 5-level paging capable machine can have memory above 46-bit in the
physical address space. This memory is only addressable in the 5-level
paging mode: we don't have enough virtual address space to create direct
mapping for such memory in the 4-level paging mode.
Currently, we fail boot completely: NULL pointer dereference in
subsection_map_init().
Skip creating a memblock for such memory instead and notify user that
some memory is not addressable.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov(a)linux.intel.com>
Reviewed-by: Dave Hansen <dave.hansen(a)intel.com>
Cc: stable(a)vger.kernel.org # v4.14
---
Tested with a hacked QEMU: https://gist.github.com/kiryl/d45eb54110944ff95e544972d8bdac1d
---
arch/x86/kernel/e820.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index c5399e80c59c..d320d37d0f95 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1280,8 +1280,8 @@ void __init e820__memory_setup(void)
void __init e820__memblock_setup(void)
{
+ u64 size, end, not_addressable = 0;
int i;
- u64 end;
/*
* The bootstrap memblock region count maximum is 128 entries
@@ -1307,7 +1307,22 @@ void __init e820__memblock_setup(void)
if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN)
continue;
- memblock_add(entry->addr, entry->size);
+ if (entry->addr >= MAXMEM) {
+ not_addressable += entry->size;
+ continue;
+ }
+
+ end = min_t(u64, end, MAXMEM - 1);
+ size = end - entry->addr;
+ not_addressable += entry->size - size;
+ memblock_add(entry->addr, size);
+ }
+
+ if (not_addressable) {
+ pr_err("%lldGB of physical memory is not addressable in the paging mode\n",
+ not_addressable >> 30);
+ if (!pgtable_l5_enabled())
+ pr_err("Consider enabling 5-level paging\n");
}
/* Throw away partial pages: */
--
2.26.2
******************************************
* WARNING: Boot tests are now deprecated *
******************************************
As kernelci.org is expanding its functional testing capabilities, the concept
of boot testing is now deprecated. Boot results are scheduled to be dropped on
*5th June 2020*. The full schedule for boot tests deprecation is available on
this GitHub issue: https://github.com/kernelci/kernelci-backend/issues/238
The new equivalent is the *baseline* test suite which also runs sanity checks
using dmesg and bootrr: https://github.com/kernelci/bootrr
See the *baseline results for this kernel revision* on this page:
https://kernelci.org/test/job/stable/branch/linux-4.14.y/kernel/v4.14.183/p…
-------------------------------------------------------------------------------
stable/linux-4.14.y boot: 51 boots: 3 failed, 46 passed with 2 untried/unknown (v4.14.183)
Full Boot Summary: https://kernelci.org/boot/all/job/stable/branch/linux-4.14.y/kernel/v4.14.1…
Full Build Summary: https://kernelci.org/build/stable/branch/linux-4.14.y/kernel/v4.14.183/
Tree: stable
Branch: linux-4.14.y
Git Describe: v4.14.183
Git Commit: c6db52a88798e5a0dfef80041ad4d33cc8cf04eb
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Tested: 43 unique boards, 12 SoC families, 12 builds out of 161
Boot Regressions Detected:
arm:
sama5_defconfig:
gcc-8:
at91-sama5d4_xplained:
lab-baylibre: failing since 131 days (last pass: v4.14.166 - first fail: v4.14.167)
Boot Failures Detected:
arm:
sama5_defconfig:
gcc-8:
at91-sama5d4_xplained: 1 failed lab
arm64:
defconfig:
gcc-8:
meson-gxbb-p200: 1 failed lab
meson-gxm-q200: 1 failed lab
---
For more info write to <info(a)kernelci.org>
******************************************
* WARNING: Boot tests are now deprecated *
******************************************
As kernelci.org is expanding its functional testing capabilities, the concept
of boot testing is now deprecated. Boot results are scheduled to be dropped on
*5th June 2020*. The full schedule for boot tests deprecation is available on
this GitHub issue: https://github.com/kernelci/kernelci-backend/issues/238
The new equivalent is the *baseline* test suite which also runs sanity checks
using dmesg and bootrr: https://github.com/kernelci/bootrr
See the *baseline results for this kernel revision* on this page:
https://kernelci.org/test/job/stable/branch/linux-4.4.y/kernel/v4.4.226/pla…
-------------------------------------------------------------------------------
stable/linux-4.4.y boot: 57 boots: 4 failed, 49 passed with 4 untried/unknown (v4.4.226)
Full Boot Summary: https://kernelci.org/boot/all/job/stable/branch/linux-4.4.y/kernel/v4.4.226/
Full Build Summary: https://kernelci.org/build/stable/branch/linux-4.4.y/kernel/v4.4.226/
Tree: stable
Branch: linux-4.4.y
Git Describe: v4.4.226
Git Commit: 95a3867e897abd7811196123f81a119a75aba863
Git URL: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
Tested: 30 unique boards, 11 SoC families, 13 builds out of 154
Boot Failures Detected:
arm:
mxs_defconfig:
gcc-8:
imx28-duckbill: 1 failed lab
imx_v4_v5_defconfig:
gcc-8:
imx27-phytec-phycard-s-rdk: 1 failed lab
multi_v5_defconfig:
gcc-8:
imx27-phytec-phycard-s-rdk: 1 failed lab
sama5_defconfig:
gcc-8:
at91-sama5d4_xplained: 1 failed lab
---
For more info write to <info(a)kernelci.org>
Hello,
Lack of proper validation that cached inodes are free during allocation can,
cause a crash in fs/xfs/xfs_icache.c (refer: CVE-2018-13093). To address this
issue, I'm backporting upstream commit [1] to 4.4 and 4.9 stable trees
(a backport of [1] to 4.14 already exists).
Also, commit [1] references another commit [2] which added checks only to
xfs_iget_cache_miss(). In this patch, those checks have been moved into a
dedicated checker method and both xfs_iget_cache_miss() and
xfs_iget_cache_hit() are made to call that method. This code reorg in commit
[1], makes commit [2] redundant in the history of the 4.9 and 4.4 stable
trees. So commit [2] is not being backported.
-- Sid
[1]: afca6c5b2595 ("xfs: validate cached inodes are free when allocated")
[2]: ee457001ed6c ("xfs: catch inode allocation state mismatch corruption")
change log:
v2:
- Reword cover letter.
- Fix accidental worong patch that got mailed.
--
2.7.4