]> git.ipfire.org Git - thirdparty/util-linux.git/log
thirdparty/util-linux.git
2 years agolsfd: remove redundant parentheses surrounding return values
Masatake YAMATO [Fri, 10 Feb 2023 04:38:00 +0000 (13:38 +0900)] 
lsfd: remove redundant parentheses surrounding return values

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: rename tcp_state to l4_state and use the type instead of unsigned int
Masatake YAMATO [Fri, 10 Feb 2023 04:34:13 +0000 (13:34 +0900)] 
lsfd: rename tcp_state to l4_state and use the type instead of unsigned int

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use SCNu16 format specifier instead of cast operations (unsigned short)
Masatake YAMATO [Fri, 10 Feb 2023 01:11:17 +0000 (10:11 +0900)] 
lsfd: use SCNu16 format specifier instead of cast operations (unsigned short)

Suggested-by: Thomas Weißschuh <thomas@t-8ch.de>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use extra information loaded from /proc/net/raw
Masatake YAMATO [Wed, 1 Feb 2023 12:53:57 +0000 (21:53 +0900)] 
lsfd: use extra information loaded from /proc/net/raw

RAW.PROTOCOL field is added.

Thomas Weißschuh <thomas@t-8ch.de> suggested making the test
script executable.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: make TCP and UDP related code L3 protocol neutral
Masatake YAMATO [Thu, 2 Feb 2023 18:05:23 +0000 (03:05 +0900)] 
lsfd: make TCP and UDP related code L3 protocol neutral

So we can reuse the current L4 code when supporting IPv6.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: refactor the usage of tcp_decode_state()
Masatake YAMATO [Fri, 3 Feb 2023 00:32:01 +0000 (09:32 +0900)] 
lsfd: refactor the usage of tcp_decode_state()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: move the field representing connection state from tcp_xinfo to the L4 abstract...
Masatake YAMATO [Thu, 2 Feb 2023 17:23:08 +0000 (02:23 +0900)] 
lsfd: move the field representing connection state from tcp_xinfo to the L4 abstract layer

So we can reuse the code related to the field in
udp, raw, tcp6, udp6, and raw6.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: add methods to the L4 abstract layer for hidding differences in L3 protocols
Masatake YAMATO [Thu, 2 Feb 2023 16:55:29 +0000 (01:55 +0900)] 
lsfd: add methods to the L4 abstract layer for hidding differences in L3 protocols

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: implement code scanning lines in /proc/net/$proto as a method in the L4 abstrac...
Masatake YAMATO [Thu, 2 Feb 2023 16:26:42 +0000 (01:26 +0900)] 
lsfd: implement code scanning lines in /proc/net/$proto as a method in the L4 abstract layer

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: introduce L4 abstract layer stacked on IP and IP6
Masatake YAMATO [Thu, 2 Feb 2023 16:06:28 +0000 (01:06 +0900)] 
lsfd: introduce L4 abstract layer stacked on IP and IP6

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: fix wrong identifier namings (L3->L4)
Masatake YAMATO [Fri, 10 Feb 2023 03:49:37 +0000 (12:49 +0900)] 
lsfd: fix wrong identifier namings (L3->L4)

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: move kernel32_to_cpu() front in the source file
Masatake YAMATO [Thu, 2 Feb 2023 16:25:17 +0000 (01:25 +0900)] 
lsfd: move kernel32_to_cpu() front in the source file

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: remove an unused field from struct sock_xinfo_class
Masatake YAMATO [Thu, 2 Feb 2023 16:03:13 +0000 (01:03 +0900)] 
lsfd: remove an unused field from struct sock_xinfo_class

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: (man) fix the description of NAME fields for TCP and UDP sockets
Masatake YAMATO [Fri, 3 Feb 2023 14:59:07 +0000 (23:59 +0900)] 
lsfd: (man) fix the description of NAME fields for TCP and UDP sockets

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: adjust coding style, insert space after "switch" keyword
Masatake YAMATO [Sun, 5 Feb 2023 21:59:38 +0000 (06:59 +0900)] 
lsfd: adjust coding style, insert space after "switch" keyword

