Karel Zak [Wed, 25 Jan 2023 11:40:30 +0000 (12:40 +0100)]
Merge branch 'dmesg-subsecond' of https://github.com/t-8ch/util-linux
* 'dmesg-subsecond' of https://github.com/t-8ch/util-linux:
dmesg: use subsecond granularity in iso format
dmesg: add subsecond granularity for --since and --until
lib/monotonic: get_suspended_time: use usec_t
timeutils: add utilities for usec_t conversions
dmesg: add test for --since and --until
Thomas Weißschuh [Wed, 11 Jan 2023 19:10:57 +0000 (19:10 +0000)]
lib/sysfs: fix semantics of blkdev_is_hotpluggable
This is now decoubled from the kernels notion of a removable *block*
device and instead uses removable kobjects.
This is the correct semantic for hotpluggable devices.
Thomas Weißschuh [Wed, 11 Jan 2023 18:13:50 +0000 (18:13 +0000)]
lib/sysfs: add function blkdev_is_removable
This exactly represents the kernels notion of a "removable" blockdevice.
That is, the device itself is persistent but can contain some sort of
medium that can be changed at runtime.
Specifically it is *not* hotpluggable.
Karel Zak [Tue, 24 Jan 2023 15:45:42 +0000 (16:45 +0100)]
Merge branch 'signal_safety' of https://github.com/crrodriguez/util-linux
* 'signal_safety' of https://github.com/crrodriguez/util-linux:
sulogin: only assign to variables written by signal handlers
hardlink: calling putchar is off-limits on a signal handler
hardlink: last_signal should be a volatile sig_atomic_t
pg: calling exit on signal handler is not allowed
lib:pager: fix signal safety issues
write: signal_received should be volatile qualified
flock: timeout_expired must be volatile qualified
last: should not use errx/warnx on signal handlers
su-common: bool is a distinct type in c2x
fsck: only assign to cancel_requested
fsck: use sig_atomic_t type fot signal handler global vars
Karel Zak [Mon, 23 Jan 2023 13:09:27 +0000 (14:09 +0100)]
Merge branch 'bcachefs-fuzz' of https://github.com/t-8ch/util-linux
* 'bcachefs-fuzz' of https://github.com/t-8ch/util-linux:
libblkid: bcachefs: limit maximum size of read superblock
libblkid: iso9660: don't warn on isonum mismatch
libblkid: bcachefs: fix member_field_end
libblkid: bcachefs: validate size of member field
libblkid: bcachefs: fix field type
libblkid: bcachefs: add reproducer for oss-fuzz 55282
libblkid: bcachefs: fix endless loop
Samanta Navarro [Fri, 20 Jan 2023 11:57:15 +0000 (11:57 +0000)]
fsck.cramfs: print correct error on 32-bit systems
On 32-bit systems the file length check does not handle files correctly
which are larger than 4 GB. Use an unsigned long long which is already
in place for blkdev_get_size.
ThomasKaiser [Sun, 22 Jan 2023 09:36:01 +0000 (10:36 +0100)]
Add HiSilicon's 0x48/0xd40 Cortex-A76 variant.
Both Kirin 980 and Kirin 810 feature big cores with 0x48/0xd40 ID though they are marketed/documented as Cortex-A76 by HiSilicon themselves. Kirin 980 shows a r1p0 stepping while newer 810 has r3p0.
ThomasKaiser [Sat, 21 Jan 2023 17:03:11 +0000 (18:03 +0100)]
Add 53/002:Samsung Exynos-m3
ID 002 for the Exynos-m3 core seems weird since Exynos-m1 had 001 but Samsung's Mongoose line differs only by stepping between M1 and M2
* Mongoose 1, for example [Exynos 8890](https://github.com/ThomasKaiser/sbc-bench/blob/master/results/Exynos-8890-highperformance.cpuinfo): Exynos-m1 / r1p1
* Mongoose 2, for example [Exynos 8895](https://github.com/ThomasKaiser/sbc-bench/blob/master/results/Exynos-8895.cpuinfo): Exynos-m1 / r4p0
* Mongoose 3, for example [Exynos 9810](https://github.com/ThomasKaiser/sbc-bench/blob/master/results/Exynos-9810.cpuinfo): Exynos-m3 / r1p0
Karel Zak [Fri, 20 Jan 2023 14:20:55 +0000 (15:20 +0100)]
lsfd: remove strcpy(), keep things based on sizeof()
* use safe xstrncpy() rather than strcpy()
* use sizeof() for static buffers rather than macro with real size
(this solution is more robust for future code changes)
* use xcalloc() to zeroize allocated memory
Samanta Navarro [Fri, 20 Jan 2023 11:57:15 +0000 (11:57 +0000)]
fsck.cramfs: print correct error on 32-bit systems
On 32-bit systems the file length check does not handle files correctly
which are larger than 4 GB. Use an unsigned long long which is already
in place for blkdev_get_size.
It's probably typo in the original path (too many brackets:-)). Let's
be explicit about the types used in the calculation. '1 << n' means
the left shift is on 'int', but we need '(t)1 << n'.
Karel Zak [Tue, 17 Jan 2023 15:15:11 +0000 (16:15 +0100)]
Merge branch 'blkdev' of https://github.com/ferivoz/util-linux
* 'blkdev' of https://github.com/ferivoz/util-linux:
lib/blkdev: use off_t for max values
lib/blkdev: set errno in more cases
lib/blkdev: handle interrupted read call
Samanta Navarro [Fri, 13 Jan 2023 11:51:52 +0000 (11:51 +0000)]
lib/blkdev: set errno in more cases
Applications evaluate errno in case of a -1 return value. Examples
within util-linux are fsck.cramfs and mkfs.minix. Set errno more often
to offer reasonable error codes to the application and user.
Samanta Navarro [Fri, 13 Jan 2023 11:50:40 +0000 (11:50 +0000)]
lib/blkdev: handle interrupted read call
The read call may fail if it is interrupted by a signal. Do not assume
that we have reached the end of the underlying block device because of
this. Use read_all which retries in these cases.
hardlink: calling putchar is off-limits on a signal handler
Using putchar or any stdio function in signal handlers will
lead to funny results as they cannot be async signal safe.
One can write to stdout instead.