diff --git a/0012-lscpu-Add-NVIDIA-Olympus-arm64-core.patch b/0012-lscpu-Add-NVIDIA-Olympus-arm64-core.patch new file mode 100644 index 0000000..c0e6c1e --- /dev/null +++ b/0012-lscpu-Add-NVIDIA-Olympus-arm64-core.patch @@ -0,0 +1,29 @@ +From 8645e1ce6b64a57b8159b9509f882112eaf97425 Mon Sep 17 00:00:00 2001 +From: "Matthew R. Ochs" +Date: Tue, 2 Sep 2025 13:28:36 -0700 +Subject: lscpu: Add NVIDIA Olympus arm64 core + +Add an entry for NVIDIA Olympus arm64 core. + +Signed-off-by: Matthew R. Ochs +Upstream: http://github.com/util-linux/util-linux/commit/908777470d403ec30c525472ba0d3701c9c5a223 +Addresses: https://issues.redhat.com/browse/RHEL-113639 +--- + sys-utils/lscpu-arm.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c +index 682868550..3397e9d4d 100644 +--- a/sys-utils/lscpu-arm.c ++++ b/sys-utils/lscpu-arm.c +@@ -170,6 +170,7 @@ static const struct id_part nvidia_part[] = { + { 0x000, "Denver" }, + { 0x003, "Denver 2" }, + { 0x004, "Carmel" }, ++ { 0x010, "Olympus" }, + { -1, "unknown" }, + }; + +-- +2.50.1 + diff --git a/0013-libfdisk-improve-collision-reporting.patch b/0013-libfdisk-improve-collision-reporting.patch new file mode 100644 index 0000000..7e7508d --- /dev/null +++ b/0013-libfdisk-improve-collision-reporting.patch @@ -0,0 +1,241 @@ +From af9954b8da649684241c55fa617fdf629b33a454 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 8 Sep 2025 11:44:16 +0200 +Subject: libfdisk: improve collision reporting + +In some cases, a collision occurs in the first sector. Creating a new +partition table overwrites this sector, but updating an existing table +does not. In the latter case, promising to wipe the collision is a +bug. + +Because we cannot know whether the collision is expected (e.g., hybrid +or boot disks) or unintended, we inform the user and let them decide. +libfdisk can wipe the unwanted signature only when creating a new +partition table; otherwise, the user can use wipefs. + +This commit introduces fdisk_is_collision_area(), an API to detect +where the collision occurs. The function is generic and not limited to +the first sector. + +Fixes: https://github.com/util-linux/util-linux/issues/3659 +Signed-off-by: Karel Zak +Upstream: http://github.com/util-linux/util-linux/commit/e873aa0322f42167a402e95dd398fcc4eb256119 +Addresses: https://issues.redhat.com/browse/RHEL-82162 +--- + disk-utils/fdisk.c | 21 +++++++++++++++------ + disk-utils/sfdisk.c | 28 +++++++++++++++++++--------- + libfdisk/docs/libfdisk-sections.txt | 1 + + libfdisk/src/context.c | 21 +++++++++++++++++++++ + libfdisk/src/fdiskP.h | 1 + + libfdisk/src/libfdisk.h.in | 1 + + libfdisk/src/libfdisk.sym | 4 ++++ + libfdisk/src/wipe.c | 23 ++++++++++++++++------- + 8 files changed, 78 insertions(+), 22 deletions(-) + +diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c +index c75a7a63c..490e7b670 100644 +--- a/disk-utils/fdisk.c ++++ b/disk-utils/fdisk.c +@@ -924,12 +924,21 @@ void follow_wipe_mode(struct fdisk_context *cxt) + dowipe = 1; /* always remove old PT */ + + fdisk_enable_wipe(cxt, dowipe); +- if (dowipe) +- fdisk_warnx(cxt, _( +- "The device contains '%s' signature and it will be removed by a write command. " +- "See fdisk(8) man page and --wipe option for more details."), +- fdisk_get_collision(cxt)); +- else ++ ++ if (dowipe) { ++ /* check if collision in first sector */ ++ if (fdisk_has_label(cxt) && fdisk_is_collision_area(cxt, 0, ++ fdisk_get_sector_size(cxt))) ++ fdisk_warnx(cxt, _( ++ "The device contains a '%s' signature in the first sector; it will not be wiped " ++ "unless you create a new partition table. Alternatively, use wipefs(8)."), ++ fdisk_get_collision(cxt)); ++ else ++ fdisk_warnx(cxt, _( ++ "The device contains '%s' signature and it will be removed by a write command. " ++ "See fdisk(8) man page and --wipe option for more details."), ++ fdisk_get_collision(cxt)); ++ } else + fdisk_warnx(cxt, _( + "The device contains '%s' signature and it may remain on the device. " + "It is recommended to wipe the device with wipefs(8) or " +diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c +index d8dd8d296..b25cc7955 100644 +--- a/disk-utils/sfdisk.c ++++ b/disk-utils/sfdisk.c +@@ -1661,22 +1661,32 @@ static void follow_wipe_mode(struct sfdisk *sf) + if (sf->quiet) + return; + +- if (dowipe) { +- if (!fdisk_is_ptcollision(sf->cxt)) { +- fdisk_warnx(sf->cxt, _( +- "The device contains '%s' signature and it may be removed by a write command. " +- "See sfdisk(8) man page and --wipe option for more details."), +- fdisk_get_collision(sf->cxt)); +- fputc('\n', stdout); +- } +- } else { ++ if (!dowipe) { + fdisk_warnx(sf->cxt, _( + "The device contains '%s' signature and it may remain on the device. " + "It is recommended to wipe the device with wipefs(8) or " + "sfdisk --wipe, in order to avoid possible collisions."), + fdisk_get_collision(sf->cxt)); + fputc('\n', stderr); ++ return; + } ++ ++ if (fdisk_is_ptcollision(sf->cxt)) ++ return; /* PT will be replaced */ ++ ++ if (sf->append && fdisk_has_label(sf->cxt) ++ && fdisk_is_collision_area(sf->cxt, 0, fdisk_get_sector_size(sf->cxt))) ++ fdisk_warnx(sf->cxt, _( ++ "The device contains a '%s' signature in the first sector; it will not be wiped " ++ "unless you create a new partition table. Alternatively, use wipefs(8)."), ++ fdisk_get_collision(sf->cxt)); ++ else ++ fdisk_warnx(sf->cxt, _( ++ "The device contains '%s' signature and it may be removed by a write command. " ++ "See sfdisk(8) man page and --wipe option for more details."), ++ fdisk_get_collision(sf->cxt)); ++ ++ fputc('\n', stdout); + } + + static int wipe_partition(struct sfdisk *sf, size_t partno) +diff --git a/libfdisk/docs/libfdisk-sections.txt b/libfdisk/docs/libfdisk-sections.txt +index efc138571..1e4b82e2d 100644 +--- a/libfdisk/docs/libfdisk-sections.txt ++++ b/libfdisk/docs/libfdisk-sections.txt +@@ -335,6 +335,7 @@ fdisk_has_dialogs + fdisk_has_label + fdisk_has_protected_bootbits + fdisk_has_wipe ++fdisk_is_collision_area + fdisk_is_details + fdisk_is_labeltype + fdisk_is_listonly +diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c +index 463a60f86..a9e6027ea 100644 +--- a/libfdisk/src/context.c ++++ b/libfdisk/src/context.c +@@ -449,6 +449,27 @@ int fdisk_is_ptcollision(struct fdisk_context *cxt) + return cxt->pt_collision; + } + ++/** ++ * fdisk_is_collision_area: ++ * @cxt: fdisk context ++ * ++ * If there is a collision with the filesystem or another partition table, ++ * verify that the detected magic string is within the specified area. ++ * ++ * Returns: 0 or 1 ++ * ++ * Since: v2.42 ++ */ ++int fdisk_is_collision_area(struct fdisk_context *cxt, ++ uint64_t start, uint64_t size) ++{ ++ if (cxt->collision && ++ start <= cxt->collision_offset && cxt->collision_offset <= start + size) ++ return 1; ++ ++ return 0; ++} ++ + /** + * fdisk_get_npartitions: + * @cxt: context +diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h +index 49e057f11..84203976a 100644 +--- a/libfdisk/src/fdiskP.h ++++ b/libfdisk/src/fdiskP.h +@@ -409,6 +409,7 @@ struct fdisk_context { + listonly : 1; /* list partition, nothing else */ + + char *collision; /* name of already existing FS/PT */ ++ uint64_t collision_offset; + struct list_head wipes; /* list of areas to wipe before write */ + + int sizeunit; /* SIZE fields, FDISK_SIZEUNIT_* */ +diff --git a/libfdisk/src/libfdisk.h.in b/libfdisk/src/libfdisk.h.in +index 9c20f44be..ccf8582ed 100644 +--- a/libfdisk/src/libfdisk.h.in ++++ b/libfdisk/src/libfdisk.h.in +@@ -217,6 +217,7 @@ int fdisk_enable_wipe(struct fdisk_context *cxt, int enable); + int fdisk_has_wipe(struct fdisk_context *cxt); + const char *fdisk_get_collision(struct fdisk_context *cxt); + int fdisk_is_ptcollision(struct fdisk_context *cxt); ++int fdisk_is_collision_area(struct fdisk_context *cxt, uint64_t start, uint64_t size); + + int fdisk_set_unit(struct fdisk_context *cxt, const char *str); + const char *fdisk_get_unit(struct fdisk_context *cxt, int n); +diff --git a/libfdisk/src/libfdisk.sym b/libfdisk/src/libfdisk.sym +index bb69e93c4..81049133a 100644 +--- a/libfdisk/src/libfdisk.sym ++++ b/libfdisk/src/libfdisk.sym +@@ -324,3 +324,7 @@ FDISK_2.38 { + FDISK_2.40 { + fdisk_partition_get_max_size; + } FDISK_2.38; ++ ++FDISK_2_42 { ++ fdisk_is_collision_area; ++} FDISK_2.40; +diff --git a/libfdisk/src/wipe.c b/libfdisk/src/wipe.c +index bb5f1bb38..48e0036bf 100644 +--- a/libfdisk/src/wipe.c ++++ b/libfdisk/src/wipe.c +@@ -178,25 +178,34 @@ int fdisk_check_collisions(struct fdisk_context *cxt) + + blkid_probe_enable_superblocks(pr, 1); + blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_TYPE | ++ BLKID_SUBLKS_MAGIC | + BLKID_SUBLKS_BADCSUM); + blkid_probe_enable_partitions(pr, 1); +- blkid_probe_set_partitions_flags(pr, BLKID_PARTS_FORCE_GPT); ++ blkid_probe_set_partitions_flags(pr, BLKID_PARTS_FORCE_GPT | ++ BLKID_PARTS_MAGIC); + + /* we care about the first found FS/raid, so don't call blkid_do_probe() + * in loop or don't use blkid_do_fullprobe() ... */ + rc = blkid_do_probe(pr); + if (rc == 0) { + const char *name = NULL; ++ const char *off = NULL; + +- if (blkid_probe_lookup_value(pr, "TYPE", &name, 0) == 0) +- cxt->collision = strdup(name); +- else if (blkid_probe_lookup_value(pr, "PTTYPE", &name, 0) == 0) { +- cxt->collision = strdup(name); ++ if (blkid_probe_lookup_value(pr, "TYPE", &name, 0) == 0) { ++ blkid_probe_lookup_value(pr, "SBMAGIC_OFFSET", &off, NULL); ++ ++ } else if (blkid_probe_lookup_value(pr, "PTTYPE", &name, 0) == 0) { ++ blkid_probe_lookup_value(pr, "PTMAGIC_OFFSET", &off, NULL); + cxt->pt_collision = 1; + } + +- if (name && !cxt->collision) +- rc = -ENOMEM; ++ if (name) { ++ cxt->collision = strdup(name); ++ if (!cxt->collision) ++ rc = -ENOMEM; ++ } ++ if (!rc && off) ++ cxt->collision_offset = strtoumax(off, NULL, 10); + } + + blkid_free_probe(pr); +-- +2.50.1 + diff --git a/0014-libfdisk-dos-ignore-incomplete-EBR-for-non-wholedisk.patch b/0014-libfdisk-dos-ignore-incomplete-EBR-for-non-wholedisk.patch new file mode 100644 index 0000000..a50f647 --- /dev/null +++ b/0014-libfdisk-dos-ignore-incomplete-EBR-for-non-wholedisk.patch @@ -0,0 +1,58 @@ +From 6d73d34d70db580c877dd77788a430f4730a62d8 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 24 Sep 2024 13:37:13 +0200 +Subject: libfdisk: (dos) ignore incomplete EBR for non-wholedisk + +The logical partitions are defined by a chain of extended partitions, +with the beginning of the chain located on the whole disk device. + +If a user runs "fdisk --list /dev/sda4", libfdisk cannot calculate proper +offsets for the items in the chain, resulting in the following error +message: + + Failed to read extended partition table (offset=22528): Invalid argument + +This error message may confuse users and is unnecessary when fdisk is +used in list-only mode (--list option). It would be sufficient to only +print the content of the partition without the error message and not +continue to the next item in the chain. + +However, in write mode (without --list), the error message will still +be displayed as it is potentially dangerous to edit the EBR table. + +Addresses: https://issues.redhat.com/browse/RHEL-59867 +Signed-off-by: Karel Zak +(cherry picked from commit 9f0e6584696de7533e5571107d03f3426a359138) +--- + libfdisk/src/dos.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c +index 5c00164ce..db7e25716 100644 +--- a/libfdisk/src/dos.c ++++ b/libfdisk/src/dos.c +@@ -11,6 +11,7 @@ + #include "randutils.h" + #include "pt-mbr.h" + #include "strutils.h" ++#include "sysfs.h" + + #include "fdiskP.h" + +@@ -527,6 +528,13 @@ static void read_extended(struct fdisk_context *cxt, size_t ext) + struct dos_partition *p, *q; + struct fdisk_dos_label *l = self_label(cxt); + ++ if (fdisk_is_listonly(cxt) && ++ !sysfs_devno_is_wholedisk(fdisk_get_devno(cxt))) { ++ DBG(LABEL, ul_debug("DOS: unable to gather logical partition chain " ++ "when running on a non-whole disk device.")); ++ return; ++ } ++ + l->ext_index = ext; + pex = self_pte(cxt, ext); + if (!pex) { +-- +2.50.1 + diff --git a/0014-wall-always-use-utmp-as-fallback.patch b/0015-wall-always-use-utmp-as-fallback.patch similarity index 96% rename from 0014-wall-always-use-utmp-as-fallback.patch rename to 0015-wall-always-use-utmp-as-fallback.patch index 588281b..da9b810 100644 --- a/0014-wall-always-use-utmp-as-fallback.patch +++ b/0015-wall-always-use-utmp-as-fallback.patch @@ -1,4 +1,4 @@ -From 0ceb3eed0e696fedf11daa845aa25870985415d3 Mon Sep 17 00:00:00 2001 +From 4184803d9a04643ed9235bafb29e926b11714f52 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 3 Jun 2024 14:32:18 +0200 Subject: wall: always use utmp as fallback @@ -12,8 +12,8 @@ This commit uses strv (string vector) to collect tty names from both sources (systemd and utmp) and then sends a message to all ttys. Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2283049 -Addresses: https://issues.redhat.com/browse/RHEL-143966 Signed-off-by: Karel Zak +(cherry picked from commit 0af497c6688b53a3a176176bfbcdca821bd856ec) --- term-utils/wall.c | 57 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 18 deletions(-) @@ -133,5 +133,5 @@ index 125fde438..22c3918bb 100644 free_group_workspace(group_buf); exit(EXIT_SUCCESS); -- -2.52.0 +2.50.1 diff --git a/0016-mount-improve-all-documentation.patch b/0016-mount-improve-all-documentation.patch new file mode 100644 index 0000000..1268ec5 --- /dev/null +++ b/0016-mount-improve-all-documentation.patch @@ -0,0 +1,43 @@ +From 7e8aba77423013481fa2965ad80c7fe7aece8497 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 22 Oct 2025 10:53:15 +0200 +Subject: mount: improve --all documentation + +Add notes to the --all option description: +- Historical context: mount -a was originally designed for init scripts +- Modern usage: systemd-based distributions use systemd units instead +- Swap handling: swap entries in fstab are silently ignored, use swapon -a + +Addresses: https://issues.redhat.com/browse/RHEL-119786 +Signed-off-by: Karel Zak +--- + sys-utils/mount.8.adoc | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc +index ba8b45a2a..de2461f8a 100644 +--- a/sys-utils/mount.8.adoc ++++ b/sys-utils/mount.8.adoc +@@ -303,7 +303,9 @@ The *mount* command does not pass all command-line options to the **/sbin/mount. + Command-line options available for the *mount* command are: + + *-a*, *--all*:: +-Mount all filesystems (of the given types) mentioned in _fstab_ (except for those whose line contains the *noauto* keyword). The filesystems are mounted following their order in _fstab_. The *mount* command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already mounted filesystems is cached during *mount --all*. This means that all duplicated _fstab_ entries will be mounted. ++Mount all filesystems (of the given types) mentioned in _fstab_ (except for those whose line contains the *noauto* keyword). This option was originally designed for use in init scripts. Note that many modern systemd-based distributions do not use *mount -a* on boot and instead mount filesystems in a more sophisticated way using systemd units. +++ ++The filesystems are mounted following their order in _fstab_. The *mount* command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already mounted filesystems is cached during *mount --all*. This means that all duplicated _fstab_ entries will be mounted. + + + The correct functionality depends on _/proc_ (to detect already mounted filesystems) and on _/sys_ (to evaluate filesystem tags like UUID= or LABEL=). It's strongly recommended to mount _/proc_ and _/sys_ filesystems before *mount -a* is executed, or keep /proc and /sys at the beginning of _fstab_. + + +@@ -311,6 +313,8 @@ The option *--all* is possible to use for remount operation too. In this case al + + + Since version 2.35 it is possible to use the command line option *-o* to alter mount options from _fstab_ (see also *--options-mode*). + + ++Note that swap entries in _fstab_ are silently ignored by *mount -a*. Use *swapon -a* to enable swap devices and files. See *swapon*(8). +++ + Note that it is a bad practice to use *mount -a* for _fstab_ checking. The recommended solution is *findmnt --verify*. + + *-B*, *--bind*:: +-- +2.51.0 + diff --git a/0017-libblkid-Fix-probe_ioctl_tp-assigning-BLKGETDISKSEQ-.patch b/0017-libblkid-Fix-probe_ioctl_tp-assigning-BLKGETDISKSEQ-.patch new file mode 100644 index 0000000..d2b638d --- /dev/null +++ b/0017-libblkid-Fix-probe_ioctl_tp-assigning-BLKGETDISKSEQ-.patch @@ -0,0 +1,53 @@ +From 9121e301959fb977642c1bab81525fed08629c1c Mon Sep 17 00:00:00 2001 +From: Sam Fink +Date: Wed, 17 Sep 2025 10:04:51 -0400 +Subject: libblkid: Fix probe_ioctl_tp assigning BLKGETDISKSEQ as physical + sector size + +Fix issue introduced by PR#2908 in probe_ioctl_tp where the BLKGETDISKSEQ ioctl +result is incorrectly assigned to the topology with +blkid_topology_set_physical_sector_size instead of blkid_topology_set_diskseq. + +This issue was observed while using a Debian 13 container on a RHEL 9.4 host +attempting to format a volume. The physical sector size was incorrectly +reported as 3. This issue also presents with the fdisk command, +which also uses this library to resolve physical sector size of devices. + +Example fdisk output: +root@r94p121-PA:~ # fdisk --list /dev/sdb +Disk /dev/sdb: 90 GiB, 96636764160 bytes, 188743680 sectors +Units: sectors of 1 * 512 = 512 bytes +Sector size (logical/physical): 512 bytes / 3 bytes +I/O size (minimum/optimal): 512 bytes / 3 bytes + +Strace of relevant ioctls: +ioctl(3, BLKALIGNOFF, [0]) = 0 +ioctl(3, BLKIOMIN, [512]) = 0 +ioctl(3, BLKIOOPT, [0]) = 0 +ioctl(3, BLKPBSZGET, [512]) = 0 +ioctl(3, BLKGETDISKSEQ, [3]) = 0 +ioctl(3, BLKSSZGET, [512]) = 0 + +Addresses: https://issues.redhat.com/browse/RHEL-123170 + +(cherry picked from commit 6fbde1c7db838e22b109e2e58eaa51b086758bc6) +--- + libblkid/src/topology/ioctl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libblkid/src/topology/ioctl.c b/libblkid/src/topology/ioctl.c +index 7b15c9e9a..e95d67739 100644 +--- a/libblkid/src/topology/ioctl.c ++++ b/libblkid/src/topology/ioctl.c +@@ -46,7 +46,7 @@ static int probe_ioctl_tp(blkid_probe pr, + + if (ioctl(pr->fd, BLKGETDISKSEQ, &u64) == -1) + return 1; +- if (blkid_topology_set_physical_sector_size(pr, u64)) ++ if (blkid_topology_set_diskseq(pr, u64)) + return -1; + + return 0; +-- +2.51.0 + diff --git a/0012-libblkid-use-snprintf-instead-of-sprintf.patch b/0018-libblkid-use-snprintf-instead-of-sprintf.patch similarity index 90% rename from 0012-libblkid-use-snprintf-instead-of-sprintf.patch rename to 0018-libblkid-use-snprintf-instead-of-sprintf.patch index 89236ea..a07d04a 100644 --- a/0012-libblkid-use-snprintf-instead-of-sprintf.patch +++ b/0018-libblkid-use-snprintf-instead-of-sprintf.patch @@ -1,4 +1,4 @@ -From c5bc4b1595300aecf2e140bdce8e97c2bde57786 Mon Sep 17 00:00:00 2001 +From e00af23ce51151a5a2e7b207dbe8d1bc715e4bd1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 6 Oct 2025 15:04:24 +0200 Subject: libblkid: use snprintf() instead of sprintf() @@ -12,10 +12,10 @@ of pre-checking buffer size, providing more robust error handling. In probe.c, snprintf() is used with proper size calculation based on remaining buffer space. -Addresses: https://issues.redhat.com/browse/RHEL-134271 +Addresses: https://issues.redhat.com/browse/RHEL-121120 Signed-off-by: Karel Zak -(cherry picked from commit e00af23ce51151a5a2e7b207dbe8d1bc715e4bd1) +(cherry picked from commit 041380f4ca7244df624bf7efdb5e27fdd3144175) --- libblkid/src/encode.c | 6 ++++-- libblkid/src/probe.c | 4 ++-- @@ -55,5 +55,5 @@ index 76905e197..cd45bcdf7 100644 ul_debug( -- -2.51.1 +2.51.0 diff --git a/0019-libfdisk-dos-fix-off-by-one-in-maximum-last-sector-c.patch b/0019-libfdisk-dos-fix-off-by-one-in-maximum-last-sector-c.patch new file mode 100644 index 0000000..e1f1120 --- /dev/null +++ b/0019-libfdisk-dos-fix-off-by-one-in-maximum-last-sector-c.patch @@ -0,0 +1,46 @@ +From ec0dfcca6f2d154a4697df4448d1aea6d2ee00af Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 30 Oct 2025 12:11:43 +0100 +Subject: libfdisk: (dos) fix off-by-one in maximum last sector calculation + +The get_disk_ranges() function incorrectly capped the last usable +sector at UINT_MAX, which could cause an overflow when calculating +partition size for MBR partition tables. + +MBR stores partition size as a 32-bit value with maximum UINT_MAX. +The partition size is calculated as: size = stop - start + 1 + +For a partition starting at sector 0: +- If stop = UINT_MAX: size = UINT_MAX + 1 (overflow!) +- If stop = UINT_MAX - 1: size = UINT_MAX (correct maximum) + +This fixes the inconsistency where dos_init() correctly warns about +disks larger than UINT_MAX sectors (2TiB - 512 bytes for 512-byte +sectors), but get_disk_ranges() allowed creating partitions that +would overflow the 32-bit size field. + +Addresses: https://issues.redhat.com/browse/RHEL-122367 +Signed-off-by: Karel Zak +(cherry picked from commit 578923fe582903628ecc0d2a434af0affa3660d2) +--- + libfdisk/src/dos.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c +index db7e25716..c88d2a4f2 100644 +--- a/libfdisk/src/dos.c ++++ b/libfdisk/src/dos.c +@@ -1241,8 +1241,8 @@ static int get_disk_ranges(struct fdisk_context *cxt, int logical, + else + *last = cxt->total_sectors - 1; + +- if (*last > UINT_MAX) +- *last = UINT_MAX; ++ if (*last >= UINT_MAX) ++ *last = UINT_MAX - 1; + *first = cxt->first_lba; + } + +-- +2.51.1 + diff --git a/0013-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch b/0020-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch similarity index 89% rename from 0013-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch rename to 0020-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch index 7c0def1..2b690ea 100644 --- a/0013-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch +++ b/0020-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch @@ -1,4 +1,4 @@ -From 903975206ebb1524205c966d5eb7eca9e6b68ed5 Mon Sep 17 00:00:00 2001 +From c84b027a5552b89a1bdbabed1faea7b1583efd1b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Dec 2025 13:36:41 +0100 Subject: login-utils: fix setpwnam() buffer use [CVE-2025-14104] @@ -8,9 +8,8 @@ unfortunately was not backported to stable/v2.41 yet. References: aaa9e718c88d6916b003da7ebcfe38a3c88df8e6 References: 9a36d77012c4c771f8d51eba46b6e62c29bf572a -Addresses: https://issues.redhat.com/browse/RHEL-133942 Signed-off-by: Karel Zak -(cherry picked from commit c84b027a5552b89a1bdbabed1faea7b1583efd1b) +(cherry picked from commit 9753e6ad9705104c3b05713f79ad6732cc4c7b30) --- login-utils/setpwnam.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/util-linux-uuidd-sysusers.conf b/util-linux-uuidd-sysusers.conf new file mode 100644 index 0000000..afd02eb --- /dev/null +++ b/util-linux-uuidd-sysusers.conf @@ -0,0 +1 @@ +u uuidd - "UUID generator helper daemon" /var/lib/libuuid diff --git a/util-linux.spec b/util-linux.spec index 46890c7..18479ad 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,8 +1,8 @@ ## START: Set by rpmautospec -## (rpmautospec version 0.6.5) +## (rpmautospec version 0.8.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 16; + release_number = 18; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} @@ -39,6 +39,7 @@ BuildRequires: popt-devel BuildRequires: libutempter-devel BuildRequires: systemd-devel BuildRequires: systemd +BuildRequires: systemd-rpm-macros BuildRequires: libcap-ng-devel BuildRequires: %{pypkg}-devel BuildRequires: gcc @@ -47,6 +48,7 @@ BuildRequires: po4a %ifarch ppc64le BuildRequires: librtas-devel %endif +%{?sysusers_requires_compat} # enable if make changes to build-system BuildRequires: autoconf @@ -65,6 +67,7 @@ Source12: util-linux-su.pamd Source13: util-linux-su-l.pamd Source14: util-linux-runuser.pamd Source15: util-linux-runuser-l.pamd +Source16: util-linux-uuidd-sysusers.conf ### Obsoletes & Conflicts & Provides Conflicts: initscripts < 9.79-4 @@ -102,13 +105,12 @@ Requires: libfdisk = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} ### RHEL-10.0 -# +### # 151635 - makeing /var/log/lastlog Patch0: 0000-login-lastlog-create.patch # Add `/run/motd.d` to the hardcoded MOTD_FILE # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: 0001-login-default-motd-file.patch - # Upstream Patch2: 0002-uuidd-fix-var-lib-libuuid-mode-uuidd-tmpfiles.conf.patch Patch3: 0003-uuidd-fix-typo-in-tmpfiles.conf.patch @@ -116,6 +118,9 @@ Patch3: 0003-uuidd-fix-typo-in-tmpfiles.conf.patch Patch4: 0004-more-make-sure-we-have-data-on-stderr.patch # RHEL-76070 - blkid: allow up to 64k erofs block sizes Patch5: 0005-blkid-allow-up-to-64k-erofs-block-sizes.patch + +### RHEL-10.1 +### # RHEL-79770 - agetty: fix stdin conversion to tty name Patch6: 0006-agetty-fix-stdin-conversion-to-tty-name.patch # RHEL-34021 - coresched: Manage core scheduling cookies for tasks @@ -126,14 +131,26 @@ Patch9: 0009-docs-add-European-Public-License-v1.2.patch Patch10: 0010-lscpu-Add-FUJITSU-aarch64-MONAKA-cpupart.patch Patch11: 0011-lscpu-New-Arm-part-numbers.patch -### RHEL-10.1.Z -# -# RHEL-134271 - libblkid: use snprintf() instead of sprintf() -Patch12: 0012-libblkid-use-snprintf-instead-of-sprintf.patch -# RHEL-133942 - login-utils: fix setpwnam() buffer use [CVE-2025-14104] -Patch13: 0013-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch -# RHEL-143966 - wall: always use utmp as fallback -Patch14: 0014-wall-always-use-utmp-as-fallback.patch +### RHEL-10.2 +### +# RHEL-113639 - lscpu: Add NVIDIA Olympus arm64 core +Patch12: 0012-lscpu-Add-NVIDIA-Olympus-arm64-core.patch +# RHEL-82162 - libfdisk: improve collision reporting +Patch13: 0013-libfdisk-improve-collision-reporting.patch +# RHEL-59867 - libfdisk: (dos) ignore incomplete EBR for non-wholedisk +Patch14: 0014-libfdisk-dos-ignore-incomplete-EBR-for-non-wholedisk.patch +# RHEL- - wall: always use utmp as fallback +Patch15: 0015-wall-always-use-utmp-as-fallback.patch +# RHEL-119786 - mount: improve --all documentation +Patch16: 0016-mount-improve-all-documentation.patch +# RHEL-123170 - libblkid: Fix probe_ioctl_tp assigning BLKGETDISKSEQ as physical +Patch17: 0017-libblkid-Fix-probe_ioctl_tp-assigning-BLKGETDISKSEQ-.patch +# RHEL-121120 - libblkid: use snprintf() instead of sprintf() +Patch18: 0018-libblkid-use-snprintf-instead-of-sprintf.patch +# RHEL-122367 - libfdisk: (dos) fix off-by-one in maximum last sector calculation +Patch19: 0019-libfdisk-dos-fix-off-by-one-in-maximum-last-sector-c.patch +# RHEL-133943- login-utils: fix setpwnam() buffer use [CVE-2025-14104] +Patch20: 0020-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch %description @@ -390,6 +407,8 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid +install -m 644 -D %{SOURCE16} %{buildroot}%{_sysusersdir}/uuidd-sysusers.conf + # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -486,11 +505,8 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \ %systemd_postun fstrim.service %pre -n uuidd -getent group uuidd >/dev/null || groupadd -r uuidd -getent passwd uuidd >/dev/null || \ -useradd -r -g uuidd -d /var/lib/libuuid -s /sbin/nologin \ - -c "UUID generator helper daemon" uuidd -exit 0 +%sysusers_create_compat %{SOURCE16} + # Please, keep uuidd running after installation! Note that systemd_post is # "systemctl preset" and it enable/disable service only. @@ -918,6 +934,7 @@ fi %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf +%{_sysusersdir}/uuidd-sysusers.conf %files -n libfdisk @@ -996,14 +1013,25 @@ fi %changelog ## START: Generated by rpmautospec -* Mon Feb 16 2026 Karel Zak - 2.40.2-16 -- wall: always use utmp as fallback +* Thu Jan 15 2026 Karel Zak - 2.40.2-18 +- use sysuser setting for uuidd -* Mon Jan 26 2026 Karel Zak - 2.40.2-15 +* Mon Dec 15 2025 Karel Zak - 2.40.2-17 +- Fix heap buffer overread in setpwnam() [CVE-2025-14104] + +* Wed Nov 19 2025 Karel Zak - 2.40.2-16 +- libfdisk: fix off-by-one in maximum last sector calculation + +* Thu Oct 23 2025 Karel Zak - 2.40.2-15 +- mount: improve --all documentation +- libblkid: Fix probe_ioctl_tp assigning BLKGETDISKSEQ as physical - libblkid: use snprintf() instead of sprintf() -* Tue Dec 16 2025 Karel Zak - 2.40.2-14 -- Fix setpwnam() buffer use [CVE-2025-14104] +* Mon Sep 29 2025 Karel Zak - 2.40.2-14 +- lscpu: Add NVIDIA Olympus arm64 core +- libfdisk: improve collision reporting +- libfdisk: (dos) ignore incomplete EBR for non-wholedisk +- wall: always use utmp as fallback * Wed Jul 30 2025 Karel Zak - 2.40.2-13 - lscpu: update table with ARM IDs