2 years agoMerge branch 'lsfd-minor-updates' of https://github.com/masatake/util-linux
Karel Zak [Thu, 2 Feb 2023 15:33:53 +0000 (16:33 +0100)] 
Merge branch 'lsfd-minor-updates' of https://github.com/masatake/util-linux

* 'lsfd-minor-updates' of https://github.com/masatake/util-linux:
  lsfd: use skip_space()
  lsfd: use "struct in_addr" to represent IPv4 addresses
  lsfd: don't put a spcae between a function and its arguments
  lsfd: delete a redundant cast operation
  tests: (mkfds) fix typos in error messages
  tests: (mkfds) fix typos in factory descriptions
  tests: (mkfds) check the privilege required in the factory to run

2 years agoinclude/cctype: fix License header
Karel Zak [Thu, 2 Feb 2023 15:20:43 +0000 (16:20 +0100)] 
include/cctype: fix License header

This file has been originally imported from gnulib with GPL header,
but it's now available with LGPLv2+ now (since gnulib commit https://git.savannah.gnu.org/cgit/gnulib.git/commit/lib/c-ctype.h?id=5ffa144085078c72e7d60759ab2d6100b04cd2c2).

Fixes: https://github.com/util-linux/util-linux/issues/2050
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsfd: use skip_space()
Masatake YAMATO [Sat, 28 Jan 2023 03:09:02 +0000 (12:09 +0900)] 
lsfd: use skip_space()

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: use "struct in_addr" to represent IPv4 addresses
Masatake YAMATO [Tue, 24 Jan 2023 22:30:31 +0000 (07:30 +0900)] 
lsfd: use "struct in_addr" to represent IPv4 addresses

So we can use macros defined in netinet/in.h.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: don't put a spcae between a function and its arguments
Masatake YAMATO [Wed, 1 Feb 2023 17:34:20 +0000 (02:34 +0900)] 
lsfd: don't put a spcae between a function and its arguments

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agolsfd: delete a redundant cast operation
Masatake YAMATO [Tue, 24 Jan 2023 22:30:31 +0000 (07:30 +0900)] 
lsfd: delete a redundant cast operation

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) fix typos in error messages
Masatake YAMATO [Tue, 31 Jan 2023 12:07:22 +0000 (21:07 +0900)] 
tests: (mkfds) fix typos in error messages

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) fix typos in factory descriptions
Masatake YAMATO [Sat, 28 Jan 2023 23:31:27 +0000 (08:31 +0900)] 
tests: (mkfds) fix typos in factory descriptions

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agotests: (mkfds) check the privilege required in the factory to run
Masatake YAMATO [Wed, 1 Feb 2023 12:44:46 +0000 (21:44 +0900)] 
tests: (mkfds) check the privilege required in the factory to run

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2 years agoMerge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Wed, 1 Feb 2023 11:25:12 +0000 (12:25 +0100)] 
Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux

2 years agochrt: (man) fix indention and properly mark examples
Karel Zak [Wed, 1 Feb 2023 11:22:59 +0000 (12:22 +0100)] 
chrt: (man) fix indention and properly mark examples

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'chrt-examples' of https://github.com/anarcat/util-linux
Karel Zak [Wed, 1 Feb 2023 11:16:04 +0000 (12:16 +0100)] 
Merge branch 'chrt-examples' of https://github.com/anarcat/util-linux

* 'chrt-examples' of https://github.com/anarcat/util-linux:
  add more concrete examples of how to use chrt(1)

2 years agolslogins: (man) add note about new accounts
Karel Zak [Tue, 31 Jan 2023 15:16:21 +0000 (16:16 +0100)] 
lslogins: (man) add note about new accounts

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolslogins: explain password statuses
Karel Zak [Tue, 31 Jan 2023 15:08:00 +0000 (16:08 +0100)] 
lslogins: explain password statuses

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoAdding older Apple cores based on XNU kernel source
ThomasKaiser [Tue, 31 Jan 2023 10:58:24 +0000 (11:58 +0100)] 
Adding older Apple cores based on XNU kernel source

