All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG" has been added to the 4.12-stable tree
@ 2017-07-22 13:32 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-22 13:32 UTC (permalink / raw)
  To: ankit, anton, gregkh, keescook, mahesh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG

to the 4.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pstore-don-t-warn-if-data-is-uncompressed-and-type-is-not-pstore_type_dmesg.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 4a16d1cb245c56e72fd40a28f3cdb394cde4b341 Mon Sep 17 00:00:00 2001
From: Ankit Kumar <ankit@linux.vnet.ibm.com>
Date: Tue, 23 May 2017 11:16:52 +0530
Subject: pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG

From: Ankit Kumar <ankit@linux.vnet.ibm.com>

commit 4a16d1cb245c56e72fd40a28f3cdb394cde4b341 upstream.

commit 9abdcccc3d5f ("pstore: Extract common arguments into structure")
moved record decompression to function. decompress_record() gets
called without checking type and compressed flag. Warning will be
reported if data is uncompressed. Pstore type PSTORE_TYPE_PPC_OPAL,
PSTORE_TYPE_PPC_COMMON doesn't contain compressed data and warning get
printed part of dmesg.

Partial dmesg log:
[   35.848914] pstore: ignored compressed record type 6
[   35.848927] pstore: ignored compressed record type 8

Above warning should not get printed as it is known that data won't be
compressed for above type and it is valid condition.

This patch returns if data is not compressed and print warning only if
data is compressed and type is not PSTORE_TYPE_DMESG.

Reported-by: Anton Blanchard <anton@au1.ibm.com>
Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Fixes: 9abdcccc3d5f ("pstore: Extract common arguments into structure")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/pstore/platform.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -770,8 +770,11 @@ static void decompress_record(struct pst
 	int unzipped_len;
 	char *decompressed;
 
+	if (!record->compressed)
+		return;
+
 	/* Only PSTORE_TYPE_DMESG support compression. */
-	if (!record->compressed || record->type != PSTORE_TYPE_DMESG) {
+	if (record->type != PSTORE_TYPE_DMESG) {
 		pr_warn("ignored compressed record type %d\n", record->type);
 		return;
 	}


Patches currently in stable-queue which might be from ankit@linux.vnet.ibm.com are

queue-4.12/pstore-don-t-warn-if-data-is-uncompressed-and-type-is-not-pstore_type_dmesg.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-22 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 13:32 Patch "pstore: Don't warn if data is uncompressed and type is not PSTORE_TYPE_DMESG" has been added to the 4.12-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.