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: <20190214104240.24428-1-jgross@suse.com>
Date:   Thu, 14 Feb 2019 11:42:38 +0100
From:   Juergen Gross <jgross@...e.com>
To:     linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
        x86@...nel.org, linux-mm@...ck.org
Cc:     boris.ostrovsky@...cle.com, sstabellini@...nel.org, hpa@...or.com,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        Juergen Gross <jgross@...e.com>
Subject: [PATCH v3 0/2] x86: respect memory size limits

On a customer system running Xen a boot problem was observed due to
the kernel not respecting the memory size limit imposed by the Xen
hypervisor.

During analysis I found the same problem should be able to occur on
bare metal in case the memory would be limited via the "mem=" boot
parameter.

The system this problem has been observed on has tons of memory
added via PCI. So while in the E820 map the not to be used memory has
been wiped out the additional PCI memory is detected during ACPI scan
and it is added via __add_memory().

This small series tries to repair the issue by testing the imposed
memory limit during the memory hotplug process and refusing to add it
in case the limit is being violated.

I've chosen to refuse adding the complete memory chunk in case the
limit is reached instead of adding only some of the memory, as I
thought this would result in less problems (e.g. avoiding to add
only parts of a 128MB memory bar which might be difficult to remove
later).

Changes in V3:
- patch 2: remember possible max_mem_size value from kernel parameters
- patch 2: set allowed size to end of local E820 map's RAM

Changes in V2:
- patch 1: set initial allowed size to U64_MAX instead -1
- patch 2: set initial allowed size to end of E820 RAM

Juergen Gross (2):
  x86: respect memory size limiting via mem= parameter
  x86/xen: dont add memory above max allowed allocation

 arch/x86/kernel/e820.c         |  5 +++++
 arch/x86/xen/setup.c           | 13 +++++++++++++
 drivers/xen/xen-balloon.c      | 11 +++++++++++
 include/linux/memory_hotplug.h |  2 ++
 include/xen/xen.h              |  4 ++++
 mm/memory_hotplug.c            |  6 ++++++
 6 files changed, 41 insertions(+)

-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