From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f48.google.com ([74.125.82.48]:33585 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbcCJOGG (ORCPT ); Thu, 10 Mar 2016 09:06:06 -0500 Received: by mail-wm0-f48.google.com with SMTP id l68so30200760wml.0 for ; Thu, 10 Mar 2016 06:06:05 -0800 (PST) From: Matt Fleming To: stable@vger.kernel.org Cc: Ard Biesheuvel , Peter Jones , Matthew Garrett , joeyli , Matt Fleming , Laszlo Ersek Subject: [PATCH 6/7] efi: Add pstore variables to the deletion whitelist Date: Thu, 10 Mar 2016 14:05:50 +0000 Message-Id: <1457618751-11514-7-git-send-email-matt@codeblueprint.co.uk> In-Reply-To: <1457618751-11514-1-git-send-email-matt@codeblueprint.co.uk> References: <1457618751-11514-1-git-send-email-matt@codeblueprint.co.uk> Sender: stable-owner@vger.kernel.org List-ID: commit e246eb568bc4cbbdd8a30a3c11151ff9b7ca7312 upstream. Laszlo explains why this is a good idea, 'This is because the pstore filesystem can be backed by UEFI variables, and (for example) a crash might dump the last kilobytes of the dmesg into a number of pstore entries, each entry backed by a separate UEFI variable in the above GUID namespace, and with a variable name according to the above pattern. Please see "drivers/firmware/efi/efi-pstore.c". While this patch series will not prevent the user from deleting those UEFI variables via the pstore filesystem (i.e., deleting a pstore fs entry will continue to delete the backing UEFI variable), I think it would be nice to preserve the possibility for the sysadmin to delete Linux-created UEFI variables that carry portions of the crash log, *without* having to mount the pstore filesystem.' There's also no chance of causing machines to become bricked by deleting these variables, which is the whole purpose of excluding things from the whitelist. Use the LINUX_EFI_CRASH_GUID guid and a wildcard '*' for the match so that we don't have to update the string in the future if new variable name formats are created for crash dump variables. Reported-by: Laszlo Ersek Acked-by: Peter Jones Tested-by: Peter Jones Cc: Matthew Garrett Cc: "Lee, Chun-Yi" Signed-off-by: Matt Fleming --- drivers/firmware/efi/vars.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/efi/vars.c b/drivers/firmware/efi/vars.c index ab68e57172aa..4e2f46938bf0 100644 --- a/drivers/firmware/efi/vars.c +++ b/drivers/firmware/efi/vars.c @@ -198,6 +198,7 @@ static const struct variable_validate variable_validate[] = { { EFI_GLOBAL_VARIABLE_GUID, "OsIndications", NULL }, { EFI_GLOBAL_VARIABLE_GUID, "PlatformLang", validate_ascii_string }, { EFI_GLOBAL_VARIABLE_GUID, "Timeout", validate_uint16 }, + { LINUX_EFI_CRASH_GUID, "*", NULL }, { NULL_GUID, "", NULL }, }; -- 2.6.2