All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] lz4 overflow bug
@ 2015-04-15 20:51 Toomas Soome
  2015-04-16  4:20 ` Andrei Borzenkov
  0 siblings, 1 reply; 4+ messages in thread
From: Toomas Soome @ 2015-04-15 20:51 UTC (permalink / raw)
  To: The development of GNU GRUB


hi!

yep, this old bug is not fixed in grub. cpy can (theoretically?) overflow.

---
 grub-core/fs/zfs/zfs_lz4.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c
index 1212a89..ca6445d 100644
--- a/grub-core/fs/zfs/zfs_lz4.c
+++ b/grub-core/fs/zfs/zfs_lz4.c
@@ -185,6 +185,8 @@ LZ4_uncompress_unknownOutputSize(const char *source,
 		}
 		/* copy literals */
 		cpy = op + length;
+		if (cpy < op)
+			goto _output_error;
 		if ((cpy > oend - COPYLENGTH) ||
 		    (ip + length > iend - COPYLENGTH)) {
 			if (cpy > oend)
-- 
1.7.9.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-16 13:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 20:51 [PATCH 2/2] lz4 overflow bug Toomas Soome
2015-04-16  4:20 ` Andrei Borzenkov
2015-04-16  4:51   ` Toomas Soome
2015-04-16  5:07     ` Andrei Borzenkov

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.