From patchwork Mon Nov 4 21:44:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 11226565 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7117D112B for ; Mon, 4 Nov 2019 21:52:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FA7E21E6F for ; Mon, 4 Nov 2019 21:52:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904325; bh=Jrncc+KwxtewoaMxgGEJEbpoZW9yORUclvwsXtwbsCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=kVPLu32e1l1qiseoaYP+RLIjqYH0FOZn9ol3Yd/S2zmdbxlwfgfFRu48k+t+LRKVW ttOJE9eSg8xR2ZVX1fLtc+lgJNEs8Gqh0TPSpBPygmoms2/P/sHC6tqhmUuxIYoPCD KLxrP5KXv5VXV/ISZDboI1QQZnHhQBVrZe+Lm7uo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730651AbfKDVwB (ORCPT ); Mon, 4 Nov 2019 16:52:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:45106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730221AbfKDVv6 (ORCPT ); Mon, 4 Nov 2019 16:51:58 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7274E217F5; Mon, 4 Nov 2019 21:51:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904317; bh=Jrncc+KwxtewoaMxgGEJEbpoZW9yORUclvwsXtwbsCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtrHmv5rH+Qvtmpss/+vq13xCMfqdI1VbaZTWKuOeGy9Kfr6LskE7KZBUca2Jkbsx bs62wxVh1UdWKfzHOBe3gMVvXJknj/BHeKHEaRYAQ6Sjnqz6bkCIMXiEnBf/UcVbSJ +t1pMNIHxMOMwyO6CRs4s2Ikk/hB4u2uJhay7vD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Young , Ard Biesheuvel , Matthew Garrett , Ben Dooks , Jarkko Sakkinen , Jerry Snitselaar , Linus Torvalds , Lukas Wunner , Lyude Paul , Octavian Purdila , Peter Jones , Peter Zijlstra , Scott Talbert , Thomas Gleixner , linux-efi@vger.kernel.org, linux-integrity@vger.kernel.org, Ingo Molnar , Sasha Levin Subject: [PATCH 4.9 22/62] efi/x86: Do not clean dummy variable in kexec path Date: Mon, 4 Nov 2019 22:44:44 +0100 Message-Id: <20191104211921.821672744@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104211901.387893698@linuxfoundation.org> References: <20191104211901.387893698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org From: Dave Young [ Upstream commit 2ecb7402cfc7f22764e7bbc80790e66eadb20560 ] kexec reboot fails randomly in UEFI based KVM guest. The firmware just resets while calling efi_delete_dummy_variable(); Unfortunately I don't know how to debug the firmware, it is also possible a potential problem on real hardware as well although nobody reproduced it. The intention of the efi_delete_dummy_variable is to trigger garbage collection when entering virtual mode. But SetVirtualAddressMap can only run once for each physical reboot, thus kexec_enter_virtual_mode() is not necessarily a good place to clean a dummy object. Drop the efi_delete_dummy_variable so that kexec reboot can work. Signed-off-by: Dave Young Signed-off-by: Ard Biesheuvel Acked-by: Matthew Garrett Cc: Ben Dooks Cc: Jarkko Sakkinen Cc: Jerry Snitselaar Cc: Linus Torvalds Cc: Lukas Wunner Cc: Lyude Paul Cc: Octavian Purdila Cc: Peter Jones Cc: Peter Zijlstra Cc: Scott Talbert Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Cc: linux-integrity@vger.kernel.org Link: https://lkml.kernel.org/r/20191002165904.8819-8-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- arch/x86/platform/efi/efi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index a0e85f2aff7d8..b6669d326545a 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -896,9 +896,6 @@ static void __init kexec_enter_virtual_mode(void) if (efi_enabled(EFI_OLD_MEMMAP) && (__supported_pte_mask & _PAGE_NX)) runtime_code_page_mkexec(); - - /* clean DUMMY object */ - efi_delete_dummy_variable(); #endif }