pstore: Fix flags to enable dumps on powerpc
authorAnkit Kumar <ankit@linux.vnet.ibm.com>
Thu, 27 Apr 2017 11:33:13 +0000 (17:03 +0530)
committerKees Cook <keescook@chromium.org>
Thu, 27 Apr 2017 21:49:05 +0000 (14:49 -0700)
After commit c950fd6f201a kernel registers pstore write based on flag set.
Pstore write for powerpc is broken as flags(PSTORE_FLAGS_DMESG) is not set for
powerpc architecture. On panic, kernel doesn't write message to
/fs/pstore/dmesg*(Entry doesn't gets created at all).

This patch enables pstore write for powerpc architecture by setting
PSTORE_FLAGS_DMESG flag.

Fixes: c950fd6f201a ("pstore: Split pstore fragile flags")
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
arch/powerpc/kernel/nvram_64.c

index caf2e1f36d6b1b3310a9fa48a96ae482d4f555d4..eae61b044e9e3510657a4777d59c4dc0bbd06267 100644 (file)
@@ -547,6 +547,7 @@ static ssize_t nvram_pstore_read(struct pstore_record *record)
 static struct pstore_info nvram_pstore_info = {
        .owner = THIS_MODULE,
        .name = "nvram",
+       .flags = PSTORE_FLAGS_DMESG,
        .open = nvram_pstore_open,
        .read = nvram_pstore_read,
        .write = nvram_pstore_write,