Commit Graph

46751 Commits

Author SHA1 Message Date
Frantisek Sumsal
b4a21d5148 busctl: avoid asserting on NULL message
Avoid passing a NULL message to sd_bus_message_is_signal(), to not trip
over an assertion:

[  132.869436] H testsuite-82.sh[614]: + systemctl --no-block --check-inhibitors=yes soft-reboot
[  132.967386] H systemd[1]: Created slice system-systemd\x2dcoredump.slice.
[  133.018292] H systemd[1]: Starting inhibit.service...
[  133.122610] H systemd[1]: Started systemd-coredump@0-665-0.service.
[  133.163643] H systemd[1]: Started inhibit.service.
[  133.206836] H testsuite-82.sh[614]: + exec sleep infinity
[  133.236762] H systemd-logind[611]: The system will reboot now!
[  135.891607] H systemd-coredump[667]: [🡕] Process 663 (busctl) of user 0 dumped core.

                                        Stack trace of thread 663:
                                        #0  0x00007f2ec45e6acf raise (libc.so.6 + 0x4eacf)
                                        #1  0x00007f2ec45b9ea5 abort (libc.so.6 + 0x21ea5)
                                        #2  0x00007f2ec4b5c9a6 log_assert_failed (libsystemd-shared-255.so + 0x1ff9a6)
                                        #3  0x00007f2ec4b5dca5 log_assert_failed_return (libsystemd-shared-255.so + 0x200ca5)
                                        #4  0x00007f2ec4bb3df6 sd_bus_message_is_signal (libsystemd-shared-255.so + 0x256df6)
                                        #5  0x000000000040e478 monitor (busctl + 0xe478)
                                        #6  0x000000000040e82f verb_monitor (busctl + 0xe82f)
                                        #7  0x00007f2ec4b202cb dispatch_verb (libsystemd-shared-255.so + 0x1c32cb)
                                        #8  0x00000000004074fa busctl_main (busctl + 0x74fa)
                                        #9  0x0000000000407525 run (busctl + 0x7525)
                                        #10 0x000000000040ff67 main (busctl + 0xff67)
                                        #11 0x00007f2ec45d2d85 __libc_start_main (libc.so.6 + 0x3ad85)
                                        #12 0x00000000004044be _start (busctl + 0x44be)
                                        ELF object binary architecture: AMD x86-64
[  136.141152] H dbus-daemon[634]: [system] Monitoring connection :1.2 closed.
[  136.152233] H systemd[1]: busctl.service: Main process exited, code=dumped, status=6/ABRT
[  136.153996] H systemd[1]: busctl.service: Failed with result 'core-dump'.

The asertion in question:

Assertion 'm' failed at src/libsystemd/sd-bus/bus-message.c:1015, function sd_bus_message_is_signal(). Aborting.

We can get a NULL message here through sd_bus_process() ->
bus_process_internal() -> process_running(), so let's handle this case
appropriately.
2023-12-24 15:04:28 +01:00
Luca Boccassi
d6fe382122 Merge pull request #30594 from yuwata/udev-timeout-cleanups
udev: several cleanups for timeout settings
2023-12-24 00:26:13 +01:00
Luca Boccassi
65e1e29e55 Merge pull request #30596 from yuwata/sd-device-db-cleanups
sd-device: several cleanups for udev database related functions
2023-12-24 00:23:35 +01:00
Yu Watanabe
48e06208ce Merge pull request #30609 from YHNdnzj/analyze-fdstore
analyze-fdstore: minor fixups
2023-12-24 06:44:31 +09:00
Yu Watanabe
36013380a9 core/executor: use log level specified in LogLevelMax=
Follow-up for cc9f4cad8c.

Otherwise, still unexpected lines may be logged by executor.
2023-12-24 06:44:03 +09:00
Mike Yuan
c6195c9667 analyze-fdstore: don't log duplicate error
table_print_with_pager() logs print error internally.
2023-12-24 04:27:55 +08:00
Mike Yuan
9e710d2665 analyze-fdstore: ignore table header when checking stored fd count 2023-12-24 04:27:55 +08:00
Yu Watanabe
08ba85c71e systemctl: swap cached_id_map and cached_name_map at one more place
Follow-up for 2962a50850.
Fortunately, this does not change any behavior.