Naming based on https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/arm/cpuid.h.auto.html and https://en.wikipedia.org/wiki/List_of_Apple_codenames#Apple-designed_processors

No idea about IDs of the new and more interesting Sawtooth and Everest cores in the A16 SoC. I'll leave this for the Asahi people to discover...

2 years agoadd more concrete examples of how to use chrt(1)
Antoine Beaupré [Thu, 26 Jan 2023 16:21:16 +0000 (11:21 -0500)] 
add more concrete examples of how to use chrt(1)

I've come looking at this manpage with the simple "how do I make this
process use realtime scheduling?" question and couldn't find a
definite answer. Of course, RT is more complicated than "just make
this real time": there's various queues and scheduling classes, but I
think it's worth giving a good, simple example that should basically
work.

In particular, my use case was "my audio is stuttering, is this a
scheduling problem?" By picking the RR scheduler, we set a realtime
scheduling priority that's lower than kernel threads (e.g. migration
is FF/99, irq is FF/50) so that we go above existing processes, but
without kicking out more critical systems.

This, of course, is a matter of taste, and the settings here are a
little arbitrary. I send this patch in the hope that either those are
accepted as canon (which would surprise me) or that someone comes up
with a more canonical example.

The "reset" example also seems like a more critical addition to the
manual.

Finally, I change the name of the section from USAGE to the more
standard EXAMPLES, as per man-pages(7).

2 years agoMerge branch 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux
Karel Zak [Thu, 26 Jan 2023 16:01:10 +0000 (17:01 +0100)] 
Merge branch 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux

* 'test_blkid_fuzz' of https://github.com/t-8ch/util-linux:
  libblkid: add test_blkid_fuzz_sample

2 years agoMerge branch 'chmod' of https://github.com/ferivoz/util-linux
Karel Zak [Thu, 26 Jan 2023 16:00:28 +0000 (17:00 +0100)] 
Merge branch 'chmod' of https://github.com/ferivoz/util-linux

* 'chmod' of https://github.com/ferivoz/util-linux:
  fsck.cramfs: fix error message

2 years agofsck.cramfs: check directory entry names
Samanta Navarro [Thu, 26 Jan 2023 11:56:42 +0000 (11:56 +0000)] 
fsck.cramfs: check directory entry names

Do not accept slashes in names or the special entries "." and ".." in
directories while extracting files.

[kzak@redhat.com: - add errx_path() to report the path]

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agofsck.cramfs: fix error message
Samanta Navarro [Thu, 26 Jan 2023 11:55:33 +0000 (11:55 +0000)] 
fsck.cramfs: fix error message

The error message for a failing chmod call contains chown as reason.
Fix this by stating that chmod failed.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2 years agolibblkid: add test_blkid_fuzz_sample
Thomas Weißschuh [Wed, 25 Jan 2023 17:21:18 +0000 (17:21 +0000)] 
libblkid: add test_blkid_fuzz_sample

This can be used to easily reproduce crashes produced by the fuzzers.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: avoid overflow in address comparisions
Thomas Weißschuh [Wed, 25 Jan 2023 05:47:16 +0000 (05:47 +0000)] 
libblkid: bcachefs: avoid overflow in address comparisions

Adding the offset to the address may overflow and break the comparision,
use substraction instead.

Addresses: #2030
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: simplify member field size validation
Thomas Weißschuh [Wed, 25 Jan 2023 05:40:15 +0000 (05:40 +0000)] 
libblkid: bcachefs: simplify member field size validation

We can avoid messing with pointers by just directly checking the size.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: remove superfluous validations
Thomas Weißschuh [Wed, 25 Jan 2023 05:34:50 +0000 (05:34 +0000)] 
libblkid: bcachefs: remove superfluous validations

These checks are redundant as we already validated
* `dev_idx < bcs->nr_devices` in `probe_bcachefs()`
* `field + BYTES(field) < sb_end` in `probe_bcachefs_sb_fields()`
* `member_field_end(members, bcs->nr_devices - 1) == field + BYTES(field)`
  right above.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolibblkid: bcachefs: use uint64_t for structure length
