From: Eric Biggers <ebiggers@kernel.org>
To: Michal Wilczynski <m.wilczynski@samsung.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Russell King <linux@armlinux.org.uk>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
Helge Deller <deller@gmx.de>, Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Minchan Kim <minchan@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org,
linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org,
linux-block@vger.kernel.org,
Yann Collet <yann.collet.73@gmail.com>,
Nick Terrell <terrelln@meta.com>, Gao Xiang <xiang@kernel.org>,
Chao Yu <chao@kernel.org>, Jaegeuk Kim <jaegeuk@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
Phillip Lougher <phillip@squashfs.org.uk>,
Sungguk <sungguk.na@samsung.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
linux-erofs@lists.ozlabs.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH RFC 0/9] lib/lz4: stop forking upstream LZ4, vendor it instead
Date: Fri, 25 Sep 2026 15:07:37 -0700 [thread overview]
Message-ID: <20260925220737.GB1903@quark> (raw)
In-Reply-To: <20260925-lz4-vendor-upstream-v1-0-1c7ffbe21c4b@samsung.com>
On Fri, Sep 25, 2026 at 01:27:30PM +0200, Michal Wilczynski wrote:
> The in-kernel LZ4 is a fork. The decompressor was last synced with
> upstream v1.8.3 in 2018 and the compressor with v1.7.3 in 2017, both by
> hand. Upstream has made 488 commits against lib/ since, and the gap is
> maintained one cherry-pick at a time.
>
> That has left real bugs in place for example the forked
> LZ4_decompress_fast() has no bounds checks, so corrupted input runs off
> the output buffer in both directions.
>
> This series vendors the upstream sources unmodified and adapts them at
> build time, so a re-sync becomes a directory copy:
At a high level, this looks good to me, and it's similar to what was
done with zstd. I don't see any obvious issues with the integration.
There are disadvantages to directly integrating external projects like
this, vs. writing a small implementation from scratch for the kernel.
But the existing LZ4 code in the kernel isn't that, but rather a fork
from upstream anyway, and it's clearly not being maintained properly.
The upstream LZ4 codebase also already avoids many of the typical
incompatibilities with Linux kernel code that are often seen in
userspace projects (such as assuming FPU/SIMD/vector instructions can be
used at any time, or that the stack size is infinite, or that the C
standard library is available, or that it's reasonable to have hundreds
of files or 100MB of test data, etc.).
And writing properly optimized compression/decompression code is quite
difficult. So yes, syncing with the latest LZ4 upstream seems like the
right choice for the kernel.
- Eric
prev parent reply other threads:[~2026-09-25 22:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260925113450eucas1p2fcf838f00f35e1bce0ca04a694cd0cd2@eucas1p2.samsung.com>
2026-09-25 11:27 ` Michal Wilczynski
[not found] ` <CGME20260925113452eucas1p170bfdb34dfbf670a14a6f8f0c2f5094a@eucas1p1.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 1/9] lib/lz4: import upstream LZ4 sources verbatim Michal Wilczynski
[not found] ` <CGME20260925113454eucas1p1ffe6b62a29086943a60137ed7e1f42ef@eucas1p1.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 2/9] lib/lz4: backport upstream's -Wmissing-prototypes fix Michal Wilczynski
[not found] ` <CGME20260925113456eucas1p136c3cd1f08be7201ad6b3f7b0e8ff02d@eucas1p1.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 3/9] lib/lz4: add the build environment for the vendored sources Michal Wilczynski
[not found] ` <CGME20260925113458eucas1p1fa17760e9d790d3108643ab7f54bc6a3@eucas1p1.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 4/9] arch: boot: put the LZ4 freestanding headers on the decompressor path Michal Wilczynski
[not found] ` <CGME20260925113500eucas1p1b8c2b9936e936f393b295efb2ac61c51@eucas1p1.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 5/9] lib/lz4: switch the compressor to the vendored sources Michal Wilczynski
[not found] ` <CGME20260925113503eucas1p277003fa5f157d48d4ca114c65952efc1@eucas1p2.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 6/9] lib/lz4: switch the HC " Michal Wilczynski
[not found] ` <CGME20260925113504eucas1p25e50de59c02681fc1385220be8acd184@eucas1p2.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 7/9] lib/lz4: switch the decompressor " Michal Wilczynski
[not found] ` <CGME20260925113505eucas1p22390762781266971ebfa0279f09ef838@eucas1p2.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 8/9] lib/lz4: fold lz4_kernel_api.h into <linux/lz4.h> Michal Wilczynski
[not found] ` <CGME20260925113507eucas1p2ddb94f2077b679426aa86dd1d492eaf3@eucas1p2.samsung.com>
2026-09-25 11:27 ` [PATCH RFC 9/9] MAINTAINERS: add an entry for the LZ4 compression library Michal Wilczynski
2026-09-25 21:39 ` Eric Biggers
2026-09-25 22:07 ` Eric Biggers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260925220737.GB1903@quark \
--to=ebiggers@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=agordeev@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=borntraeger@linux.ibm.com \
--cc=bp@alien8.de \
--cc=chao@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=deller@gmx.de \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=herbert@gondor.apana.org.au \
--cc=hpa@zytor.com \
--cc=jaegeuk@kernel.org \
--cc=jh80.chung@samsung.com \
--cc=justinstitt@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=llvm@lists.linux.dev \
--cc=m.szyprowski@samsung.com \
--cc=m.wilczynski@samsung.com \
--cc=minchan@kernel.org \
--cc=mingo@redhat.com \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=phillip@squashfs.org.uk \
--cc=senozhatsky@chromium.org \
--cc=sungguk.na@samsung.com \
--cc=svens@linux.ibm.com \
--cc=terrelln@meta.com \
--cc=tglx@kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=x86@kernel.org \
--cc=xiang@kernel.org \
--cc=yann.collet.73@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®