]> www.infradead.org Git - users/jedix/linux-maple.git/commit
crypto: lzo - Fix compression buffer overrun
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Feb 2025 09:04:46 +0000 (17:04 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 8 Mar 2025 08:23:22 +0000 (16:23 +0800)
commitcc47f07234f72cbd8e2c973cdbf2a6730660a463
treecb0afbdb1c7f618fd9a5bc8dff3520c03aad8406
parentef2a68f815daa7ff67781ee31e67802069634ed6
crypto: lzo - Fix compression buffer overrun

Unlike the decompression code, the compression code in LZO never
checked for output overruns.  It instead assumes that the caller
always provides enough buffer space, disregarding the buffer length
provided by the caller.

Add a safe compression interface that checks for the end of buffer
before each write.  Use the safe interface in crypto/lzo.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/lzo-rle.c
crypto/lzo.c
include/linux/lzo.h
lib/lzo/Makefile
lib/lzo/lzo1x_compress.c
lib/lzo/lzo1x_compress_safe.c [new file with mode: 0644]