On Sun, Feb 23, 2025 at 02:55:24PM +0800, Herbert Xu wrote: > The compression code in LZO never checked for output overruns. > Fix this by checking for end of buffer before each write. Does it have to check for the overruns? The worst case compression result size is known and can be calculated by the formula. Using big enough buffer is part of the correct usage of LZO. All in-kernel users of lzo1x_1_compress() seem to provide the target buffer calculated by lzo1x_worst_compress(). F2FS, JFFS2, BTRFS. Not sure about ZRAM. What strikes me as alarming that you insert about 20 branches into a realtime compression algorithm, where everything is basically a hot path. Branches that almost never happen, and never if the output buffer is big enough. Please drop the patch.