From dd00fbe16da0404476b73ab40b0349a0cd06a09e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 13 Oct 2025 13:39:14 +0200 Subject: [PATCH] RHEL-9.8: lscpu (ARMs), libblkid (jmicron) Resolves: RHEL-108386 RHEL-113638 --- 0083-lscpu-update-ARM-identifiers.patch | 85 ++++++++++++ ..._raid-backport-checksum-verification.patch | 123 ++++++++++++++++++ util-linux.spec | 7 + 3 files changed, 215 insertions(+) create mode 100644 0083-lscpu-update-ARM-identifiers.patch create mode 100644 0084-libblkid-jmicron_raid-backport-checksum-verification.patch diff --git a/0083-lscpu-update-ARM-identifiers.patch b/0083-lscpu-update-ARM-identifiers.patch new file mode 100644 index 0000000..0b26022 --- /dev/null +++ b/0083-lscpu-update-ARM-identifiers.patch @@ -0,0 +1,85 @@ +From 8b55d28ed7671faf627f7614b1cd48724bd02932 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 13 Oct 2025 12:01:52 +0200 +Subject: lscpu: update ARM identifiers + +Addresses: https://issues.redhat.com/browse/RHEL-113638 +Signed-off-by: Karel Zak +--- + sys-utils/lscpu-arm.c | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c +index 5716f6c51..ac2ff191e 100644 +--- a/sys-utils/lscpu-arm.c ++++ b/sys-utils/lscpu-arm.c +@@ -102,6 +102,14 @@ static const struct id_part arm_part[] = { + { 0xd80, "Cortex-A520" }, + { 0xd81, "Cortex-A720" }, + { 0xd82, "Cortex-X4" }, ++ { 0xd83, "Neoverse-V3AE" }, ++ { 0xd84, "Neoverse-V3" }, ++ { 0xd85, "Cortex-X925" }, ++ { 0xd87, "Cortex-A725" }, ++ { 0xd88, "Cortex-A520AE" }, ++ { 0xd89, "Cortex-A720AE" }, ++ { 0xd8e, "Neoverse-N3" }, ++ { 0xd8f, "Cortex-A320" }, + { -1, "unknown" }, + }; + +@@ -171,6 +179,7 @@ static const struct id_part nvidia_part[] = { + { 0x000, "Denver" }, + { 0x003, "Denver 2" }, + { 0x004, "Carmel" }, ++ { 0x010, "Olympus" }, + { -1, "unknown" }, + }; + +@@ -254,12 +263,15 @@ static const struct id_part intel_part[] = { + + static const struct id_part fujitsu_part[] = { + { 0x001, "A64FX" }, ++ { 0x003, "MONAKA" }, + { -1, "unknown" }, + }; + + static const struct id_part hisi_part[] = { +- { 0xd01, "Kunpeng-920" }, /* aka tsv110 */ ++ { 0xd01, "TaiShan-v110" }, /* used in Kunpeng-920 SoC */ ++ { 0xd02, "TaiShan-v120" }, /* used in Kirin 990A and 9000S SoCs */ + { 0xd40, "Cortex-A76" }, /* HiSilicon uses this ID though advertises A76 */ ++ { 0xd41, "Cortex-A77" }, /* HiSilicon uses this ID though advertises A77 */ + { -1, "unknown" }, + }; + +@@ -270,10 +282,18 @@ static const struct id_part ampere_part[] = { + }; + + static const struct id_part ft_part[] = { ++ { 0x303, "FTC310" }, + { 0x660, "FTC660" }, + { 0x661, "FTC661" }, + { 0x662, "FTC662" }, + { 0x663, "FTC663" }, ++ { 0x664, "FTC664" }, ++ { 0x862, "FTC862" }, ++ { -1, "unknown" }, ++}; ++ ++static const struct id_part ms_part[] = { ++ { 0xd49, "Azure-Cobalt-100" }, + { -1, "unknown" }, + }; + +@@ -304,6 +324,7 @@ static const struct hw_impl hw_implementer[] = { + { 0x61, apple_part, "Apple" }, + { 0x66, faraday_part, "Faraday" }, + { 0x69, intel_part, "Intel" }, ++ { 0x6d, ms_part, "Microsoft" }, + { 0x70, ft_part, "Phytium" }, + { 0xc0, ampere_part, "Ampere" }, + { -1, unknown_part, "unknown" }, +-- +2.51.0 + diff --git a/0084-libblkid-jmicron_raid-backport-checksum-verification.patch b/0084-libblkid-jmicron_raid-backport-checksum-verification.patch new file mode 100644 index 0000000..a1ef5e0 --- /dev/null +++ b/0084-libblkid-jmicron_raid-backport-checksum-verification.patch @@ -0,0 +1,123 @@ +From c5c47008f240ba96c4f3b676349b64cd22eadb14 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 13 Oct 2025 13:21:27 +0200 +Subject: libblkid: (jmicron_raid) backport checksum verification + +Backported from RHEL-10. The original code produces false positives. + +Addresses: https://issues.redhat.com/browse/RHEL-108386 +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/jmicron_raid.c | 74 ++++++++++++++++++++----- + 1 file changed, 61 insertions(+), 13 deletions(-) + +diff --git a/libblkid/src/superblocks/jmicron_raid.c b/libblkid/src/superblocks/jmicron_raid.c +index ca7986733..4587075ca 100644 +--- a/libblkid/src/superblocks/jmicron_raid.c ++++ b/libblkid/src/superblocks/jmicron_raid.c +@@ -16,23 +16,65 @@ + + #include "superblocks.h" + +-struct jm_metadata { +- int8_t signature[2]; +- uint8_t minor_version; +- uint8_t major_version; +- uint16_t checksum; +-}; +- + #define JM_SIGNATURE "JM" ++#define JM_MINOR_VERSION(_x) (le16_to_cpu((_x)->version) & 0xFF) ++#define JM_MAJOR_VERSION(_x) (le16_to_cpu((_x)->version) >> 8) ++#define JM_SPARES 2 ++#define JM_MEMBERS 8 ++ ++struct jm_metadata { ++ int8_t signature[2]; /* 0x0 - 0x01 */ ++ ++ uint16_t version; /* 0x03 - 0x04 JMicron version */ ++ ++ uint16_t checksum; /* 0x04 - 0x05 */ ++ uint8_t filler[10]; ++ ++ uint32_t identity; /* 0x10 - 0x13 */ ++ ++ struct { ++ uint32_t base; /* 0x14 - 0x17 */ ++ uint32_t range; /* 0x18 - 0x1B range */ ++ uint16_t range2; /* 0x1C - 0x1D range2 */ ++ } segment; ++ ++ int8_t name[16]; /* 0x20 - 0x2F */ ++ ++ uint8_t mode; /* 0x30 RAID level */ ++ uint8_t block; /* 0x31 stride size (2=4K, 3=8K, ...) */ ++ uint16_t attribute; /* 0x32 - 0x33 */ ++ uint8_t filler1[4]; ++ ++ uint32_t spare[JM_SPARES]; /* 0x38 - 0x3F */ ++ uint32_t member[JM_MEMBERS]; /* 0x40 - 0x5F */ ++ ++ uint8_t filler2[0x20]; ++} __attribute__ ((packed)); ++ ++static int jm_checksum(blkid_probe pr, const struct jm_metadata *jm) ++{ ++ size_t count = sizeof(*jm) / sizeof(uint16_t); ++ uint16_t sum = 0; ++ unsigned char *ptr = (unsigned char *) jm; ++ ++ while (count--) { ++ uint16_t val; ++ ++ memcpy(&val, ptr, sizeof(uint16_t)); ++ sum += le16_to_cpu(val); ++ ++ ptr += sizeof(uint16_t); ++ } ++ ++ return blkid_probe_verify_csum(pr, sum == 0 || sum == 1, 1); ++} + + static int probe_jmraid(blkid_probe pr, + const struct blkid_idmag *mag __attribute__((__unused__))) + { + uint64_t off; +- struct jm_metadata *jm; ++ const struct jm_metadata *jm; + +- if (pr->size < 0x10000) +- return 1; + if (!S_ISREG(pr->mode) && !blkid_probe_is_wholedisk(pr)) + return 1; + +@@ -46,8 +88,15 @@ static int probe_jmraid(blkid_probe pr, + + if (memcmp(jm->signature, JM_SIGNATURE, sizeof(JM_SIGNATURE) - 1) != 0) + return 1; ++ ++ if (!jm_checksum(pr, jm)) ++ return 1; ++ ++ if (jm->mode > 5) ++ return 1; ++ + if (blkid_probe_sprintf_version(pr, "%u.%u", +- jm->major_version, jm->minor_version) != 0) ++ JM_MAJOR_VERSION(jm), JM_MINOR_VERSION(jm)) != 0) + return 1; + if (blkid_probe_set_magic(pr, off, sizeof(jm->signature), + (unsigned char *) jm->signature)) +@@ -58,8 +107,7 @@ static int probe_jmraid(blkid_probe pr, + const struct blkid_idinfo jmraid_idinfo = { + .name = "jmicron_raid_member", + .usage = BLKID_USAGE_RAID, ++ .minsz = 0x10000, + .probefunc = probe_jmraid, + .magics = BLKID_NONE_MAGIC + }; +- +- +-- +2.51.0 + diff --git a/util-linux.spec b/util-linux.spec index ddccaa5..4839439 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -236,6 +236,13 @@ Patch81: 0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch # RHEL-56983 - sulogin: fix POSIX locale use Patch82: 0082-sulogin-fix-POSIX-locale-use.patch +### RHEL-9.8 +# +# RHEL-113638 - lscpu: update ARM identifiers +Patch83: 0083-lscpu-update-ARM-identifiers.patch +# RHEL-108386 - libblkid: (jmicron_raid) backport checksum verification +Patch84: 0084-libblkid-jmicron_raid-backport-checksum-verification.patch + %description The util-linux package contains a large variety of low-level system