From 058ea22fba957ee150b15e29d2340c7d1438dfea Mon Sep 17 00:00:00 2001 From: Linux_zhang Date: Mon, 7 Jul 2025 14:46:20 +0800 Subject: [PATCH] revert libblkid ext add checksum support (cherry picked from commit d5a69bd47e98502ae2769b28b65936722a92c139) --- ...rt-libblkid-ext-add-checksum-support.patch | 58 +++++++++++++++++++ util-linux.spec | 10 +++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 backport-revert-libblkid-ext-add-checksum-support.patch diff --git a/backport-revert-libblkid-ext-add-checksum-support.patch b/backport-revert-libblkid-ext-add-checksum-support.patch new file mode 100644 index 0000000..f4ba40b --- /dev/null +++ b/backport-revert-libblkid-ext-add-checksum-support.patch @@ -0,0 +1,58 @@ +From f991ef78af15a001c4acfcb42abca9ce3dce8fbe Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 5 Nov 2022 02:21:27 +0100 +Subject: [PATCH] revert libblkid ext add checksum support + +--- + libblkid/src/superblocks/ext.c | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/libblkid/src/superblocks/ext.c b/libblkid/src/superblocks/ext.c +index 885fec2..1c79942 100644 +--- a/libblkid/src/superblocks/ext.c ++++ b/libblkid/src/superblocks/ext.c +@@ -19,7 +19,6 @@ + #include + + #include "superblocks.h" +-#include "crc32c.h" + + struct ext2_super_block { + uint32_t s_inodes_count; +@@ -75,8 +74,7 @@ struct ext2_super_block { + uint16_t s_mmp_interval; + uint64_t s_mmp_block; + uint32_t s_raid_stripe_width; +- uint32_t s_reserved[162]; +- uint32_t s_checksum; ++ uint32_t s_reserved[163]; + } __attribute__((packed)); + + /* magic string */ +@@ -104,7 +102,6 @@ struct ext2_super_block { + #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 + #define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 + #define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 +-#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400 + + /* for s_feature_incompat */ + #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 +@@ -151,14 +148,9 @@ static struct ext2_super_block *ext_get_super( + struct ext2_super_block *es; + + es = (struct ext2_super_block *) +- blkid_probe_get_buffer(pr, EXT_SB_OFF, sizeof(struct ext2_super_block)); ++ blkid_probe_get_buffer(pr, EXT_SB_OFF, 0x200); + if (!es) + return NULL; +- if (le32_to_cpu(es->s_feature_ro_compat) & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) { +- uint32_t csum = crc32c(~0, es, offsetof(struct ext2_super_block, s_checksum)); +- if (!blkid_probe_verify_csum(pr, csum, le32_to_cpu(es->s_checksum))) +- return NULL; +- } + if (fc) + *fc = le32_to_cpu(es->s_feature_compat); + if (fi) +-- +2.43.0 + diff --git a/util-linux.spec b/util-linux.spec index 90780c6..80dce5d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Name: util-linux Version: 2.39.1 -Release: 24 +Release: 25 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -105,6 +105,7 @@ Patch6083: backport-mkfs.bfs-fix-memory-leaks-and-weak-code.patch Patch6084: backport-cfdisk-fix-memory-leak-and-possible-NULL-dereference.patch Patch6085: backport-swapoff-clean-up-tag-resolution.patch Patch6086: backport-libblkid-befs-fix-underflow.patch +Patch6087: backport-revert-libblkid-ext-add-checksum-support.patch Patch9000: SKIPPED-no-root-permissions-test.patch Patch9001: util-linux-Add-sw64-architecture.patch @@ -470,6 +471,13 @@ fi %endif %changelog +* Mon Jul 07 2025 Linux_zhang - 2.39.1-25 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC: revert libblkid ext add checksum support, the disk cannot be mounted because the checksum may fail. + [add] backport-revert-libblkid-ext-add-checksum-support.patch + * Mon June 30 2025 luhuaxin - 2.39.1-24 - Type:bugfix - CVE:NA -- Gitee