Eric Biggers ebiggers@kernel.org:
Now that the lower level __crc32c_le() library function is optimized for
This patch (i. e. 38a9a5121c3b ("lib/crc32: make crc32c() go directly to lib")) solves actual bug I found in practice. So, please, backport it to stable kernels.
I did bisect.
It is possible to apply this patch on top of v6.12.48 without conflicts.
The bug actually prevents me for using my system (more details below).
Here is steps to reproduce bug I noticed.
Build kernel so:
$ cat /tmp/mini CONFIG_64BIT=y CONFIG_PRINTK=y CONFIG_SERIAL_8250=y CONFIG_TTY=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_BLK_DEV_INITRD=y CONFIG_RD_GZIP=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_SCRIPT=y CONFIG_PROC_FS=y CONFIG_SYSFS=y CONFIG_DEVTMPFS=y CONFIG_MODULES=y CONFIG_BTRFS_FS=m CONFIG_MODULE_COMPRESS=y CONFIG_MODULE_COMPRESS_XZ=y CONFIG_MODULE_COMPRESS_ALL=y CONFIG_MODULE_DECOMPRESS=y CONFIG_PRINTK_TIME=y $ make allnoconfig KCONFIG_ALLCONFIG=/tmp/mini $ make
Then create initramfs, which contains statically built busybox (I used busybox v1.37.0 (Debian 1:1.37.0-6+b3)) and modules we just created.
Then run Qemu using command line similar to this:
qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd i.gz -append 'console=ttyS0 panic=1 rdinit=/bin/busybox sh' -m 256 -no-reboot -enable-kvm -serial stdio -display none
Then in busybox shell type this:
# mkdir /proc # busybox mount -t proc proc /proc # modprobe btrfs
On buggy kernels I get this output:
# modprobe btrfs [ 19.614228] raid6: skipped pq benchmark and selected sse2x4 [ 19.614638] raid6: using intx1 recovery algorithm [ 19.616569] xor: measuring software checksum speed [ 19.616937] prefetch64-sse : 42616 MB/sec [ 19.617270] generic_sse : 41320 MB/sec [ 19.617531] xor: using function: prefetch64-sse (42616 MB/sec) [ 19.619731] Invalid ELF header magic: != ELF modprobe: can't load module libcrc32c (kernel/lib/libcrc32c.ko.xz): unknown symbol in module, or unknown parameter
The bug is reproducible on all kernels from v6.12 until this commit. And it is not reproducible on all kernels, which contain this commit. I found this using bisect.
This bug actually breaks my workflow. I have btrfs as root filesystem. Initramfs, generated by Debian, doesn't suit my needs. So I'm going to create my own initramfs from scratch. (Note that I use Debian Trixie, which has v6.12.48 kernel.) During testing this initramfs in Qemu I noticed that command "modprobe btrfs" fails with error given above. (I not yet tried to test this initramfs on real hardware.)
So, this bug actually breaks my workflow.
So, please backport this patch (i. e. 38a9a5121c3b ("lib/crc32: make crc32c() go directly to lib")) to stable kernels.
I tested that this patch can be applied without conflicts on top of v6.12.48, and this patch indeed fixes the bug for v6.12.48.
If you want, I can give more info.
It is possible that this is in fact bug in busybox, not in Linux. But still I think that backporting this patch is good idea.
This busybox thread my be related: https://lists.busybox.net/pipermail/busybox/2023-May/090309.html
On Sun, Oct 19, 2025 at 9:09 AM Askar Safin safinaskar@gmail.com wrote:
Eric Biggers ebiggers@kernel.org:
Now that the lower level __crc32c_le() library function is optimized for
This patch (i. e. 38a9a5121c3b ("lib/crc32: make crc32c() go directly to lib")) solves actual bug I found in practice. So, please, backport it to stable kernels.
Oops. I just noticed that this patch removes module "libcrc32c". And this breaks build for Debian kernel v6.12.48. Previously I tested minimal build using "make localmodconfig". Now I tried full build of Debian kernel using "dpkg-buildpackage". And it failed, because some of Debian files reference "libcrc32c", which is not available.
So, please, don't backport this patch to stable kernels. I'm sorry.
On Sun, Oct 19, 2025 at 11:10:25AM +0300, Askar Safin wrote:
On Sun, Oct 19, 2025 at 9:09 AM Askar Safin safinaskar@gmail.com wrote:
Eric Biggers ebiggers@kernel.org:
Now that the lower level __crc32c_le() library function is optimized for
This patch (i. e. 38a9a5121c3b ("lib/crc32: make crc32c() go directly to lib")) solves actual bug I found in practice. So, please, backport it to stable kernels.
Oops. I just noticed that this patch removes module "libcrc32c". And this breaks build for Debian kernel v6.12.48. Previously I tested minimal build using "make localmodconfig". Now I tried full build of Debian kernel using "dpkg-buildpackage". And it failed, because some of Debian files reference "libcrc32c", which is not available.
So, please, don't backport this patch to stable kernels. I'm sorry.
Right, this commit simplified the CRC library design by removing the libcrc32c module. initramfs build scripts that hard-coded the addition of libcrc32c.ko into the ramdisk (which I don't think was ever necessary in the first place, though it did used to be useful to hard-code some of the *other* CRC modules like crc32c-intel) had to be updated to remove it. It looks like Debian did indeed do that, and they updated it in https://salsa.debian.org/kernel-team/linux/-/commit/6c242c647f84bfdbdc22a6a7...
As for your original problem, I'd glad to see that the simplified design is preventing problems. There's an issue with backporting this commit alone, though. This was patch 15 of a 19-patch series for a good reason: the CRC-32C implementation in lib/ wasn't architecture-optimized until after patches 1-14 of this series. Backporting this commit alone would make crc32c() no longer utilize architecture-optimized code.
Now, it already didn't do so reliably (and this patch series fixed that). However, backporting this commit alone would make it never do so. So it would regress performance in some cases.
Since the errors you're actually getting are:
[ 19.619731] Invalid ELF header magic: != ELF modprobe: can't load module libcrc32c (kernel/lib/libcrc32c.ko.xz): unknown symbol in module, or unknown parameter
I do have to wonder if this is actually a busybox bug or misconfiguration, where it's passing a compressed module to the kernel without decompressing it? And removing the module just hid the problem.
- Eric
linux-stable-mirror@lists.linaro.org