Thomas Weißschuh [Wed, 25 Jan 2023 04:27:20 +0000 (04:27 +0000)] 
libblkid: bcachefs: use uint64_t for structure length

The value of "u64s" can overflow when multiplied by 8.
Use a larger type to avoid this.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agowhereis: add glob(7) support (new option -g)
Karel Zak [Wed, 25 Jan 2023 13:13:05 +0000 (14:13 +0100)] 
whereis: add glob(7) support (new option -g)

$ whereis -b -g 'find???'
find???: /usr/bin/findmnt /usr/bin/findscu

Fixes: https://github.com/util-linux/util-linux/issues/2021
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibblkid: align nilfs superblock [OSS-Fuzz 55382]
Karel Zak [Wed, 25 Jan 2023 12:37:05 +0000 (13:37 +0100)] 
libblkid: align nilfs superblock [OSS-Fuzz 55382]

Addresses: https://github.com/util-linux/util-linux/issues/2043
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agotools/config-gen: improve fuzzers
Karel Zak [Wed, 25 Jan 2023 12:36:47 +0000 (13:36 +0100)] 
tools/config-gen: improve fuzzers

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodmesg: (man) add note about subsecond support
Karel Zak [Wed, 25 Jan 2023 11:57:50 +0000 (12:57 +0100)] 
dmesg: (man) add note about subsecond support

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'dmesg-subsecond' of https://github.com/t-8ch/util-linux
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

2 years agofstrim: add --types to filter out by filesystem types
Karel Zak [Tue, 24 Jan 2023 18:03:15 +0000 (19:03 +0100)] 
fstrim: add --types to filter out by filesystem types

Fixes: https://github.com/util-linux/util-linux/issues/2040
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolibmount: don't require return argument in get-like functions
Karel Zak [Tue, 24 Jan 2023 17:35:21 +0000 (18:35 +0100)] 
libmount: don't require return argument in get-like functions

Fixes: https://github.com/util-linux/util-linux/issues/2039
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolsblk: use sysfs_blkdev_is_removable()
Karel Zak [Tue, 24 Jan 2023 16:38:49 +0000 (17:38 +0100)] 
lsblk: use sysfs_blkdev_is_removable()

Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agolib/sysfs: fix semantics of blkdev_is_hotpluggable
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.

2 years agoeject: also use sysfs_blkdev_is_removable
Thomas Weißschuh [Wed, 11 Jan 2023 18:14:03 +0000 (18:14 +0000)] 
eject: also use sysfs_blkdev_is_removable

It correctly represents devices that can be ejected.

2 years agolib/sysfs: add TODO about removable usb devices
Thomas Weißschuh [Wed, 11 Jan 2023 18:17:35 +0000 (18:17 +0000)] 
lib/sysfs: add TODO about removable usb devices

The usage of the "removable" attribute by the USB subsystem is
incorrect.

2 years agolib/sysfs: add function blkdev_is_removable
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.

2 years agoinclude/c: add functions to print from signal handlers
Karel Zak [Tue, 24 Jan 2023 16:05:25 +0000 (17:05 +0100)] 
include/c: add functions to print from signal handlers

Addresses: https://github.com/util-linux/util-linux/pull/2019
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agodmesg: use subsecond granularity in iso format
Thomas Weißschuh [Sat, 21 Jan 2023 00:44:14 +0000 (00:44 +0000)] 
dmesg: use subsecond granularity in iso format

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agodmesg: add subsecond granularity for --since and --until
Thomas Weißschuh [Fri, 20 Jan 2023 06:18:36 +0000 (06:18 +0000)] 
dmesg: add subsecond granularity for --since and --until

Fixes #1708

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/monotonic: get_suspended_time: use usec_t
Thomas Weißschuh [Sat, 21 Jan 2023 00:21:10 +0000 (00:21 +0000)] 
lib/monotonic: get_suspended_time: use usec_t

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agotimeutils: add utilities for usec_t conversions
Thomas Weißschuh [Sat, 21 Jan 2023 00:28:30 +0000 (00:28 +0000)] 
timeutils: add utilities for usec_t conversions

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agodmesg: add test for --since and --until
Thomas Weißschuh [Fri, 20 Jan 2023 06:10:48 +0000 (06:10 +0000)] 
dmesg: add test for --since and --until

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoMerge branch 'signal_safety' of https://github.com/crrodriguez/util-linux
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

