From: Anton Vorontsov <anton.vorontsov@linaro.org>
Date: Sat, 26 May 2012 13:07:52 +0000 (-0700)
Subject: pstore/ram: Should zap persistent zone on unlink
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=93cce049682a1aebd49766f29af363e5b8770aed;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

pstore/ram: Should zap persistent zone on unlink

Otherwise, unlinked file will reappear on the next boot.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 16ff7332eae0..453030f9c5bc 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -186,6 +186,7 @@ static int ramoops_pstore_erase(enum pstore_type_id type, u64 id,
 		return -EINVAL;
 
 	persistent_ram_free_old(cxt->przs[id]);
+	persistent_ram_zap(cxt->przs[id]);
 
 	return 0;
 }