lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180625031656.12443-1-bhe@redhat.com>
Date:   Mon, 25 Jun 2018 11:16:54 +0800
From:   Baoquan He <bhe@...hat.com>
To:     linux-kernel@...r.kernel.org, mingo@...nel.org,
        lcapitulino@...hat.com, keescook@...omium.org, tglx@...utronix.de
Cc:     x86@...nel.org, hpa@...or.com, fanc.fnst@...fujitsu.com,
        yasu.isimatu@...il.com, indou.takao@...fujitsu.com,
        douly.fnst@...fujitsu.com, Baoquan He <bhe@...hat.com>
Subject: [PATCH v2 0/2] x86/boot/KASLR: Skip specified number of 1GB huge pages when do physical randomization

This is a regression bug fix. Luiz's team reported that 1GB huge page
allocation will get one less 1GB page randomly when KASLR is enabled. On
their KVM guest with 4GB RAM, which only has one good 1GB huge page,
they found the 1GB huge page allocation sometime failed with below
kernel option adding.

  default_hugepagesz=1G hugepagesz=1G hugepages=1

This is because kernel may be randomized into those good 1GB huge pages.

And also on those bare-metal machines with larger memory, one less 1GB huge
page might be seen with KASLR enabled than 'nokaslr' specified case. It's
also because that kernel might be randomized into one of those good 1GB huge
pages.

The solution in this patchset is to skip specified number of GB huge
pages when do kernel physical randomization. If the specified number of GB
huge pages is bigger than amount of good GB huge pages which system can
provide, it's consistent with the current huge page implementation.

v1->v2:
  There are several code style problems and typos which were pointed out
  by Ingo, fix them in this patchset.

Baoquan He (2):
  x86/boot/KASLR: Add two functions for 1GB huge pages handling
  x86/boot/KASLR: Skip specified number of 1GB huge pages when do
    physical randomization

 arch/x86/boot/compressed/kaslr.c | 96 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 91 insertions(+), 5 deletions(-)

-- 
2.13.6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