2 years agolib/timeutils: set TZ=GMT for unit test
Karel Zak [Tue, 24 Jan 2023 15:42:42 +0000 (16:42 +0100)] 
lib/timeutils: set TZ=GMT for unit test

It seems better to explicitly set timezone rather than assume some
default libc behavior and system setting.

Addresses: https://github.com/util-linux/util-linux/pull/2025
Signed-off-by: Karel Zak <kzak@redhat.com>
2 years agoMerge branch 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux
Karel Zak [Tue, 24 Jan 2023 15:20:25 +0000 (16:20 +0100)] 
Merge branch 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux

* 'parsetimestamp-usec' of https://github.com/t-8ch/util-linux:
  lib/timeutils: parse_timestamp: parse usecs
  lib/timeutils: parse_timestamp: fix second parsing
  lib/timeutils: parse_timestamp: add unittests
  lib/timeutils: parse_timestamp: allow fixed reference time
  ci: update shellcheck
  ci: disable shellcheck warning for unused variables

2 years agoMerge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux
Karel Zak [Tue, 24 Jan 2023 15:19:39 +0000 (16:19 +0100)] 
Merge branch 'patch-1' of https://github.com/ThomasKaiser/util-linux

* 'patch-1' of https://github.com/ThomasKaiser/util-linux:
  Change ThunderX3T110 core name to ThunderX3-T110
  Add missing Exynos M5 core
  Add missing Cavium cores
  Add missing Ampere cores
  Add missing ARM-cores
  Add HiSilicon's 0x48/0xd40 Cortex-A76 variant.
  Add exynos-m4
  Add 53/002:Samsung Exynos-m3

2 years agolib/timeutils: parse_timestamp: parse usecs
Thomas Weißschuh [Fri, 20 Jan 2023 02:18:30 +0000 (02:18 +0000)] 
lib/timeutils: parse_timestamp: parse usecs

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/timeutils: parse_timestamp: fix second parsing
Thomas Weißschuh [Fri, 20 Jan 2023 02:43:34 +0000 (02:43 +0000)] 
lib/timeutils: parse_timestamp: fix second parsing

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/timeutils: parse_timestamp: add unittests
Thomas Weißschuh [Fri, 20 Jan 2023 02:13:36 +0000 (02:13 +0000)] 
lib/timeutils: parse_timestamp: add unittests

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agolib/timeutils: parse_timestamp: allow fixed reference time
Thomas Weißschuh [Fri, 20 Jan 2023 02:06:04 +0000 (02:06 +0000)] 
lib/timeutils: parse_timestamp: allow fixed reference time

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2 years agoci: update shellcheck
Thomas Weißschuh [Fri, 20 Jan 2023 06:43:59 +0000 (06:43 +0000)] 
ci: update shellcheck

2 years agoci: disable shellcheck warning for unused variables
Thomas Weißschuh [Fri, 20 Jan 2023 06:42:31 +0000 (06:42 +0000)] 
ci: disable shellcheck warning for unused variables

2 years agoMerge branch 'fix-befs' of https://github.com/mbroz/util-linux
Karel Zak [Mon, 23 Jan 2023 13:11:56 +0000 (14:11 +0100)] 
Merge branch 'fix-befs' of https://github.com/mbroz/util-linux

* 'fix-befs' of https://github.com/mbroz/util-linux:
  libblkid: befs - avoid undefined shift

2 years agoMerge branch 'lsfd-const' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 23 Jan 2023 13:11:12 +0000 (14:11 +0100)] 
Merge branch 'lsfd-const' of https://github.com/t-8ch/util-linux

* 'lsfd-const' of https://github.com/t-8ch/util-linux:
  lsfd: make a few structs const