Replaces #30601.
Fixes CID#1532831.
2023-12-24 03:41:09 +09:00
Raito Bezarius
b49595503d networkd: support proxy_arp_pvlan sysctl
The proxy ARP private VLAN sysctl is useful for VLAN aggregation, see
https://sysctl-explorer.net/net/ipv4/proxy_arp_pvlan/ for details.
2023-12-24 03:40:03 +09:00
Yu Watanabe
b6c424a2f2 Merge pull request #30049 from yuwata/assert-return-critical
test: make assert_return() critical by default
2023-12-24 03:39:18 +09:00
Yu Watanabe
b5dd61e3c1 network: use json_variant_append_arrayb()
No functional change, just refactoring and shortening code.
2023-12-23 17:30:54 +00:00
Yu Watanabe
fce9e8a168 log: make assert_return() critical when -Dmode=developer
Triggering assert_return() should be a bug in general, and we should
really fix that.  But, previously, it is hard to notice such bug, as
it was not critical.
This is for making CI or our testing environment fail if we unexpectedly
trigger assert_return(). So, hopefully we can easily find such bugs.
2023-12-24 02:03:30 +09:00
Yu Watanabe
8161f6086e test: make assert_return() critical by default on fuzzer and unit tests
Several test cases intentionally trigger assert_return(). So, to avoid
the entire test fails, this introduces several macros that tentatively
make assert_return() not critical.
2023-12-24 02:02:18 +09:00
Yu Watanabe
93bb67090c log: introduce a knob to make assert_return() critical
These can be used to check if we trigger assert_return()
unexpectedly.

Co-authored-by: Frantisek Sumsal <frantisek@sumsal.cz>
2023-12-24 01:52:26 +09:00
Yu Watanabe
354171a5db Merge pull request #30603 from mrc0mmand/openssl-shenanigans
test/ukify: make the tests happy with OpenSSL 3.2.0+
2023-12-24 00:27:20 +09:00
Frantisek Sumsal
338ed5bea4 ukify: make the test happy with the latest OpenSSL
Which dropped some whitespaces in the output:

$ openssl version
OpenSSL 3.2.0 23 Nov 2023 (Library: OpenSSL 3.2.0 23 Nov 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
        Issuer: C=AU, ST=Some-State, O=Internet Widgits Pty Ltd

$ openssl version
OpenSSL 3.0.9 30 May 2023 (Library: OpenSSL 3.0.9 30 May 2023)
$ openssl x509 -in cert.pem -text -noout | grep Issuer
        Issuer: C = XX, L = Default City, O = Default Company Ltd

Making test-ukify unhappy:

>       assert 'Issuer: CN = SecureBoot signing key on host' in out
E       AssertionError: assert 'Issuer: CN = SecureBoot signing key on host' in '<...snip...>Issuer: CN=SecureBoot signing key on host archlinux2\n...'
2023-12-23 12:32:31 +01:00
Yu Watanabe
60d52f219e udev: use SD_EVENT_SIGNAL_PROCMASK 2023-12-23 00:32:48 +01:00
Luca Boccassi
bc22b7be0a Merge pull request #30590 from yuwata/backlight-cleanups
backlight: several cleanups and use dispatch_verb()
2023-12-22 23:35:27 +01:00
Yu Watanabe
6e574ebd00 sd-device: introduce device_has_db() helper function 2023-12-23 04:45:13 +09:00
Yu Watanabe
91fd5e6bd2 sd-device: modernize device_update_db() and friends
- introduce device_should_have_db(),
- split out device_get_db_path(),
- update log messages, especially clarify which stage is failed,
- use _cleanup_(unlink_and_freep) attribute,
- clear existing database file also when failed to create database directory
  and when failed to create temporary file.
2023-12-23 04:45:03 +09:00
Yu Watanabe
5d64eb5593 udev-spawn: slightly adjust logs about timed out commands
- Add full stop to the messages.
- Do not kill commands before logging "killing", but do after.
2023-12-23 04:31:39 +09:00
Yu Watanabe
9cceb0be21 udev: refuse too short timeout value
Setting zero or too short timeout for each uevent is meaningless, and
causes the system fails to boot. Let's refuse such values.

Also, delaying execution of RUN= commands too long also makes many
uevents enter the failed state. So, let's refuse such misconfiguration.
2023-12-23 04:30:32 +09:00
Yu Watanabe
aff70e1388 udev: handle event_timeout=infinity correctly
This is a paranoia, as even USEC_INFINITY / 3 is finite, it is still so large
in general.
2023-12-23 04:30:32 +09:00
Yu Watanabe
7ca31a91de udev-manager: use ASSERT_PTR() 2023-12-23 04:30:32 +09:00
Matt Layher
4591eccfc7 network: use varlink for networkctl check_netns_match()
Use varlink to detect networkd's network namespace when executing
networkctl rather than the D-Bus interface.

Signed-off-by: Matt Layher <mdlayher@gmail.com>
2023-12-23 04:25:13 +09:00