+ decompressors-check-for-write-errors-in-decompress_unlzoc.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Decompressors: check for write errors in decompress_unlzo.c
has been added to the -mm tree.  Its filename is
     decompressors-check-for-write-errors-in-decompress_unlzoc.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: Decompressors: check for write errors in decompress_unlzo.c
From: Lasse Collin <lasse.collin@xxxxxxxxxxx>

The return value of flush() is not checked in unlzo().  This means that
the decompressor won't stop even if the caller doesn't want more data. 
This can happen e.g.  with a corrupt LZO-compressed initramfs image.

Signed-off-by: Lasse Collin <lasse.collin@xxxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Alain Knaff <alain@xxxxxxxx>
Cc: Albin Tonnerre <albin.tonnerre@xxxxxxxxxxxxxxxxxx>
Cc: Phillip Lougher <phillip@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/decompress_unlzo.c      |    4 ++--
 lib/decompress_unlzo.c.orig |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -puN lib/decompress_unlzo.c~decompressors-check-for-write-errors-in-decompress_unlzoc lib/decompress_unlzo.c
--- a/lib/decompress_unlzo.c~decompressors-check-for-write-errors-in-decompress_unlzoc
+++ a/lib/decompress_unlzo.c
@@ -187,8 +187,8 @@ STATIC inline int INIT unlzo(u8 *input, 
 			}
 		}
 
-		if (flush)
-			flush(out_buf, dst_len);
+		if (flush && flush(out_buf, dst_len) != dst_len)
+			goto exit_2;
 		if (output)
 			out_buf += dst_len;
 		if (posp)
diff -puN lib/decompress_unlzo.c.orig~decompressors-check-for-write-errors-in-decompress_unlzoc lib/decompress_unlzo.c.orig
--- a/lib/decompress_unlzo.c.orig~decompressors-check-for-write-errors-in-decompress_unlzoc
+++ a/lib/decompress_unlzo.c.orig
@@ -187,8 +187,8 @@ STATIC inline int INIT unlzo(u8 *input, 
 			}
 		}
 
-		if (flush && flush(out_buf, dst_len) != dst_len)
-			goto exit_2;
+		if (flush)
+			flush(out_buf, dst_len);
 		if (output)
 			out_buf += dst_len;
 		if (posp)
_

Patches currently in -mm which might be from lasse.collin@xxxxxxxxxxx are

decompressors-add-missing-init-ie-__init.patch
decompressors-get-rid-of-set_error_fn-macro.patch
decompressors-include-linux-slabh-in-linux-decompress-mmh.patch
decompressors-remove-unused-function-from-lib-decompress_unlzmac.patch
decompressors-check-for-write-errors-in-decompress_unlzoc.patch
decompressors-check-input-size-in-decompress_unlzoc.patch
decompressors-fix-callback-to-callback-mode-in-decompress_unlzoc.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux