pstore/ram: Should zap persistent zone on unlink
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Sat, 26 May 2012 13:07:52 +0000 (06:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Jun 2012 23:52:40 +0000 (16:52 -0700)
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>
fs/pstore/ram.c

index 16ff7332eae0a99db545598fcbdf4443e4fa9cfa..453030f9c5bc2a68523cafc26c6d331d86855949 100644 (file)
@@ -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;
 }