From 0a1037374a2b6eb6ba43b40e0cc4855e2f17a40b Mon Sep 17 00:00:00 2001
From: "Lee, Chun-Yi" <jlee@suse.com>
Date: Sat, 30 Jul 2016 09:54:35 +0800
Subject: [PATCH] x86: Removed the free memblock of hibernat keys to avoid
memory corruption
Patch-mainline: Not yet, will send to upstream
References: bsc#990058
The memblock_free code in init_hibernation_keys() causes memory corruption.
The init_hibernation_keys in late_initcall stage is too late to call
memblock_free because the memblock reserved regions arrary is already freed
to buddy system.
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
arch/x86/power/hibernate_keys.c | 1 -
1 file changed, 1 deletion(-)
--- a/arch/x86/power/hibernate_keys.c
+++ b/arch/x86/power/hibernate_keys.c
@@ -162,7 +162,6 @@ static int __init init_hibernation_keys(
/* Erase keys data no matter copy success or failed */
memset(keys, 0, sizeof(struct hibernation_keys));
early_iounmap(keys, sizeof(struct hibernation_keys));
- memblock_free(keys_phys_addr, sizeof(struct hibernation_keys));
keys_phys_addr = 0;
set_hibernation_key_regen_flag = false;