Merged
Conversation
… bdev numbers Close #2349 stat(2) on some filesystems including btrfs reports a block device number (bdev number) with a offset. On the other hand, "inotify wd" field of /proc/$pid/fdinfo/$fd for an inotify file reports bdev numbers without offsets. The offset caused the failure of lsfd::mkfds-inotify test case on btrfs. Unlike stat(2), findmnt can report bdev numbers without offsets. Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Masatake YAMATO <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
…il-linux * 'hwclock-set-jitter' of https://github.com/badgerious/util-linux: hwclock: Improve set error in the face of jitter
* 'patch-22' of https://github.com/mariobl/util-linux: mount: Fix markup and typos in man page
* 'patch-18' of https://github.com/mariobl/util-linux: lsclocks: Fix markup and typos in man page
* 'patch-20' of https://github.com/mariobl/util-linux: uuidd: Fix markup in man page (uuidd.8)
* 'patch-25' of https://github.com/mariobl/util-linux: write: Add missing section header in man page
* 'patch-24' of https://github.com/mariobl/util-linux: hexdump: Add missing section header in man page
Reported-by: Thomas Weißschuh <[email protected]> Signed-off-by: Karel Zak <[email protected]>
…com/masatake/util-linux * 'tests--lsfd--mkfds-inotify-on-btrfs' of https://github.com/masatake/util-linux: tests: (lsfd) add a case testing INOTIFY.INODES.RAW column on btrfs tests: (test_mkfds::inotify) add "dir" and "file" parameters tests: (lsfd::mkfds-inotify) use findmnt(1) instead of stat(1) to get bdev numbers
…inux * 'libmount/tests/root' of https://github.com/t-8ch/util-linux: libmount: (tests) don't require root for update tests
.. for alphabetical order and to match sibling file su.1.adoc.
.. to pave the way for a future with -P|--pty for a default.
Addresses #2359 Signed-off-by: Vicki Pfau <[email protected]>
Addresses: #2690 Signed-off-by: Karel Zak <[email protected]>
Handle cases where the number of fm_mapped_extents is zero by ignoring the fm_extents array, as zero is a valid value. Fixes: #2687 Signed-off-by: Karel Zak <[email protected]>
Fixes: #2689 Signed-off-by: Karel Zak <[email protected]>
* 'PR/dmesg-fixes' of github.com:karelzak/util-linux-work: tests: update dmesg deltas dmesg: fix delta calculation dmesg: don't affect delta by --since
Suggested-by: Stanislav Brabec <[email protected]> Signed-off-by: Karel Zak <[email protected]>
LUKS2 binary header contains offset field that describes where the header should be located. If this offset is not correct, blkid should tread this header as invalid. This patch fixes problem when both swap and LUKS headers are present (LUKS header was swapped out) and detected LUKS header is at a wrong offset. As LUKS has higher priority, it confuses detection. Signed-off-by: Milan Broz <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
This was being rendered in the man page as:
The program was rewritten by Karel Zak Karel Zak <[email protected]>.
Instead of as:
The program was rewritten by Karel Zak <[email protected]>.
* improve branch naming suggestions * recommend GitHub, make Mailing-List optional Signed-off-by: Karel Zak <[email protected]>
* 'fix-luks-offset' of https://github.com/mbroz/util-linux: libblkid: Check offset in LUKS2 header
* 'meson/lslogins' of https://github.com/t-8ch/util-linux: meson: fix build of lslogins with -Dbuild-liblastlog2=disabled
* 'patch-2' of https://github.com/ThomasKaiser/util-linux: Add Microsoft as vendor and Cobalt 100 core
* 'foo' of https://github.com/emanuele6/util-linux: docs: remove duplicated author name in namei.1.adoc
- use space around operators - remove unnecessary line breaks from errx() calls Signed-off-by: Karel Zak <[email protected]>
- single exit by goto - always print specific error (e.g. "Couldn't update login time ...") and then optionally generic ll2 error Signed-off-by: Karel Zak <[email protected]>
Signed-off-by: Karel Zak <[email protected]>
- let's make it more compatible with the rest of util-linux - don't initialize global static variables (it's unnecessary) Signed-off-by: Karel Zak <[email protected]>
Let's make simple and stupid. Signed-off-by: Karel Zak <[email protected]>
The more(1) command utilizes signalfd() to monitor signals and reads
commands from the user via stderr (as stdin is typically used for
piping and not for user interaction).
However, the current more_poll() implementation ignores stderr. As a result,
more(1) waits on read(stderr) while completely ignoring signals. This issue
becomes evident when using commands like:
grep foo /path/file | more
In such cases, it's only possible to exit 'more' by pressing 'q';
CTRL+C does not work.
Changes:
- Refactor more_poll() code:
- Introduce an enum to access pfd[] items instead of using magical constants.
- Implement a while() loop to handle EAGAIN or POLLHUP.
- Ignore stdin after POLLHUP (indicating that the pipe's peer closed).
- Ensure stderr is also checked.
- Use return codes akin to classic poll().
Note: I have doubts regarding the usability of stdin in more_poll(),
as the function is primarily used to wait for user input (via stderr)
and to monitor signals. Nevertheless, it is retained for potential use
in detecting when the pipe's peer (or the entire session) has been
terminated (see commit 68e14d3).
Signed-off-by: Karel Zak <[email protected]>
The absence of an official 'Public domain' definition is the reason why, for example, the Fedora distribution aggregates all variants from various projects to make them reviewable. This commit unifies the 'Public domain' statements to make it simple. Signed-off-by: Karel Zak <[email protected]>
* 'enosys/dump' of https://github.com/t-8ch/util-linux: setpriv: (tests) add seccomp test setpriv: add support for seccomp filters enosys: add functionality to dump filter include: introduce seccomp.h
enosys will use it. Signed-off-by: Thomas Weißschuh <[email protected]>
[[email protected]: - resolve merge conflict in main()] Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Thomas Weißschuh <[email protected]>
…work * 'PR/lastlog2-cleanup' of github.com:karelzak/util-linux-work: lastlog2: convert check_user() to boolean-like macro lastlog: cleanup function definitions lastlog2: make longopts[] static-const lastlog: improve errors printing lastlog2: improve coding style
* 'PR/more-poll' of github.com:karelzak/util-linux-work: more: fix poll() use
* 'lastlog2_error' of https://github.com/schubi2/util-linux: liblastlog2: Improved sqlite3 error handling
ahmed-masud
pushed a commit
that referenced
this pull request
Feb 23, 2024
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
util-linux#3 0x56159cfe217b in anon_pidfd_get_name ../misc-utils/lsfd-unkn.c:203
util-linux#4 0x56159cfe1040 in unkn_fill_column ../misc-utils/lsfd-unkn.c:93
util-linux#5 0x56159cfaaa37 in fill_column ../misc-utils/lsfd.c:1178
util-linux#6 0x56159cfaaac5 in convert_file ../misc-utils/lsfd.c:1193
util-linux#7 0x56159cfaac4f in convert ../misc-utils/lsfd.c:1212
util-linux#8 0x56159cfb2b54 in main ../misc-utils/lsfd.c:2317
util-linux#9 0x7f9dd4c45ccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
util-linux#10 0x7f9dd4c45d89 in __libc_start_main (/usr/lib/libc.so.6+0x27d89) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
util-linux#11 0x56159cfa3c34 in _start (util-linux/build-meson/lsfd+0x41c34) (BuildId: 35fece1a205f96a2dbfe7a0e93b658530de675c4)
```
Signed-off-by: Thomas Weißschuh <[email protected]>
ahmed-masud
pushed a commit
that referenced
this pull request
Feb 23, 2024
Submission to Project: util-linux Open Incident: util-linux#2609 at github.com/util-linux/issues/2609 Component: util-linux/sys-utils File: dmesg.c Code level patch applied against: 2.39.3 - latest code pulled from git.github.com:util-linux/util-linux.git Revision: #1 on 2023/12/08 per Review from Karel Zak Revision: #2 on 2023/12/12 Adjust line offsets for master update and Add caller_id_size init to dmesg -K Revision: util-linux#3 on 2023/12/12 Use of sizeof for cidbuf and limit search for caller_id to dmesg prefix to msg text Revision: util-linux#4 on 2023/12/15 Ensure SYSLOG and kmsg inputs have caller_id_size set appropriately Revision: util-linux#5 on 2023/12/24 Make caller_id width consistent with makedumpfile Revision: util-linux#6 on 2023/12/30 Use updated test naming convention Revision: util-linux#7 on 2024/01/04 Normalize kmsg caller_id spacing for test platforms by removing caller_id padding in test generated output. Add support to standard dmesg command for the optional Linux Kernel debug CONFIG option PRINTK_CALLER which adds an optional dmesg field that contains the Thread Id or CPU Id that is issuing the printk to add the message to the kernel ring buffer. This makes debugging simpler as dmesg entries for a specific thread or CPU can be recognized. The dmesg -S using the old syslog interface supports printing the PRINTK_CALLER field but currently standard dmesg does not support printing the field if present. There are utilities that use dmesg and so it would be optimal if dmesg supported PRINTK_CALLER as well. The additional field provided by PRINTK_CALLER is only present if it was configured for the Linux kernel where the dmesg command is run. It is a debug option and not configured by default so the dmesg output will only change for those kernels where the option was configured when the kernel was built. For users who went to the trouble to configure PRINTK_CALLER and have the extra field available for debugging, having dmesg print the field is very helpful. Size of the PRINTK_CALLER field is determined by the maximum number tasks that can be run on the system which is limited by the value of /proc/sys/kernel/pid_max as pid values are from 0 to value - 1. This value determines the number of id digits needed by the caller id. The PRINTK_CALLER field is printed as T<id> for a Task Id or C<id> for a CPU Id for a printk in CPU context. The values are left space padded and enclosed in parentheses such as: [ T123] or [ C16] For consistency with dmesg -S which supports the PRINTK_CALLER field the field is printed followed by a space. For JSON format output the PRINTK_CALLER field is identified as caller as that is consistent with it's naming in /dev/kmsg. No space padding is used to reduce space consumed by the JSON output. So the output from the command on a system with PRINTK_CALLER field enabled in the Linux .config file the dmesg output appears as: > dmesg ... [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub and > dmesg -x ... kern :info : [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub and > dmesg -J ... },{ "pri": 6, "time": 520.897104, "caller": "T3919", "msg": "usb 3-3: Product: USB 2.0 Hub" },{ and > dmesg -J -x ... },{ "fac": "kern", "pri": "info", "time": 520.897104, "caller": "T3919", "msg": "usb 3-3: Product: USB 2.0 Hub" },{ > For comparison: > dmesg -S ... [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub and > dmesg -S -x ... kern :info : [ 520.897104] [ T3919] usb 3-3: Product: USB 2.0 Hub Note: When dmesg uses the old syslog interface the reserved space for the PRINTK_CALLER field is capped at 5 digits because 32-bit kernels are capped at 32768 as the max number of PIDs. However, 64-bit systems are currently capped at 2^22 PIDs (0 - 4194303). The PID cap is set by PID_MAX_LIMIT but the system limit can be less so we use /proc/sys/kernel/pid_max to determine the size needed to hold the maximum PID value size for the current system. Many 64-bit systems support 2^22 PIDs (0 - 4194303) and you see: > dmesg -x ... kern :info : [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found ... kern :info : [ 9830.456898] [ T98982] cgroup: fork rejected by pids ... kern :info : [14301.158878] [ T137336] cgroup: fork rejected by pids ... kern :info : [18980.803190] [T1637865] cgroup: fork rejected by pids ... > dmesg -S -x ... kern :info : [ 520.899558] [ T3919] hub 3-3:1.0: USB hub found ... kern :info : [ 9830.456898] [T98982] cgroup: fork rejected by pids ... kern :info : [14301.158878] [T137336] cgroup: fork rejected by pids ... kern :info : [18980.803190] [T1637865] cgroup: fork rejected by pids ... This is the only difference seen with PRINTK_CALLER configured and printing between the dmesg /dev/kmsg interface and the dmesg -S syslog interface. Tests naming has been revised based on naming convention Thomas used to introduce dmest json tests. The naming of test and input files that reside in tests/ts/dmeg include: <name> are existing dmesg syslog interface tests and input files. cid-<name> are dmesg syslog interface caller_id tests and input files. json-<name> are dmesg kmsg interface tests and input files. cid-json-<name> are dmesg kmsg interface caller_id tests and input files. Resulting expected files match the test names. Signed-off-by: Ivan Delalande <[email protected]> Signed-off-by: Edward Chron <[email protected]> Signed-off-by: Karel Zak <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.