2 years agoMerge branch 'blkpr' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 23 Jan 2023 13:10:42 +0000 (14:10 +0100)] 
Merge branch 'blkpr' of https://github.com/t-8ch/util-linux

* 'blkpr' of https://github.com/t-8ch/util-linux:
  blkpr: mark data const
  meson: add blkpr

2 years agoMerge branch 'bcachefs-fuzz' of https://github.com/t-8ch/util-linux
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

2 years agoMerge branch 'sizeof-member' of https://github.com/t-8ch/util-linux
Karel Zak [Mon, 23 Jan 2023 13:08:33 +0000 (14:08 +0100)] 
Merge branch 'sizeof-member' of https://github.com/t-8ch/util-linux

* 'sizeof-member' of https://github.com/t-8ch/util-linux:
  uuidd: use sizeof_member
  last: use sizeof_member
  libblkid: iso9660: use sizeof_member

2 years agoMerge branch 'more_mempcpy' of https://github.com/crrodriguez/util-linux
Karel Zak [Mon, 23 Jan 2023 13:07:13 +0000 (14:07 +0100)] 
Merge branch 'more_mempcpy' of https://github.com/crrodriguez/util-linux

* 'more_mempcpy' of https://github.com/crrodriguez/util-linux:
  remove no longer needed braces
  replace open-coded instances of mempcpy

2 years agoMerge branch 'cramfs32' of https://github.com/ferivoz/util-linux
Karel Zak [Mon, 23 Jan 2023 13:05:59 +0000 (14:05 +0100)] 
Merge branch 'cramfs32' of https://github.com/ferivoz/util-linux

* 'cramfs32' of https://github.com/ferivoz/util-linux:
  fsck.cramfs: print correct error on 32-bit systems

2 years agolsfd: make a few structs const
Thomas Weißschuh [Sun, 22 Jan 2023 17:55:48 +0000 (17:55 +0000)] 
lsfd: make a few structs const

2 years agoblkpr: mark data const
Thomas Weißschuh [Sun, 22 Jan 2023 14:27:24 +0000 (14:27 +0000)] 
blkpr: mark data const

2 years agomeson: add blkpr
Thomas Weißschuh [Sun, 22 Jan 2023 14:27:12 +0000 (14:27 +0000)] 
meson: add blkpr

2 years agolibblkid: bcachefs: limit maximum size of read superblock
Thomas Weißschuh [Sun, 22 Jan 2023 17:40:15 +0000 (17:40 +0000)] 
libblkid: bcachefs: limit maximum size of read superblock

2 years agolibblkid: iso9660: don't warn on isonum mismatch
Thomas Weißschuh [Sat, 21 Jan 2023 05:43:40 +0000 (05:43 +0000)] 
libblkid: iso9660: don't warn on isonum mismatch

we are not doing anything about it anyways

2 years agolibblkid: bcachefs: fix member_field_end
Thomas Weißschuh [Sun, 22 Jan 2023 03:36:06 +0000 (03:36 +0000)] 
libblkid: bcachefs: fix member_field_end

The end of this member is the start of the next one, not the start of
the current one.

2 years agolibblkid: bcachefs: validate size of member field
Thomas Weißschuh [Sun, 22 Jan 2023 01:52:29 +0000 (01:52 +0000)] 
libblkid: bcachefs: validate size of member field

2 years agolibblkid: bcachefs: fix field type
Thomas Weißschuh [Sat, 21 Jan 2023 05:32:22 +0000 (05:32 +0000)] 
libblkid: bcachefs: fix field type

2 years agolibblkid: bcachefs: add reproducer for oss-fuzz 55282
Thomas Weißschuh [Sat, 21 Jan 2023 05:25:34 +0000 (05:25 +0000)] 
libblkid: bcachefs: add reproducer for oss-fuzz 55282

2 years agolibblkid: bcachefs: fix endless loop
Thomas Weißschuh [Sat, 21 Jan 2023 05:01:55 +0000 (05:01 +0000)] 
libblkid: bcachefs: fix endless loop

When a field has size 0 it will loop forever.

See #2031

