From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932190AbdJ0TKx (ORCPT ); Fri, 27 Oct 2017 15:10:53 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:45089 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbdJ0TKv (ORCPT ); Fri, 27 Oct 2017 15:10:51 -0400 X-Google-Smtp-Source: ABhQp+RPwsEAMIonJq42Kmt4XLZmGipFAXGm1a2GkYDwKc3F9onXHxL79HbJCzOfbm4C1MiWWh2FtA== Date: Fri, 27 Oct 2017 21:10:47 +0200 From: Ingo Molnar To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , Andrew Morton , Matt Fleming , Ard Biesheuvel , linux-efi@vger.kernel.org Subject: [GIT PULL] EFI fixes Message-ID: <20171027191047.v6hqm7plm5uxf6xd@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus, Please pull the latest efi-urgent-for-linus git tree from: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git efi-urgent-for-linus # HEAD: 38fb6652229c2149e8694d57db442878fdf8a1bd efi/libstub/arm: Don't randomize runtime regions when CONFIG_HIBERNATION=y Two fixes: an ARM fix for KASLR interaction with hibernation, plus an efi_test crash fix. Thanks, Ingo ------------------> Ard Biesheuvel (1): efi/libstub/arm: Don't randomize runtime regions when CONFIG_HIBERNATION=y Dan Carpenter (1): efi/efi_test: Prevent an Oops in efi_runtime_query_capsulecaps() drivers/firmware/efi/libstub/arm-stub.c | 3 ++- drivers/firmware/efi/test/efi_test.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 1cb2d1c070c3..a94601d5939e 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -238,7 +238,8 @@ unsigned long efi_entry(void *handle, efi_system_table_t *sys_table, efi_random_get_seed(sys_table); - if (!nokaslr()) { + /* hibernation expects the runtime regions to stay in the same place */ + if (!IS_ENABLED(CONFIG_HIBERNATION) && !nokaslr()) { /* * Randomize the base of the UEFI runtime services region. * Preserve the 2 MB alignment of the region by taking a diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c index 08129b7b80ab..41c48a1e8baa 100644 --- a/drivers/firmware/efi/test/efi_test.c +++ b/drivers/firmware/efi/test/efi_test.c @@ -593,6 +593,9 @@ static long efi_runtime_query_capsulecaps(unsigned long arg) if (copy_from_user(&qcaps, qcaps_user, sizeof(qcaps))) return -EFAULT; + if (qcaps.capsule_count == ULONG_MAX) + return -EINVAL; + capsules = kcalloc(qcaps.capsule_count + 1, sizeof(efi_capsule_header_t), GFP_KERNEL); if (!capsules)