Changes between v2.39.2 and v2.39.3 -------------------------------------------- commit 2da5c904e18fdcffd2b252d641e6f76374c7b406 Author: Karel Zak Date: Mon Dec 4 13:32:56 2023 +0100 build-sys: release++ (v2.39.3) Signed-off-by: Karel Zak NEWS | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit 03c939edda81c5a4d6e5f5c1cb896e79c1e82e16 Author: Karel Zak Date: Mon Dec 4 13:31:54 2023 +0100 docs: update v2.39.3-ReleaseNotes Signed-off-by: Karel Zak Documentation/releases/v2.39.3-ReleaseNotes | 114 ++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) commit dafb120ef79c878cfd1b65c1d1c46497f17a7f7e Author: Karel Zak Date: Mon Dec 4 13:28:31 2023 +0100 docs: update AUTHORS file Signed-off-by: Karel Zak AUTHORS | 6 ++++++ 1 file changed, 6 insertions(+) commit bfc9691ce5d964b87f6c02cc236361b4772456d0 Author: Karel Zak Date: Mon Dec 4 13:26:16 2023 +0100 po-man: merge changes Signed-off-by: Karel Zak po-man/cs.po | 100 ++++++++++++++++++++++--------------------- po-man/de.po | 105 ++++++++++++++++++++++++---------------------- po-man/es.po | 103 +++++++++++++++++++++++---------------------- po-man/fr.po | 102 ++++++++++++++++++++++---------------------- po-man/pt_BR.po | 103 +++++++++++++++++++++++---------------------- po-man/sr.po | 105 ++++++++++++++++++++++++---------------------- po-man/uk.po | 105 ++++++++++++++++++++++++---------------------- po-man/util-linux-man.pot | 93 ++++++++++++++++++++-------------------- 8 files changed, 418 insertions(+), 398 deletions(-) commit d2232b60963a6e4e43fd359d1a4b552c4291b327 Author: Karel Zak Date: Mon Dec 4 13:26:08 2023 +0100 po: merge changes Signed-off-by: Karel Zak po/LINGUAS | 2 + po/ca.po | 2085 +++++++-------- po/cs.po | 2086 +++++++-------- po/da.po | 2086 +++++++-------- po/de.po | 2086 +++++++-------- po/es.po | 2795 ++++++++++---------- po/et.po | 2084 +++++++-------- po/eu.po | 2084 +++++++-------- po/fi.po | 2085 +++++++-------- po/fr.po | 2087 +++++++-------- po/gl.po | 2083 +++++++-------- po/hr.po | 2086 +++++++-------- po/hu.po | 2084 +++++++-------- po/id.po | 2084 +++++++-------- po/it.po | 2084 +++++++-------- po/ja.po | 2086 +++++++-------- po/ka.po | 7506 ++++++++++++++++++++++++++++++----------------------- po/ko.po | 2086 +++++++-------- po/nl.po | 2086 +++++++-------- po/pl.po | 2086 +++++++-------- po/pt.po | 2086 +++++++-------- po/pt_BR.po | 2086 +++++++-------- po/ro.po | 2795 ++++++++++---------- po/ru.po | 2085 +++++++-------- po/sk.po | 2084 +++++++-------- po/sl.po | 2084 +++++++-------- po/sr.po | 2086 +++++++-------- po/sv.po | 2086 +++++++-------- po/tr.po | 2086 +++++++-------- po/uk.po | 2086 +++++++-------- po/util-linux.pot | 2084 +++++++-------- po/vi.po | 2086 +++++++-------- po/zh_CN.po | 2086 +++++++-------- po/zh_TW.po | 2084 +++++++-------- 34 files changed, 39034 insertions(+), 36621 deletions(-) commit 4ab356c1c02c34cd3935e1bb0aa47ed6e27cfe3c Author: Remus-Gabriel Chelu Date: Mon Dec 4 13:20:13 2023 +0100 po: add ro.po (from translationproject.org) po/ro.po | 24247 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 24247 insertions(+) commit 7e147d16c06f14b3f760b620d4f359cef12fe4ad Author: Antonio Ceballos Roa Date: Mon Dec 4 13:20:13 2023 +0100 po: update es.po (from translationproject.org) po/es.po | 2241 ++++++++++++++++++++++++-------------------------------------- 1 file changed, 867 insertions(+), 1374 deletions(-) commit e8cb61f07430d5f1d624245a219c2e21694c5f52 Author: Karel Zak Date: Thu Nov 2 12:42:55 2023 +0100 lsfd: fix memory leak in append_filter_expr() Signed-off-by: Karel Zak (cherry picked from commit 53bcec4b25a60c125403a80a18ca3aacf1dc8269) misc-utils/lsfd.c | 2 ++ 1 file changed, 2 insertions(+) commit 192d8aaa07e088e44fcb78736a53baae1ead7ccd Author: Thomas Weißschuh Date: Sun Nov 19 17:21:25 2023 +0100 lsfd: avoid undefined behavior Passing a pointer to a different datatype to tfind() then were inserted evokes undefines behavior. This triggers UBSAN as shown below. Instead pass the proper structs. ``` ../misc-utils/lsfd.c:513:27: runtime error: member access within misaligned address 0x7ffe9ee6495c for type 'struct proc', which requires 8 byte alignment 0x7ffe9ee6495c: note: pointer points here 1a 1a 1a 1a 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d0 49 e6 9e fe 7f 00 00 ^ #0 0x56159cfa4a3b in proc_tree_compare ../misc-utils/lsfd.c:513 #1 0x7f9dd4d2d743 in __tfind (/usr/lib/libc.so.6+0x10f743) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658) #2 0x56159cfa4ac3 in get_proc ../misc-utils/lsfd.c:518 #3 0x56159cfe217b in anon_pidfd_get_name ../misc-utils/lsfd-unkn.c:203 #4 0x56159cfe1040 in unkn_fill_column ../misc-utils/lsfd-unkn.c:93 #5 0x56159cfaaa37 in fill_column ../misc-utils/lsfd.c:1178 #6 0x56159cfaaac5 in convert_file ../misc-utils/lsfd.c:1193 #7 0x56159cfaac4f in convert ../misc-utils/lsfd.c:1212 #8 0x56159cfb2b54 in main ../misc-utils/lsfd.c:2317 #9 0x7f9dd4c45ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658) #10 0x7f9dd4c45d89 in __libc_start_main (/usr/lib/libc.so.6+0x27d89) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658) #11 0x56159cfa3c34 in _start (util-linux/build-meson/lsfd+0x41c34) (BuildId: 35fece1a205f96a2dbfe7a0e93b658530de675c4) ``` Signed-off-by: Thomas Weißschuh (cherry picked from commit 816109f6ffb99d3a7aee1ff6c3467803dcd7939c) misc-utils/lsfd-sock-xinfo.c | 9 ++++++--- misc-utils/lsfd.c | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) commit 756588f8c8b2ed93c124ca15cfb3f0efc4a0f9f6 Author: Masatake YAMATO Date: Thu Jul 13 00:02:12 2023 +0900 lsfd: (man) fix the form for the optional argument of --inet option Signed-off-by: Masatake YAMATO (cherry picked from commit d0fe6e42fc18f11367e5ee6275c2619f9f61e892) misc-utils/lsfd.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8d78c1306d1a9d5ebf9ec058344685da0360b87b Author: zuoqian Date: Wed Nov 29 02:57:52 2023 +0000 Add Phytium FTC310 & FTC664 support Signed-off-by: zuoqian (cherry picked from commit c5d9cc4c787b8e58f918c901ee5a92286bf891e8) sys-utils/lscpu-arm.c | 2 ++ 1 file changed, 2 insertions(+) commit b75322cdb13c6c0b3789ff8fc19dcd017c069784 Author: unknown Date: Tue Sep 12 16:11:43 2023 +0800 Add Phytium FTC862 cpu model. fix:#2486 (cherry picked from commit b36a79254087107e2ddd9032a131832508ddb7f8) sys-utils/lscpu-arm.c | 1 + 1 file changed, 1 insertion(+) commit ec1b0eb36bd6c5a5079293ab03241163f61a8bf4 Author: Karel Zak Date: Tue Nov 28 14:40:48 2023 +0100 libmount: accept '\' as escape for options separator The libmount library can accept any characters as an option value when the value is quoted (e.g., foo="b,a,r"). However, overlayfs users have been using '\' as an escape character (e.g., lowerdir=foo\,bar). Although this escaping mechanism was never officially supported by libmount/mount, it worked for the old mount(2) API because it kept the options string unparsed for the mount(2) syscall. The introduction of the new mount API, which utilizes fsconfig(2) per option, has brought attention to this issue. This patch addresses the problem by introducing official support for '\' as an escape character for options separator. Suggested-by: Miklos Szeredi References: https://lore.kernel.org/all/CAOQ4uxhgUSPkYAV8SJu-SFszkJcVO3-M4DXf46nJUtXODrPk2g@mail.gmail.com/T/#ma8e6cfc1ce7229abc089e03eed99b23b90d701e5 Signed-off-by: Karel Zak (cherry picked from commit f6c29efa929cb8c741591ab38061e7921d53a997) lib/strutils.c | 2 +- libmount/src/hook_mount.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) commit 2e5f5c8d85338811595d321a77647a40e12321c9 Author: Thomas Weißschuh Date: Wed May 31 17:27:38 2023 +0200 tests: add ts_skip_docker Signed-off-by: Thomas Weißschuh (cherry picked from commit 023e77d26a12aa632266e2a967e944bcbf9c8a12) tests/functions.sh | 4 ++++ tests/ts/misc/setarch | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) commit 0b3254cac3a275bbe32af57c6037cd29c21324d7 Merge: ece194082 649843934 Author: Karel Zak Date: Mon Nov 27 11:25:29 2023 +0100 Merge branch 'stable-2.39/bcachefs-fixes' of https://github.com/t-8ch/util-linux into PR/stable-v2.39.3 * 'stable-2.39/bcachefs-fixes' of https://github.com/t-8ch/util-linux: tests: skip broken tests on docker libblkid: (bcachefs) add support for sub-device labels libblkid: (bcachefs) adapt to major.minor version commit 6498439340a16e6acee54987df016c6b7928b17a Author: Thomas Weißschuh Date: Wed May 31 17:31:01 2023 +0200 tests: skip broken tests on docker Signed-off-by: Thomas Weißschuh (cherry picked from commit d53284bb1e40f19ac065e52ff9df97d2caf60259) tests/ts/hwclock/show | 1 + tests/ts/lsfd/mkfds-mapped-packet-socket | 1 + tests/ts/lsfd/mkfds-netns | 1 + tests/ts/lsfd/mkfds-raw6 | 1 + tests/ts/lsfd/mkfds-ro-block-device | 1 + tests/ts/lsfd/mkfds-tcp6 | 1 + tests/ts/lsfd/mkfds-udp6 | 1 + tests/ts/lsfd/option-inet | 1 + tests/ts/mount/fstab-bind | 1 + tests/ts/mount/fstab-broken | 1 + tests/ts/mount/fstab-none | 1 + tests/ts/mount/move | 1 + 12 files changed, 12 insertions(+) commit fa9b5365861934faab9ba73bd405095f56f02e45 Author: Thomas Weißschuh Date: Tue Sep 26 09:43:35 2023 +0200 libblkid: (bcachefs) add support for sub-device labels Signed-off-by: Thomas Weißschuh (cherry picked from commit da91337a8109beb461c889ffe32701d3cb95aee2) libblkid/src/superblocks/bcache.c | 31 +++++++++++++++++++++++++++++ tests/expected/blkid/low-probe-bcachefs-2 | 8 +++++--- tests/ts/blkid/images-fs/bcachefs-2.img.xz | Bin 988 -> 1000 bytes 3 files changed, 36 insertions(+), 3 deletions(-) commit 3c5d991b0323b33816e661e52da5d6f5402f47b5 Author: Thomas Weißschuh Date: Sun Jul 9 20:03:57 2023 +0200 libblkid: (bcachefs) adapt to major.minor version The version superblock field has been split into a major and minor version part in the upstream code. Adapt libblkid to it. Link: https://lore.kernel.org/linux-bcachefs/20230709171551.2349961-11-kent.overstreet@linux.dev/ Signed-off-by: Thomas Weißschuh (cherry picked from commit 8beea162ce1c2f5a7565044b68434efbb96f0697) libblkid/src/superblocks/bcache.c | 10 +++++++++- tests/expected/blkid/low-probe-bcachefs | 2 +- tests/expected/blkid/low-probe-bcachefs-2 | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) commit ece194082fb318d0fa3fec31193ce6f61b97c67a Author: Goldwyn Rodrigues Date: Tue Oct 10 18:08:59 2023 -0500 libuuid: avoid truncate clocks.txt to improve performance Instead of explicitly truncating clocks.txt file, pad with whitespaces in the end of file. This is done to improve performance of libuuid on xfs filesystems. Instead of truncating the file, pad it with whitespaces. This is anyways used as a failsafe method in case truncate fails. The reason why this regression was introduced was because of: 869ae85dae64 ("xfs: flush new eof page on truncate to avoid post-eof corruption") An attempt to move the clocks.txt to /run (tmpfs) has been attempted before [1] and with commit ab2e7dd17 ("libuuid: move clock state file from /var/lib to /var/run"). The latter was reverted. [1] https://www.spinics.net/lists/util-linux-ng/msg17331.html Signed-off-by: Goldwyn Rodrigues libuuid/src/gen_uuid.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) commit 84a62c1a5a614bde2530544bf2558c73f0179d42 Author: Fabrice Fontaine Date: Tue Nov 7 18:43:57 2023 +0100 libuuid/src/gen_uuid.c: fix cs_min declaration Define cs_min through a define and not a const int to avoid the following build failure with -O0 raised since version 2.39 and https://github.com/util-linux/util-linux/commit/2fa4168c8bc9d5438bc1dfadda293c7c21b6fa59: libuuid/src/gen_uuid.c: In function 'uuid_generate_time_generic': libuuid/src/gen_uuid.c:536:33: error: initializer element is not constant THREAD_LOCAL int cache_size = cs_min; ^~~~~~ For consistency, also use define for cs_max and cs_factor Fixes: - http://autobuild.buildroot.org/results/2f80a5cdb523cc3c8c0f3693607a1be036b2ae98 Signed-off-by: Fabrice Fontaine libuuid/src/gen_uuid.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) commit 93239aa7869ddd236db8e5a28b4e6873ce6e0f22 Author: Karel Zak Date: Mon Nov 6 11:40:27 2023 +0100 libmount: fix possible NULL dereference [coverity scan] Signed-off-by: Karel Zak libmount/src/tab.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit a6def815e21d50db7a99ec74080c3fd7eb64e934 Author: Christian Hesse Date: Thu Nov 2 11:37:33 2023 +0100 meson: install wall executable with group 'tty' ... for proper permissions. meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit c6c1c69c3e83606eced938d841af03c1acef03a0 Author: Christian Hesse Date: Tue Oct 31 08:38:15 2023 +0100 meson: install write executable with group 'tty' ... to fix: write: effective gid does not match group of /dev/pts/3 meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit bf2cd1d5a6eb273fbb11931b86ae165e7da5a397 Author: Karel Zak Date: Thu Nov 2 10:41:03 2023 +0100 libmount: improve mnt_table_next_child_fs() The function utilizes the struct libmnt_itr to iterate through the mountinfo file but neglects the direction specified by the iterator. This a bug. The application must manage the direction, as, for instance, umount(8) requires the children of the mountpoint in reverse order. Fixes: https://github.com/util-linux/util-linux/issues/2552 Signed-off-by: Karel Zak libmount/src/tab.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) commit c14f5bf37adf681c378fc004f0996e0bcfd30ce0 Author: Karel Zak Date: Wed Nov 1 14:58:57 2023 +0100 docs: add SPDX to boilerplate.c Signed-off-by: Karel Zak Documentation/boilerplate.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) commit fdd9f11f5e38b044617d3bc5f6c00789096b233f Author: Karel Zak Date: Wed Nov 1 14:47:41 2023 +0100 disk-utils: add SPDX and Copyright notices Explicitly state the license (usually GPL-2.0-or-later; our default) and include copyright statements in all files to prevent false positive reports from license analysis tools. Add also add SPDX-License-Identifier tag to all files. Signed-off-by: Karel Zak README.licensing | 6 ++++-- disk-utils/addpart.c | 10 ++++++++++ disk-utils/blockdev.c | 10 +++++++++- disk-utils/cfdisk.c | 12 +++++++----- disk-utils/cramfs.h | 4 ++-- disk-utils/cramfs_common.c | 2 ++ disk-utils/delpart.c | 10 ++++++++++ disk-utils/fdformat.c | 9 +++++++++ disk-utils/fdisk-list.c | 10 ++++++++++ disk-utils/fdisk-list.h | 10 ++++++++++ disk-utils/fdisk-menu.c | 11 ++++++++++- disk-utils/fdisk.c | 12 +++++++----- disk-utils/fdisk.h | 10 ++++++++++ disk-utils/fsck.c | 12 ++++++++---- disk-utils/fsck.cramfs.c | 2 ++ disk-utils/fsck.minix.c | 12 +++++++++--- disk-utils/isosize.c | 11 +++++++++-- disk-utils/minix_programs.h | 10 ++++++++++ disk-utils/mkfs.bfs.c | 14 +++++++++++--- disk-utils/mkfs.c | 13 ++++++++++--- disk-utils/mkfs.cramfs.c | 2 ++ disk-utils/mkfs.minix.c | 10 +++++++--- disk-utils/mkswap.c | 7 +++++++ disk-utils/partx.c | 9 ++++++++- disk-utils/resizepart.c | 10 ++++++++++ disk-utils/swaplabel.c | 2 ++ 26 files changed, 195 insertions(+), 35 deletions(-) commit e7dbe9c788da98b86f8cf87bc20ec74e32206451 Author: Karel Zak Date: Wed Nov 1 13:56:01 2023 +0100 include/audit-arch: add missing SPDX Signed-off-by: Karel Zak include/audit-arch.h | 2 ++ 1 file changed, 2 insertions(+) commit 5ec7b14a72d9893d2a8d8c7f40cd45b44c9575c9 Author: Chris Hofstaedtler Date: Tue Oct 31 14:52:26 2023 +0100 setterm: avoid restoring flags from uninitialized memory Depending on the used compiler and flags, previously either F_SETFL was called with 0 or with a random value. Never with the intended previous flags. [kzak@redhat.com: - tiny coding style change] Signed-off-by: Chris Hofstaedtler Tested-by: Emanuele Rocca Signed-off-by: Karel Zak term-utils/setterm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 64d2300e6443c311219f187433046751a86ed18e Author: Connor-GH <72793802+Connor-GH@users.noreply.github.com> Date: Sat Oct 21 17:58:36 2023 -0500 Fix man page for col to correct documentation error text-utils/col.1.adoc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) commit 7cc2c962567fe40daa9b12481224e5a0e6f96c47 Author: Connor-GH <72793802+Connor-GH@users.noreply.github.com> Date: Sat Oct 21 17:55:49 2023 -0500 Update col.c to fix option mistake text-utils/col.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 122d7e7afb44d8a823e362673b0d2d1e31f7d478 Author: Thomas Weißschuh Date: Tue Oct 17 18:06:15 2023 +0200 umount: handle bindmounts during --recursive Fixes #2551 Signed-off-by: Thomas Weißschuh sys-utils/umount.c | 2 +- tests/expected/mount/umount-recursive | 1 + tests/ts/mount/umount-recursive | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) commit da18b31ff1cb504e3d288f77d1f1d1179c39e4d8 Author: Karel Zak Date: Fri Oct 13 00:03:15 2023 +0200 lscpu: fix caches separator for --parse= Fixes: https://github.com/util-linux/util-linux/issues/2544 Signed-off-by: Karel Zak sys-utils/lscpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 3a5c9c1dd6935fb16f15f210b80ce9c5228e6a19 Author: Anatoly Pugachev Date: Thu Oct 12 14:13:02 2023 +0300 Use empty libuser config file. In case of an absence /etc/libuser.conf, use empty file by pointing LIBUSER_CONF to /dev/null. This allows chfn/gecos to pass without error. PS: The "libuser" library is no longer maintained, and it was recommended by the original author to not use it anymore. tests/ts/chfn/gecos | 2 ++ 1 file changed, 2 insertions(+) commit 7058d793def09c3d4645e9efd1d8a5d212e839b0 Author: Yuezhang Mo Date: Wed Oct 11 18:42:11 2023 +0800 libblkid: exfat: fix fail to find volume label Commit f98b56326 set the maximum number of iterations to 10000. If the volume label is after the 10000th entry, the volume label will not be found. So this commit sets the maximum number of iterations to correct value 256×1024×1024/32. Fixes: f98b56326 ("libblkid: [exfat] Limit maximum number of iterations in find_label") Signed-off-by: Yuezhang Mo Reviewed-by: Andy Wu Reviewed-by: Aoyama Wataru libblkid/src/superblocks/exfat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit d065ff00a36b7244842f743372099837bc61328b Author: Thomas Weißschuh Date: Wed Oct 11 07:20:43 2023 +0200 blkpr: store return value of getopt_long in int getopt_long returns an int. Don't try to store it in a char. See #2538. Signed-off-by: Thomas Weißschuh sys-utils/blkpr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 9ca6f1712a5803e32e26e065e32e99837ba8b5d2 Author: Tobias Stoeckmann Date: Tue Oct 10 21:00:48 2023 +0200 lib/path: Set errno in case of fgets failure Signed-off-by: Tobias Stoeckmann lib/path.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) commit e2f0aa5c25c0295ef6187d3c53c2801fe17385e5 Author: Karel Zak Date: Mon Oct 9 12:18:31 2023 +0200 autotools: fix AC_DEFINE_UNQUOTED() use Let's use AC_DEFINE_UNQUOTED() for string-like content, otherwise use a simple AC_DEFINE(). Signed-off-by: Karel Zak configure.ac | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) commit cefd05c479e5456af8db2a86fabad165d247176b Author: Karel Zak Date: Mon Oct 9 12:15:20 2023 +0200 autotools: fix librtas check Fixes: https://github.com/util-linux/util-linux/discussions/2527 Signed-off-by: Karel Zak configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f27fbafb24bdcefaa2463d47abc18491c3497451 Author: Tobias Stoeckmann Date: Sun Oct 8 20:51:07 2023 +0200 lib/path: fix typos Signed-off-by: Tobias Stoeckmann lib/path.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) commit f8ab70477e2ca7ac050fd4e2337b76a1972c8aa3 Author: Tobias Stoeckmann Date: Sun Oct 8 20:47:53 2023 +0200 lib/path: set errno in case of error Some programs like lscpu expect errno to be set if ul_path_cpuparse fails. [kzak@redhat.com: - backport to stable/v2.39] Signed-off-by: Tobias Stoeckmann Signed-off-by: Karel Zak lib/path.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) commit 5ec30a362a5dd91c018c04a64fd1a481029dc4c6 Author: Tobias Stoeckmann Date: Sun Oct 8 20:41:29 2023 +0200 lib/path: fix possible out of boundary access If fgets reads from a file starting with a NUL byte in ul_path_cpuparse, then the check for newline leads to an out of boundary access. Proof of Concept (compile with --enable-asan): 1. Prepare /tmp/poc with required files ``` $ install -d /tmp/poc/sys/devices/system/cpu $ dd if=/dev/zero of=/tmp/poc/sys/devices/system/cpu/possible bs=1 count=1 $ install -D /dev/null /tmp/poc/proc/cpuinfo ``` 2. Run lscpu with sysroot option ``` $ lscpu --sysroot /tmp/poc ================================================================= ==78238==ERROR: AddressSanitizer: heap-buffer-overflow ``` Signed-off-by: Tobias Stoeckmann lib/path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit edc723cd3341ff3d3e660051525dca40a2af6b3b Author: Thomas Weißschuh Date: Mon Oct 2 22:24:21 2023 +0200 libblkid: reset errno before calling probefuncs The probers optionally use errno to communicate error details. When a leftover errno is set from libblkid internally this can confuse the probers. Signed-off-by: Thomas Weißschuh Signed-off-by: Karel Zak libblkid/src/partitions/partitions.c | 1 + libblkid/src/superblocks/superblocks.c | 1 + libblkid/src/topology/topology.c | 2 ++ 3 files changed, 4 insertions(+) commit 8de89778b945d552796f09576925310810ce798b Author: Thomas Weißschuh Date: Mon Oct 2 15:52:33 2023 +0200 setpriv: fix group argument completion Signed-off-by: Thomas Weißschuh bash-completion/setpriv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 41599054c7248f12c8a54d02f7161d0aff4275a9 Author: Thomas Weißschuh Date: Mon Oct 2 13:01:47 2023 +0200 libfdisk: reset errno before calling read() The else branch will be executed on short reads. For those errno is not reset so a random left-over errno value may be checked. Signed-off-by: Thomas Weißschuh libfdisk/src/utils.c | 1 + 1 file changed, 1 insertion(+) commit cce4e44059405f3170b166fbf1774bf4b89c11c4 Author: Thomas Weißschuh Date: Mon Oct 2 11:39:53 2023 +0200 blkid: fix call to err_exclusive_options err_exclusive_options needs to be passed the long options array, otherwise it will crash. Signed-off-by: Thomas Weißschuh misc-utils/blkid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit b718f985cb6cc3bc65618649e9f231ecafcf81fb Author: Jakub Wilk Date: Mon Oct 2 07:22:54 2023 +0200 docs: use HTTPS for GitHub clone URLs GitHub has dropped support for the git:// protocol: https://github.blog/changelog/2022-03-15-removed-unencrypted-git-protocol-and-certain-ssh-keys/ Documentation/howto-contribute.txt | 2 +- Documentation/howto-pull-request.txt | 4 ++-- README | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) commit 2bddfa6928af328675b2ffbfc9b6546e9ee81722 Author: Thomas Weißschuh Date: Thu Sep 28 00:51:42 2023 +0200 libblkid: (probe) handle probe without chain gracefully Signed-off-by: Thomas Weißschuh libblkid/src/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 3d31216787d6725fed361d27f0f01aff6ef46981 Author: Thomas Weißschuh Date: Thu Sep 28 00:40:28 2023 +0200 lib/idcache: always gracefully handle null cache The "get" functions already do this and some callers rely on it also for "add" ones. For completeness also handle it in free_idcache(). Signed-off-by: Thomas Weißschuh lib/idcache.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) commit 368521e45e1c9cb44145fc72c04d1cc903a883e8 Author: Thomas Weißschuh Date: Wed Sep 27 23:30:27 2023 +0200 script-playutils: close filestream in case ignore_line() fails Signed-off-by: Thomas Weißschuh term-utils/script-playutils.c | 2 ++ 1 file changed, 2 insertions(+) commit 087b0d2383b8ab1ee4564d692d5f797ac781896f Author: Thomas Weißschuh Date: Wed Sep 27 00:49:04 2023 +0200 libblkid: (vxfs) report endianness Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/vxfs.c | 2 ++ 1 file changed, 2 insertions(+) commit 7e5056f33bdfd867ce6f1a642f560fdf0b402c1e Author: Thomas Weißschuh Date: Tue Sep 26 00:27:22 2023 +0200 libblkid: (ntfs) validate that sector_size is a power of two The NTFS prober reads data based off an offset of the sector size. If the sector size is unaligned and the read data is cached then other probers can read unaligned values. Sector sizes for NTFS actually only make sense as power-of-two so validate that and as a sideeffect avoid the unaligned reads. Also add the reproducer from OSS-Fuzz that found this issue. Fixes #2509 Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/ntfs.c | 2 +- tests/ts/fuzzers/test_blkid_fuzz_files/oss-fuzz-62691 | Bin 0 -> 16863 bytes 2 files changed, 1 insertion(+), 1 deletion(-) commit f368ccc759f9684338da723a93449764d0a8e312 Author: Thomas Weißschuh Date: Fri Sep 22 11:20:36 2023 +0200 libsmartcols: handle nameless tables in export format fputs(NULL) is not allowed. Signed-off-by: Thomas Weißschuh libsmartcols/src/print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit f5cace8da07291c94b76b5cf80da1f921be67419 Author: Thomas Weißschuh Date: Fri Sep 22 20:21:38 2023 +0200 ldattach: don't call exit() from signal handler Instead use _exit(). Signed-off-by: Thomas Weißschuh sys-utils/ldattach.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 03c12a34c58d2550c6c718275950866d387d33f5 Author: Thomas Weißschuh Date: Fri Sep 22 20:08:22 2023 +0200 lslogins: fix realloc() loop allocation size If stat() fails the realloc loop would always try to allocate zero bytes. Signed-off-by: Thomas Weißschuh login-utils/lslogins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 83ba179b12d3c6c5f400bf78f2f742b1cc7ce256 Author: Thomas Weißschuh Date: Fri Sep 22 11:19:37 2023 +0200 lib/env: avoid underflow of read_all_alloc() return value read_all_alloc() returns a negative error on failure. When casting this to an unsigned type the failure check "< 1" will not work. Signed-off-by: Thomas Weißschuh lib/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 813851fba28cb3ecde6a7f0c90a7e343920cd8c7 Author: Thomas Weißschuh Date: Fri Sep 22 11:20:04 2023 +0200 libblkid: avoid memory leak of cachefile path Signed-off-by: Thomas Weißschuh libblkid/src/config.c | 1 + 1 file changed, 1 insertion(+) commit 4459623cde42a5d021a6d71e38fcdfd4fff3e171 Author: Thomas Weißschuh Date: Fri Sep 22 11:30:57 2023 +0200 libmount: gracefully handle NULL path in mnt_resolve_target() Signed-off-by: Thomas Weißschuh libmount/src/cache.c | 3 +++ 1 file changed, 3 insertions(+) commit dbde7a537f27b23d64a8d3f583af472357de7192 Author: Thomas Weißschuh Date: Fri Sep 22 19:53:24 2023 +0200 more: avoid out-of-bound access The realloc() needs to happen before that memory is used. Signed-off-by: Thomas Weißschuh text-utils/more.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit c26badd5d4295d52e987c75e69113edfb407fb27 Author: Thomas Weißschuh Date: Fri Sep 22 19:35:01 2023 +0200 libfdisk: handle allocation failure in fdisk_new_partition Signed-off-by: Thomas Weißschuh libfdisk/src/partition.c | 2 ++ 1 file changed, 2 insertions(+) commit 5c250aa6425fc3e35c07bce019eb4b7fa34bf722 Author: Tobias Stoeckmann Date: Tue Sep 19 20:45:40 2023 +0200 login: Use pid_t for child_pid Since child_pid keeps track of a PID, it should be of type pid_t and not of type int. Signed-off-by: Tobias Stoeckmann login-utils/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit be3f1712ee2e1e43d9b82b7cf4987c8a609a81ef Author: Tobias Stoeckmann Date: Tue Sep 19 20:42:03 2023 +0200 login: move comment In 0b4d75fae55b4a5ff8f65df8551c56cf1eeb9b08 the variable "timeout" has been moved from global to local scope, but its comment was not. Signed-off-by: Tobias Stoeckmann login-utils/login.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) commit 98be90b5bafa66d98655f8639efb3ffa984fc530 Author: Karel Zak Date: Mon Sep 18 13:08:57 2023 +0200 build-sys: fix libmount/src/hooks.c use Reported-by: Samuel Thibault Signed-off-by: Karel Zak libmount/meson.build | 1 - libmount/src/Makemodule.am | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) commit a711af02d32c0a0a31f1bbb943ffff2e94203e86 Author: Khem Raj Date: Fri Sep 15 00:18:18 2023 -0700 lscpu: Use 4K buffer size instead of BUFSIZ Some lines in /proc/cpuinfo can be large e.g. flags and can then truncate them in displaying them BUFSIZ can vary quite a bit e.g. glibc/linux systems its 8192 but on musl/linux and OSX its 1024, on mingW it is 256, some tests e.g. x86_64-64cpu-linux6.2.tar.gz has added really long line for cpu flags line which is greater than 1024 characters and hence this test fails on musl because lscpu -s reports truncated string Fixes x86_64-64cpu-linux6.2 tests Signed-off-by: Khem Raj s sys-utils/lscpu-cputype.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) commit 45c6136cba5f7607cca08c5aaab8e9b22ef87c25 Author: Karel Zak Date: Mon Sep 11 20:27:37 2023 +0200 autotools: fix typos Signed-off-by: Karel Zak configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit aa98c4ecc938a3459ffb759a444a8a585a9d0a3a Author: Karel Zak Date: Thu Aug 31 10:30:55 2023 +0200 libmount: make.stx_mnt_id use more robust Signed-off-by: Karel Zak libmount/src/hook_mount.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) commit c697c2bb69f55aa24b6c0e2e752548f823c53796 Author: Karel Zak Date: Thu Aug 31 10:26:37 2023 +0200 libmount: report statx in features list Let's make statx() support visible in "mount -V" output. Signed-off-by: Karel Zak libmount/src/version.c | 3 +++ 1 file changed, 3 insertions(+) commit 13711f3ab79dfa92e8815eb9b752ec2bf4832d80 Author: Karel Zak Date: Wed Aug 23 11:50:37 2023 +0200 libmount: fix statx() includes Using sys/stat.h and linux/stat is too tricky.h together. It seems better to rely on libc and use sys/stat.h only. Users affected by old libc must update to use recent util-linux. Fixes: https://github.com/util-linux/util-linux/issues/2448 Signed-off-by: Karel Zak configure.ac | 5 ++--- include/fileutils.h | 4 ++-- libmount/src/hook_mount.c | 2 +- libmount/src/utils.c | 2 +- meson.build | 5 ++--- 5 files changed, 8 insertions(+), 10 deletions(-) commit e9ed5a2b80bf8a76924caf8cd93b4cfff4d210a7 Author: Thomas Weißschuh Date: Tue Aug 29 12:44:48 2023 +0200 libblkid: (vfat) avoid modifying shared buffer Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/vfat.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) commit d2cadf0992cce589bfffeb603325c3c2fe54a991 Author: Thomas Weißschuh Date: Tue Aug 29 12:31:35 2023 +0200 libblkid: (jmicron_raid) use checksum APIs Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/jmicron_raid.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) commit c54c99efd0c3fc7f1e8db8b7191a6e1e3b295f1f Author: Thomas Weißschuh Date: Tue Aug 29 12:29:31 2023 +0200 libblkid: (jmicron_raid) avoid modifying shared buffer Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/jmicron_raid.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) commit 64418c52bc594abf01fc4ae8148e7aa93e4b3f22 Author: Thomas Weißschuh Date: Tue Aug 29 12:22:28 2023 +0200 libblkid: (zonefs) avoid modifying shared buffer Signed-off-by: Thomas Weißschuh libblkid/src/superblocks/zonefs.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) commit b66da7ce4a04d6c960817a56fe82498c4e7dea44 Author: Karel Zak Date: Mon Aug 28 13:21:33 2023 +0200 losetup: fix JSON MAJ:MIN Fixes: https://github.com/util-linux/util-linux/issues/2460 Signed-off-by: Karel Zak sys-utils/losetup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) commit 44d7bf2c8d1c6d34a40416807d16db6c07ac4916 Author: Thomas Weißschuh Date: Mon Aug 28 09:30:59 2023 +0200 lslogins: (man) fix -y option formatting Fixes #2461 Signed-off-by: Thomas Weißschuh login-utils/lslogins.1.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 7d6c71e51ed3c5f8505c67962b6d03490738a879 Author: Thomas Weißschuh Date: Mon Aug 28 09:01:49 2023 +0200 include: add DragonFlyBSD GPT partition types Fixes #2462 Signed-off-by: Thomas Weißschuh include/pt-gpt-partnames.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) commit 6b9fda87c4e5d0c6f945d7565197f157b9fa3d5f Author: Thomas Weißschuh Date: Wed Aug 23 11:58:33 2023 +0200 libblkid: (bcachefs) fix size validation Avoid signed shift out-of-bounds. Also mark the constants explitly as unsigned instead of casting. Signed-off-by: Thomas Weißschuh (cherry picked from commit befe455f59de8c7bc66b85ed52aae8cbc95325fa) libblkid/src/superblocks/bcache.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) commit acbf17ae8f8ee0f941fe98ed12f115f2b349bba8 Author: Karel Zak Date: Wed Aug 23 11:53:45 2023 +0200 libblkid: (bcachefs) fix compiler warning [-Werror=sign-compare] Addresses: https://github.com/util-linux/util-linux/pull/2427 Signed-off-by: Karel Zak (cherry picked from commit 17873d38fc97913c0a31d4bd08cfbfe45c4de5be) libblkid/src/superblocks/bcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 1ec71634aa4ef5ddca23d65c8a296f3614231e8a Author: Colin Gillespie Date: Wed Aug 9 18:28:07 2023 +1000 libblkid: (bcachefs) fix not detecting large superblocks Probing does not detect bcachefs filesystems with a superblock larger than 4KiB. Bcachefs superblocks grow in size and can become much larger than this. Increase the superblock maximum size limit to 1MiB. Validate the superblock isn't larger than the maximum size defined in the superblocks layout section. (cherry picked from commit 48d573797797650d96456979797c0155d58f61cb) libblkid/src/superblocks/bcache.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) commit 68564ebb50f8afab5a9527c534417e247cca0b27 Author: Filipe Manana Date: Thu Aug 17 10:20:13 2023 +0100 libmount: Fix regression when mounting with atime A regression was introduced in v2.39 that causes mounting with the atime option to fail: $ mkfs.ext4 -F /dev/sdi $ mount -o atime /dev/sdi /mnt/sdi mount: /mnt/sdi: not mount point or bad option. dmesg(1) may have more information after failed mount system call. The failure comes from the mount_setattr(2) call returning -EINVAL. This is because we pass an invalid value for the attr_clr argument. From a strace capture we have: mount_setattr(4, "", AT_EMPTY_PATH, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument) We can't pass MOUNT_ATTR_NOATIME to mount_setattr(2) through the attr_clr argument because all atime options are exclusive, so in order to set atime one has to pass MOUNT_ATTR__ATIME to attr_clr and leave attr_set as MOUNT_ATTR_RELATIME (which is defined as a value of 0). This can be read from the man page for mount_setattr(2) and also from the kernel source: $ cat fs/namespace.c static int build_mount_kattr(const struct mount_attr *attr, size_t usize, struct mount_kattr *kattr, unsigned int flags) { (...) /* * Since the MOUNT_ATTR_ values are an enum, not a bitmap, * users wanting to transition to a different atime setting cannot * simply specify the atime setting in @attr_set, but must also * specify MOUNT_ATTR__ATIME in the @attr_clr field. * So ensure that MOUNT_ATTR__ATIME can't be partially set in * @attr_clr and that @attr_set can't have any atime bits set if * MOUNT_ATTR__ATIME isn't set in @attr_clr. */ if (attr->attr_clr & MOUNT_ATTR__ATIME) { if ((attr->attr_clr & MOUNT_ATTR__ATIME) != MOUNT_ATTR__ATIME) return -EINVAL; /* * Clear all previous time settings as they are mutually * exclusive. */ kattr->attr_clr |= MNT_RELATIME | MNT_NOATIME; switch (attr->attr_set & MOUNT_ATTR__ATIME) { case MOUNT_ATTR_RELATIME: kattr->attr_set |= MNT_RELATIME; break; case MOUNT_ATTR_NOATIME: kattr->attr_set |= MNT_NOATIME; break; case MOUNT_ATTR_STRICTATIME: break; default: return -EINVAL; } (...) So fix this by setting attr_clr MOUNT_ATTR__ATIME if we want to clear any atime related option. Signed-off-by: Filipe Manana libmount/src/optlist.c | 13 ++++++++++++- tests/expected/libmount/context-mount-flags | 3 +++ tests/ts/libmount/context | 9 ++++++++- 3 files changed, 23 insertions(+), 2 deletions(-)