2 years agouuidd: use sizeof_member
Thomas Weißschuh [Sat, 21 Jan 2023 00:52:49 +0000 (00:52 +0000)] 
uuidd: use sizeof_member

2 years agolast: use sizeof_member
Thomas Weißschuh [Sat, 21 Jan 2023 00:52:39 +0000 (00:52 +0000)] 
last: use sizeof_member

2 years agolibblkid: iso9660: use sizeof_member
Thomas Weißschuh [Sat, 21 Jan 2023 00:52:23 +0000 (00:52 +0000)] 
libblkid: iso9660: use sizeof_member

2 years agoremove no longer needed braces
Cristian Rodríguez [Sat, 21 Jan 2023 18:19:28 +0000 (18:19 +0000)] 
remove no longer needed braces

2 years agoreplace open-coded instances of mempcpy
Cristian Rodríguez [Thu, 19 Jan 2023 18:25:08 +0000 (18:25 +0000)] 
replace open-coded instances of mempcpy

2 years agofsck.cramfs: print correct error on 32-bit systems
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.

Proof of Concept:

- Prepare a file containing a CramFS
```
mkdir owo
mkfs.cramfs owo owo.iso
dd if=/dev/zero of=owo.iso bs=1 seek=4294967296 count=1 conv=notrunc
fsck.cramfs owo.iso
```

- Check the file
```
fsck.cramfs owo.iso
```

You will see: `fsck.cramfs: file length too short`
Better message is: `fsck.cramfs: file extends past end of filesystem`

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2 years agolibblkid: befs - avoid undefined shift
Milan Broz [Mon, 23 Jan 2023 12:46:31 +0000 (13:46 +0100)] 
libblkid: befs - avoid undefined shift

BEFS does not check maximal value for ag_shift leading
to undefined behavior. Avoid this by limiting shift size.

Reproducer found with OSS-Fuzz (issue 55285) running over
cryptsetup project (blkid is used in header init).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2 years agoChange ThunderX3T110 core name to ThunderX3-T110
ThomasKaiser [Mon, 23 Jan 2023 12:15:16 +0000 (13:15 +0100)] 
Change ThunderX3T110 core name to ThunderX3-T110

(for consistency reasons)

2 years agolsfd: make a few structs const
Thomas Weißschuh [Sun, 22 Jan 2023 17:55:48 +0000 (17:55 +0000)] 
lsfd: make a few structs const

2 years agolibblkid: bcachefs: limit maximum size of read superblock
Thomas Weißschuh [Sun, 22 Jan 2023 17:40:15 +0000 (17:40 +0000)] 
libblkid: bcachefs: limit maximum size of read superblock

2 years agoAdd missing Exynos M5 core
ThomasKaiser [Sun, 22 Jan 2023 17:18:44 +0000 (18:18 +0100)] 
Add missing Exynos M5 core

https://github.com/Dr-Noob/cpufetch/blob/master/src/arm/uarch.c#L310

2 years agoblkpr: mark data const
Thomas Weißschuh [Sun, 22 Jan 2023 14:27:24 +0000 (14:27 +0000)] 
blkpr: mark data const

2 years agomeson: add blkpr
Thomas Weißschuh [Sun, 22 Jan 2023 14:27:12 +0000 (14:27 +0000)] 
meson: add blkpr

2 years agoAdd missing Cavium cores
ThomasKaiser [Sun, 22 Jan 2023 11:45:08 +0000 (12:45 +0100)] 
Add missing Cavium cores

https://github.com/ThomasKaiser/sbc-bench/commit/37332238c0a8b7c1555dca9d18a7c98362564416#diff-fdfd2a032c64d6e9ba92a3197cad6b26573c7094433d74efa4ae80f44f65aa99

2 years agoAdd missing Ampere cores
ThomasKaiser [Sun, 22 Jan 2023 11:41:36 +0000 (12:41 +0100)] 
Add missing Ampere cores

https://github.com/ThomasKaiser/sbc-bench/commit/37332238c0a8b7c1555dca9d18a7c98362564416#diff-fdfd2a032c64d6e9ba92a3197cad6b26573c7094433d74efa4ae80f44f65aa99