lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMj1kXFKBynkfBFmQ1tbgZ0fTOP0pg5453NFGxVGvmePrKssug@mail.gmail.com>
Date: Fri, 28 Feb 2025 13:43:50 +0100
From: Ard Biesheuvel <ardb@...nel.org>
To: Sergey Senozhatsky <senozhatsky@...omium.org>
Cc: David Sterba <dsterba@...e.cz>, Herbert Xu <herbert@...dor.apana.org.au>, 
	Linux Crypto Mailing List <linux-crypto@...r.kernel.org>, 
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, Nitin Gupta <nitingupta910@...il.com>, 
	Richard Purdie <rpurdie@...nedhand.com>, Andrew Morton <akpm@...ux-foundation.org>, 
	Linus Torvalds <torvalds@...ux-foundation.org>, 
	"Markus F.X.J. Oberhumer" <markus@...rhumer.com>, Dave Rodgman <dave.rodgman@....com>
Subject: Re: [PATCH] lib/lzo: Avoid output overruns when compressing

On Fri, 28 Feb 2025 at 06:24, Sergey Senozhatsky
<senozhatsky@...omium.org> wrote:
>
> On (25/02/26 14:00), David Sterba wrote:
> > 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.
>
> David, just for educational purposes, there's only safe variant of lzo
> decompression, which seems to be doing a lot of NEED_OP (HAVE_OP) adding
> branches and so on, basically what Herbert is adding to the compression
> path.  So my question is - why NEED_OP (if (!HAVE_OP(x)) goto output_overrun)
> is a no go for compression, but appears to be fine for decompression?
>

Because compression has a bounded worst case (compressing data with
LZO can actually increase the size but only by a limited amount),
whereas decompressing a small input could produce gigabytes of output.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